Merge pull request #4099 from cheatfate/asyncdispatch2
Proper definitions for functions СreateIoCompletionPort and GetQueuedCompletionStatus
This commit is contained in:
commit
f9d9cdd1ee
2 changed files with 6 additions and 4 deletions
|
|
@ -368,7 +368,7 @@ proc processTimers(p: PDispatcherBase) =
|
|||
when defined(windows) or defined(nimdoc):
|
||||
import winlean, sets, hashes
|
||||
type
|
||||
CompletionKey = Dword
|
||||
CompletionKey = ULONG_PTR
|
||||
|
||||
CompletionData* = object
|
||||
fd*: AsyncFD # TODO: Rename this.
|
||||
|
|
@ -431,7 +431,7 @@ when defined(windows) or defined(nimdoc):
|
|||
if timeout == -1: winlean.INFINITE
|
||||
else: timeout.int32
|
||||
var lpNumberOfBytesTransferred: Dword
|
||||
var lpCompletionKey: ULONG
|
||||
var lpCompletionKey: ULONG_PTR
|
||||
var customOverlapped: PCustomOverlapped
|
||||
let res = getQueuedCompletionStatus(p.ioPort,
|
||||
addr lpNumberOfBytesTransferred, addr lpCompletionKey,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ type
|
|||
DWORD* = int32
|
||||
PDWORD* = ptr DWORD
|
||||
LPINT* = ptr int32
|
||||
ULONG_PTR* = uint
|
||||
PULONG_PTR* = ptr uint
|
||||
HDC* = Handle
|
||||
HGLRC* = Handle
|
||||
|
||||
|
|
@ -759,12 +761,12 @@ const
|
|||
ERROR_NETNAME_DELETED* = 64
|
||||
|
||||
proc createIoCompletionPort*(FileHandle: Handle, ExistingCompletionPort: Handle,
|
||||
CompletionKey: DWORD,
|
||||
CompletionKey: ULONG_PTR,
|
||||
NumberOfConcurrentThreads: DWORD): Handle{.stdcall,
|
||||
dynlib: "kernel32", importc: "CreateIoCompletionPort".}
|
||||
|
||||
proc getQueuedCompletionStatus*(CompletionPort: Handle,
|
||||
lpNumberOfBytesTransferred: PDWORD, lpCompletionKey: PULONG,
|
||||
lpNumberOfBytesTransferred: PDWORD, lpCompletionKey: PULONG_PTR,
|
||||
lpOverlapped: ptr POVERLAPPED,
|
||||
dwMilliseconds: DWORD): WINBOOL{.stdcall,
|
||||
dynlib: "kernel32", importc: "GetQueuedCompletionStatus".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue