Process.ID off by 1 ?
Posted: Sun Jan 11, 2015 9:15 am
Dear madshi,
I have been seeing some rather strange behavior in madKernel.
I'm basically launching a process and then monitors the process to see when it exists, but I seem to experience that suddenly the PID reported by madKernel are off by 1.
I set up some status logging to try and capture exactly when it happens and to try and see if it somehow was something I did..
11-01-2015 10:04:16: pid 3179
11-01-2015 10:04:15: pid 3179
11-01-2015 10:04:14: pid 3179
11-01-2015 10:04:13: pid 3179
11-01-2015 10:04:12: pid 3179
11-01-2015 10:04:09: pid 3179
11-01-2015 10:04:08: Launched [C:\Program Files\Google\Chrome\Application\chrome.exe -- ""] with ID 3180
There exist no process on the system with ID 3179.
I could of course just add one to the ID reported by madKernel, but..
[Edit]
Forgot to mention that if I call GetProcessID(LaunchedProcess.Handle.Handle) I get 3180, which is the correct ID, so there may be something odd in the returned structure from the NtQueryInformationProcess() call in madKernel.
CurrentProcess.ID appears to return the correct Process ID though.
I have been seeing some rather strange behavior in madKernel.
I'm basically launching a process and then monitors the process to see when it exists, but I seem to experience that suddenly the PID reported by madKernel are off by 1.
I set up some status logging to try and capture exactly when it happens and to try and see if it somehow was something I did..
11-01-2015 10:04:16: pid 3179
11-01-2015 10:04:15: pid 3179
11-01-2015 10:04:14: pid 3179
11-01-2015 10:04:13: pid 3179
11-01-2015 10:04:12: pid 3179
11-01-2015 10:04:09: pid 3179
11-01-2015 10:04:08: Launched [C:\Program Files\Google\Chrome\Application\chrome.exe -- ""] with ID 3180
There exist no process on the system with ID 3179.
I could of course just add one to the ID reported by madKernel, but..
[Edit]
Forgot to mention that if I call GetProcessID(LaunchedProcess.Handle.Handle) I get 3180, which is the correct ID, so there may be something odd in the returned structure from the NtQueryInformationProcess() call in madKernel.
CurrentProcess.ID appears to return the correct Process ID though.