parent
0f344a70c9
commit
76f7e95814
1 changed files with 2 additions and 1 deletions
|
|
@ -1000,10 +1000,11 @@ when defined(windows) or defined(nimdoc):
|
||||||
proc addProcess*(pid: int, cb: Callback) =
|
proc addProcess*(pid: int, cb: Callback) =
|
||||||
## Registers callback ``cb`` to be called when process with process ID
|
## Registers callback ``cb`` to be called when process with process ID
|
||||||
## ``pid`` exited.
|
## ``pid`` exited.
|
||||||
|
const NULL = Handle(0)
|
||||||
let p = getGlobalDispatcher()
|
let p = getGlobalDispatcher()
|
||||||
let procFlags = SYNCHRONIZE
|
let procFlags = SYNCHRONIZE
|
||||||
var hProcess = openProcess(procFlags, 0, pid.DWORD)
|
var hProcess = openProcess(procFlags, 0, pid.DWORD)
|
||||||
if hProcess == INVALID_HANDLE_VALUE:
|
if hProcess == NULL:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
|
|
||||||
var pcd = cast[PostCallbackDataPtr](allocShared0(sizeof(PostCallbackData)))
|
var pcd = cast[PostCallbackDataPtr](allocShared0(sizeof(PostCallbackData)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue