Modified: trunk/reactos/lib/kernel32/debug/debugger.c
Modified: trunk/reactos/lib/ntdll/def/ntdll.def
Modified: trunk/reactos/ntoskrnl/io/dir.c
Modified: trunk/reactos/ntoskrnl/ntoskrnl.def
Modified: trunk/reactos/tools/nci/sysfuncs.lst
--- trunk/reactos/lib/kernel32/debug/debugger.c 2005-01-18 13:27:28 UTC (rev 13121)
+++ trunk/reactos/lib/kernel32/debug/debugger.c 2005-01-18 13:59:14 UTC (rev 13122)
@@ -24,24 +24,24 @@
{
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 @@
ClientId.UniqueThread = (HANDLE)dwThreadId;
Status = DbgUiContinue(&ClientId, dwContinueStatus);
-
- if(!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return FALSE;
@@ -76,16 +75,50 @@
/*
- * @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;
}
--- trunk/reactos/lib/ntdll/def/ntdll.def 2005-01-18 13:27:28 UTC (rev 13121)
+++ trunk/reactos/lib/ntdll/def/ntdll.def 2005-01-18 13:59:14 UTC (rev 13122)
@@ -154,7 +154,7 @@
NtOpenThread@16
NtOpenThreadToken@16
NtOpenTimer@12
-NtPlugPlayControl@16
+NtPlugPlayControl@12
NtPrivilegeCheck@12
NtPrivilegedServiceAuditAlarm@20
NtPrivilegeObjectAuditAlarm@24
@@ -182,7 +182,6 @@
NtQueryMultipleValueKey@24
NtQueryMutant@20
NtQueryObject@20
-NtQueryOleDirectoryFile@44
NtQueryPerformanceCounter@8
NtQuerySection@20
NtQuerySecurityObject@20
@@ -573,7 +572,7 @@
;RtlQueryPropertyNames
;RtlQueryPropertySet
RtlQueryRegistryValues@20
-;RtlQuerySecutityObject
+;RtlQuerySecurityObject
;RtlQueryTagHeap
RtlQueryTimeZoneInformation@4
RtlRaiseException@4
@@ -770,7 +769,7 @@
ZwOpenThread@16
ZwOpenThreadToken@16
ZwOpenTimer@12
-ZwPlugPlayControl@16
+ZwPlugPlayControl@12
ZwPrivilegeCheck@12
ZwPrivilegedServiceAuditAlarm@20
ZwPrivilegeObjectAuditAlarm@24
@@ -798,7 +797,6 @@
ZwQueryMultipleValueKey@24
ZwQueryMutant@20
ZwQueryObject@20
-ZwQueryOleDirectoryFile@44
ZwQueryPerformanceCounter@8
ZwQuerySection@20
ZwQuerySecurityObject@20
--- trunk/reactos/ntoskrnl/io/dir.c 2005-01-18 13:27:28 UTC (rev 13121)
+++ trunk/reactos/ntoskrnl/io/dir.c 2005-01-18 13:59:14 UTC (rev 13122)
@@ -236,11 +236,4 @@
return(Status);
}
-NTSTATUS STDCALL NtQueryOleDirectoryFile(VOID)
-{
- UNIMPLEMENTED;
- return(STATUS_NOT_IMPLEMENTED);
-}
-
-
/* EOF */
--- trunk/reactos/ntoskrnl/ntoskrnl.def 2005-01-18 13:27:28 UTC (rev 13121)
+++ trunk/reactos/ntoskrnl/ntoskrnl.def 2005-01-18 13:59:14 UTC (rev 13122)
@@ -815,7 +815,6 @@
NtQueryInformationProcess@20
NtQueryInformationThread@20
NtQueryInformationToken@20
-;NtQueryOleDirectoryFile@44 <--- ?
NtQueryQuotaInformationFile@36
NtQuerySecurityObject@20
NtQuerySystemInformation@16
--- trunk/reactos/tools/nci/sysfuncs.lst 2005-01-18 13:27:28 UTC (rev 13121)
+++ trunk/reactos/tools/nci/sysfuncs.lst 2005-01-18 13:59:14 UTC (rev 13122)
@@ -102,7 +102,7 @@
NtOpenThreadToken 4
NtOpenThreadTokenEx 5
NtOpenTimer 3
-NtPlugPlayControl 4
+NtPlugPlayControl 3
NtPowerInformation 5
NtPrivilegeCheck 3
NtPrivilegedServiceAuditAlarm 5
@@ -133,7 +133,6 @@
NtQueryMultipleValueKey 6
NtQueryMutant 5
NtQueryObject 5
-NtQueryOleDirectoryFile 11
NtQueryPerformanceCounter 2
NtQueryQuotaInformationFile 9
NtQuerySection 5