diff options
author | slangmgh <37659406+slangmgh@users.noreply.github.com> | 2020-05-12 01:17:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 19:17:37 +0200 |
commit | 76f7e958141eabc6dc317189fa12c123584e1b6e (patch) | |
tree | e3a51135163e98d2137296e32d8a8f7a08f596ff /lib | |
parent | 0f344a70c992594c7d6b794a6c2dd6c4b5b14685 (diff) | |
download | Nim-76f7e958141eabc6dc317189fa12c123584e1b6e.tar.gz |
Fix #14289 (#14304) [backport]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/asyncdispatch.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index 1421db2e8..91778a5bc 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -1000,10 +1000,11 @@ when defined(windows) or defined(nimdoc): proc addProcess*(pid: int, cb: Callback) = ## Registers callback ``cb`` to be called when process with process ID ## ``pid`` exited. + const NULL = Handle(0) let p = getGlobalDispatcher() let procFlags = SYNCHRONIZE var hProcess = openProcess(procFlags, 0, pid.DWORD) - if hProcess == INVALID_HANDLE_VALUE: + if hProcess == NULL: raiseOSError(osLastError()) var pcd = cast[PostCallbackDataPtr](allocShared0(sizeof(PostCallbackData))) |