diff --git a/reactos/lib/kernel32/debug/debugger.c b/reactos/lib/kernel32/debug/debugger.c index 3513555049d..bedecc76076 100644 --- a/reactos/lib/kernel32/debug/debugger.c +++ b/reactos/lib/kernel32/debug/debugger.c @@ -24,24 +24,24 @@ CheckRemoteDebuggerPresent ( { HANDLE DebugPort; NTSTATUS Status; - - if(pbDebuggerPresent == NULL) + + if (pbDebuggerPresent == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + Status = NtQueryInformationProcess(hProcess, ProcessDebugPort, (PVOID)&DebugPort, sizeof(HANDLE), NULL); - if(NT_SUCCESS(Status)) + if (NT_SUCCESS(Status)) { *pbDebuggerPresent = ((DebugPort != NULL) ? TRUE : FALSE); return TRUE; } - + SetLastErrorByStatus(Status); return FALSE; } @@ -64,8 +64,7 @@ ContinueDebugEvent ( ClientId.UniqueThread = (HANDLE)dwThreadId; Status = DbgUiContinue(&ClientId, dwContinueStatus); - - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); return FALSE; @@ -76,16 +75,50 @@ ContinueDebugEvent ( /* - * @unimplemented + * NOTE: I'm not sure if the function is complete. + * + * @unmplemented */ -BOOL -WINAPI -DebugActiveProcess ( - DWORD dwProcessId - ) +BOOL WINAPI +DebugActiveProcess(DWORD dwProcessId) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + CSRSS_API_REQUEST Request; + CSRSS_API_REPLY Reply; + HANDLE hProcess; + NTSTATUS Status; + + hProcess = OpenProcess(PROCESS_ALL_ACCESS, + FALSE, + dwProcessId); + if (hProcess == NULL) + return FALSE; + + /* Notify CSRSS */ + Request.Type = CSRSS_DEBUG_PROCESS; + Request.Data.DebugProcessRequest.DebuggeeProcessId = dwProcessId; + Request.Data.DebugProcessRequest.DebuggerProcessId = GetCurrentProcessId(); + Request.Data.DebugProcessRequest.DebuggerThreadId = GetCurrentThreadId(); + Status = CsrClientCallServer(&Request, + &Reply, + sizeof(CSRSS_API_REQUEST), + sizeof(CSRSS_API_REPLY)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Reply.Status)) + { + SetLastError(ERROR_ACCESS_DENIED); + return FALSE; + } + + CloseHandle(hProcess); + + /* Connect the current process (debugger) to the debug subsystem */ + Status = DbgUiConnectToDbg(); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; } diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index e03542d8ba0..1b9bb31c0db 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -154,7 +154,7 @@ NtOpenSymbolicLinkObject@12 NtOpenThread@16 NtOpenThreadToken@16 NtOpenTimer@12 -NtPlugPlayControl@16 +NtPlugPlayControl@12 NtPrivilegeCheck@12 NtPrivilegedServiceAuditAlarm@20 NtPrivilegeObjectAuditAlarm@24 @@ -182,7 +182,6 @@ NtQueryKey@20 NtQueryMultipleValueKey@24 NtQueryMutant@20 NtQueryObject@20 -NtQueryOleDirectoryFile@44 NtQueryPerformanceCounter@8 NtQuerySection@20 NtQuerySecurityObject@20 @@ -573,7 +572,7 @@ RtlQueryProcessDebugInformation@12 ;RtlQueryPropertyNames ;RtlQueryPropertySet RtlQueryRegistryValues@20 -;RtlQuerySecutityObject +;RtlQuerySecurityObject ;RtlQueryTagHeap RtlQueryTimeZoneInformation@4 RtlRaiseException@4 @@ -770,7 +769,7 @@ ZwOpenSymbolicLinkObject@12 ZwOpenThread@16 ZwOpenThreadToken@16 ZwOpenTimer@12 -ZwPlugPlayControl@16 +ZwPlugPlayControl@12 ZwPrivilegeCheck@12 ZwPrivilegedServiceAuditAlarm@20 ZwPrivilegeObjectAuditAlarm@24 @@ -798,7 +797,6 @@ ZwQueryKey@20 ZwQueryMultipleValueKey@24 ZwQueryMutant@20 ZwQueryObject@20 -ZwQueryOleDirectoryFile@44 ZwQueryPerformanceCounter@8 ZwQuerySection@20 ZwQuerySecurityObject@20 diff --git a/reactos/ntoskrnl/io/dir.c b/reactos/ntoskrnl/io/dir.c index f25ef751278..a9e65a8c184 100644 --- a/reactos/ntoskrnl/io/dir.c +++ b/reactos/ntoskrnl/io/dir.c @@ -236,11 +236,4 @@ NtQueryDirectoryFile( return(Status); } -NTSTATUS STDCALL NtQueryOleDirectoryFile(VOID) -{ - UNIMPLEMENTED; - return(STATUS_NOT_IMPLEMENTED); -} - - /* EOF */ diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 565050d4985..461ebe6aa04 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -815,7 +815,6 @@ NtQueryInformationFile@20 NtQueryInformationProcess@20 NtQueryInformationThread@20 NtQueryInformationToken@20 -;NtQueryOleDirectoryFile@44 <--- ? NtQueryQuotaInformationFile@36 NtQuerySecurityObject@20 NtQuerySystemInformation@16 diff --git a/reactos/tools/nci/sysfuncs.lst b/reactos/tools/nci/sysfuncs.lst index ebf608aed6c..f52329eb239 100644 --- a/reactos/tools/nci/sysfuncs.lst +++ b/reactos/tools/nci/sysfuncs.lst @@ -102,7 +102,7 @@ NtOpenThread 4 NtOpenThreadToken 4 NtOpenThreadTokenEx 5 NtOpenTimer 3 -NtPlugPlayControl 4 +NtPlugPlayControl 3 NtPowerInformation 5 NtPrivilegeCheck 3 NtPrivilegedServiceAuditAlarm 5 @@ -133,7 +133,6 @@ NtQueryKey 5 NtQueryMultipleValueKey 6 NtQueryMutant 5 NtQueryObject 5 -NtQueryOleDirectoryFile 11 NtQueryPerformanceCounter 2 NtQueryQuotaInformationFile 9 NtQuerySection 5