haskell / haskell/win32

Incorrect usage of PHANDLE type.

Open
#61 4 comments 0 reactions 0 assignees View on GitHub
help wanted minor issue
Dominant language
Haskell
Stars
101
Forks
65
PR merge metrics
No merged PRs in 30d

Description

In convension of win32 API, `PHANDLE` means "A pointer to a HANDLE"[1]. However in [System/Win32/DebugApi.hsc](https://github.com/haskell/win32/blob/master/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](https://github.com/haskell/win32/blob/master/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`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365152(v=vs.85).aspx).

1: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.