In convension of win32 API, PHANDLE means "A pointer to a HANDLE"[1]. However in System/Win32/DebugApi.hsc PHANDLE was wrongly used to represent "process handle". Maybe some more precise tokens such as ProcHANDLE and ThreadHandle can be used to distinguish process handle, thread handle and ordinay handles.
I think the type synonym PHANDLE should be defined as type PHANDLE = Ptr HANDLE in System/Win32/Types.hs and should be available after we import the module System.Win32.Types and then it can be used directly with some win32 functions like CreatePipe.
1: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
In convension of win32 API,
PHANDLEmeans "A pointer to a HANDLE"[1]. However in System/Win32/DebugApi.hscPHANDLEwas wrongly used to represent "process handle". Maybe some more precise tokens such asProcHANDLEandThreadHandlecan be used to distinguish process handle, thread handle and ordinay handles.I think the type synonym
PHANDLEshould be defined astype PHANDLE = Ptr HANDLEin System/Win32/Types.hs and should be available after we import the moduleSystem.Win32.Typesand then it can be used directly with some win32 functions likeCreatePipe.1: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx