[commit: Win32] master: Add getProcessId (a7e0a13)
Simon Marlow
marlowsd at gmail.com
Wed May 11 11:16:41 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Win32
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/a7e0a130cc9b2bad306dd51d4b6a86bf8a84497e
>---------------------------------------------------------------
commit a7e0a130cc9b2bad306dd51d4b6a86bf8a84497e
Author: Hamish Mackenzie <Hamish.K.Mackenzie at googlemail.com>
Date: Sun Apr 24 12:36:24 2011 +1200
Add getProcessId
>---------------------------------------------------------------
System/Win32/Process.hsc | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/System/Win32/Process.hsc b/System/Win32/Process.hsc
index 183ce39..f10e3e4 100644
--- a/System/Win32/Process.hsc
+++ b/System/Win32/Process.hsc
@@ -56,6 +56,12 @@ foreign import stdcall unsafe "windows.h OpenProcess"
openProcess :: ProcessAccessRights -> BOOL -> ProcessId -> IO ProcessHandle
openProcess r inh i = failIfNull "OpenProcess" $ c_OpenProcess r inh i
+foreign import stdcall unsafe "windows.h GetProcessId"
+ c_GetProcessId :: ProcessHandle -> IO ProcessId
+
+getProcessId :: ProcessHandle -> IO ProcessId
+getProcessId h = failIfZero "GetProcessId" $ c_GetProcessId h
+
type Th32SnapHandle = HANDLE
type Th32SnapFlags = DWORD
-- | ProcessId, number of threads, parent ProcessId, process base priority, path of executable file
More information about the Cvs-libraries
mailing list