Hi,

System.ProcessID return the current process handle instead of the process ID. Similar issue for System.ThreadID. Attached patch fixes this.

Regards,
Vincent Snijders.
Index: fpc-1.9/rtl/win32/system.pp
===================================================================
RCS file: /FPC/CVS/fpc/rtl/win32/system.pp,v
retrieving revision 1.63
diff -u -r1.63 system.pp
--- fpc-1.9/rtl/win32/system.pp 4 Nov 2004 09:32:31 -0000       1.63
+++ fpc-1.9/rtl/win32/system.pp 19 Nov 2004 10:06:55 -0000
@@ -692,8 +692,11 @@
    function GetCommandLine : pchar;
      stdcall;external 'kernel32' name 'GetCommandLineA';
 
-   function GetCurrentThread : dword;
-     stdcall; external 'kernel32' name 'GetCurrentThread';
+   function GetCurrentProcessId:DWORD;
+     stdcall; external 'kernel32' name 'GetCurrentProcessId';
+   
+   function GetCurrentThreadId:DWORD;
+     stdcall; external 'kernel32' name 'GetCurrentThreadId';
 
 
 var
@@ -1597,8 +1600,8 @@
   setup_arguments;
   { Reset IO Error }
   InOutRes:=0;
-  ProcessID := GetCurrentProcess;
-  ThreadID := GetCurrentThread;
+  ProcessID := GetCurrentProcessId;
+  ThreadID := GetCurrentThreadId;
   { Reset internal error variable }
   errno:=0;
 {$ifdef HASVARIANT}
_______________________________________________
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to