5 modified files
reactos/lib/kernel32
diff -u -r1.11 -r1.12
--- k32.h 30 Oct 2004 22:18:17 -0000 1.11
+++ k32.h 2 Nov 2004 21:51:25 -0000 1.12
@@ -1,4 +1,4 @@
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT 0x0502
#define __USE_W32API
#define NTOS_MODE_USER
#define __NO_CTYPE_INLINES
reactos/lib/kernel32
diff -u -r1.46 -r1.47
--- kernel32.def 2 Nov 2004 20:42:05 -0000 1.46
+++ kernel32.def 2 Nov 2004 21:51:25 -0000 1.47
@@ -439,6 +439,7 @@
GetProcessHeap@0
GetProcessHeaps@8
GetProcessId@4
+GetProcessIdOfThread@4
GetProcessIoCounters@8
GetProcessPriorityBoost@8
GetProcessShutdownParameters@8
@@ -485,6 +486,7 @@
GetTempPathA@8
GetTempPathW@8
GetThreadContext@8
+GetThreadId@4
GetThreadIOPendingFlag@8
GetThreadLocale@0
GetThreadPriority@4
reactos/lib/kernel32/misc
diff -u -r1.18 -r1.19
--- handle.c 24 Oct 2004 12:36:12 -0000 1.18
+++ handle.c 2 Nov 2004 21:51:25 -0000 1.19
@@ -1,4 +1,4 @@
-/* $Id: handle.c,v 1.18 2004/10/24 12:36:12 weiden Exp $
+/* $Id: handle.c,v 1.19 2004/11/02 21:51:25 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -213,8 +213,9 @@
if (IsConsoleHandle(hSourceHandle))
{
- if (FALSE == InternalGetProcessId(hSourceProcessHandle, &SourceProcessId) ||
- FALSE == InternalGetProcessId(hTargetProcessHandle, &TargetProcessId) ||
+ SourceProcessId = GetProcessId(hSourceProcessHandle);
+ TargetProcessId = GetProcessId(hTargetProcessHandle);
+ if (!SourceProcessId || !TargetProcessId ||
SourceProcessId != TargetProcessId ||
SourceProcessId != GetCurrentProcessId())
{
reactos/lib/kernel32/process
diff -u -r1.70 -r1.71
--- proc.c 19 Oct 2004 10:27:11 -0000 1.70
+++ proc.c 2 Nov 2004 21:51:25 -0000 1.71
@@ -1,4 +1,4 @@
-/* $Id: proc.c,v 1.70 2004/10/19 10:27:11 weiden Exp $
+/* $Id: proc.c,v 1.71 2004/11/02 21:51:25 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -26,10 +26,6 @@
VOID STDCALL
RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle);
-BOOL STDCALL
-InternalGetProcessId (HANDLE hProcess, LPDWORD lpProcessId);
-
-
/* FUNCTIONS ****************************************************************/
/*
@@ -301,44 +297,25 @@
/*
* @implemented
*/
-BOOL STDCALL
-InternalGetProcessId(HANDLE hProcess,
- LPDWORD lpProcessId)
+DWORD
+STDCALL
+GetProcessId(HANDLE Process)
{
PROCESS_BASIC_INFORMATION ProcessBasic;
NTSTATUS Status;
- Status = NtQueryInformationProcess(hProcess,
+ Status = NtQueryInformationProcess(Process,
ProcessBasicInformation,
&ProcessBasic,
sizeof(PROCESS_BASIC_INFORMATION),
NULL);
if (!NT_SUCCESS(Status))
- {
- SetLastErrorByStatus(Status);
- return(FALSE);
- }
-
- memcpy(lpProcessId, &ProcessBasic.UniqueProcessId, sizeof(DWORD));
-
- return(TRUE);
-}
-
-
-/*
- * @implemented
- */
-DWORD
-STDCALL
-GetProcessId(HANDLE Process)
-{
- DWORD ProcessId;
-
- if(!InternalGetProcessId(Process, &ProcessId))
{
+ SetLastErrorByStatus(Status);
return 0;
}
- return ProcessId;
+
+ return ProcessBasic.UniqueProcessId;
}
reactos/lib/kernel32/thread
diff -u -r1.55 -r1.56
--- thread.c 2 Nov 2004 20:42:06 -0000 1.55
+++ thread.c 2 Nov 2004 21:51:25 -0000 1.56
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.55 2004/11/02 20:42:06 weiden Exp $
+/* $Id: thread.c,v 1.56 2004/11/02 21:51:25 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -714,6 +714,54 @@
return dwIdealProcessor;
}
+
+/*
+ * @implemented
+ */
+DWORD STDCALL
+GetProcessIdOfThread(HANDLE Thread)
+{
+ THREAD_BASIC_INFORMATION ThreadBasic;
+ NTSTATUS Status;
+
+ Status = NtQueryInformationThread(Thread,
+ ThreadBasicInformation,
+ &ThreadBasic,
+ sizeof(THREAD_BASIC_INFORMATION),
+ NULL);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return 0;
+ }
+
+ return (DWORD)ThreadBasic.ClientId.UniqueProcess;
+}
+
+
+/*
+ * @implemented
+ */
+DWORD STDCALL
+GetThreadId(HANDLE Thread)
+{
+ THREAD_BASIC_INFORMATION ThreadBasic;
+ NTSTATUS Status;
+
+ Status = NtQueryInformationThread(Thread,
+ ThreadBasicInformation,
+ &ThreadBasic,
+ sizeof(THREAD_BASIC_INFORMATION),
+ NULL);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return 0;
+ }
+
+ return (DWORD)ThreadBasic.ClientId.UniqueThread;
+}
+
/*
* @unimplemented
*/
CVSspam 0.2.8