Questions tagged [win32-process]
315 questions
21
votes
6 answers
CreateProcess such that child process is killed when parent is killed?
Is there a way to call CreateProcess such that killing the parent process automatically kills the child process?
Perhaps using Create Process Flags?
Edit
The solution is to create a job object, place both parent and child in the job object. Whent…

Suraj
- 35,905
- 47
- 139
- 250
13
votes
9 answers
Error: bcrypt_lib.node is not a valid Win32 application
I have a nodejs project on my windows machine. Where upon attempting to run the project this error appears involving bcrypt and win32.
[nodemon] 2.0.2
[nodemon] to restart at any time, enter rs
[nodemon] watching dir(s): .
[nodemon] watching…

Mayyar Al-Atari
- 199
- 1
- 1
- 9
12
votes
2 answers
Win32 Named mutex not released when process crashes
I have 2 processes (A, B) sharing the same mutex (using WaitForSingleObject / ReleaseMutex calls). Everything works fine, but when process A crashes, process B is humming along happily. When I restart process A, there's a deadlock.
Deeper…

Sergiy Migdalskiy
- 996
- 9
- 19
12
votes
3 answers
Win32, ReadFile from pipe block even after child terminated
I have a simple program (in C) that create two child process, wait on an inherited pipe each, and put the output in a file.
Everything works well, except that after some write/read cycle on the two pipe, when the child ends, the call to ReadFile…

ArtoAle
- 2,939
- 1
- 25
- 48
9
votes
1 answer
How to make the feature 'Replace Task Manager' of Process Explorer?
Process Explorer has a nice feature Replace Task Manager
I just wondered how Mark Russinovich implements this.
What trick is used for implementing this?

Benjamin
- 10,085
- 19
- 80
- 130
8
votes
1 answer
How do I change the priority of a process?
Can anyone provide a Delphi example of code that changes the priority class of a process?
I need to get the process by name from the Windows XP Task manager and change its priority using delphi code.

mortalis
- 2,060
- 24
- 34
8
votes
1 answer
Get the Cpu usage of each process from wmi
I found many sources to get the cpu usage of each process. in general there are many ways to get the cpu usage of process .
percentprocessortime from win32_perfformatteddata_perfproc_process
performancecounter class in system.diagnostics
by manual…

Gomathipriya
- 905
- 7
- 19
- 38
7
votes
2 answers
Kill process and sub-processes in Ruby on Windows
Currently I'm doing this in one command prompt
require 'win32/process'
p = Process.spawn("C:/ruby193/bin/bundle exec rails s")
puts p
Process.waitpid(p)
and then in another
require 'win32/process'
Process.kill(1,
) The problem is that the…

Ben
- 1,321
- 15
- 30
7
votes
2 answers
DEF file syntax error in visual studio 2012
I have a vs project which wouldn't compile once I upgraded to visual studio 2012.
Its a win32 dll project and it complains about the def file.
This is the def file,
LIBRARY test.dll
VERSION 3.1.4.1
EXPORTS
addNumbers @1
and this is the error I get…

S_R
- 493
- 1
- 9
- 22
6
votes
2 answers
Find all threads of a process given process id
I am trying to find if there is a better way to find all thread ids that belong to the current process. It looks like using CreateToolhelp32Snapshot with TH32CS_SNAPTHREAD and iterating over the threads to check if the thread's process id is equal…

Abhinay K Reddyreddy
- 471
- 3
- 16
6
votes
2 answers
timespec equivalent for windows
I am porting my application to windows from unix and I have run into a wall. In my application I need to find time in microseconds (the whole application heavily depends on it due to it being a high precision application).
Previously I was using…

Quillion
- 6,346
- 11
- 60
- 97
6
votes
2 answers
Lightweight method to use Amd64 instructions under 32-bit Windows?
For some CPU-bound code using 64-bit variables, it is beneficial to use the Amd64 instruction set rather than x86. How can it be done under 32-bit Windows (e.g. Windows XP SP3)? Of course I assume a modern, Amd64-enabled CPU. I'm excluding the…

fgrieu
- 2,724
- 1
- 23
- 53
6
votes
7 answers
Deny Access to Kiosk program process
I have a kiosk app and have to disable task manager always to prevent closing the program by users .
But some users need the TaskManager to close hanging programs.
Any help would be appropriated.
However, I am sure there is a function in…
user586399
5
votes
0 answers
Why is the WMI Win32_Process CommandLine property null for only some processes of other users?
I'm using this C# code to get the Command Line parameters of a running process:
public static void GetProcessesCommandLine(string processName)
{
string query = $@"SELECT CommandLine,ProcessId FROM Win32_Process WHERE Name = '{processName}'";
…

Master_T
- 7,232
- 11
- 72
- 144
5
votes
2 answers
Using WMI, how can I determine whether a remote process is 32-bit or 64-bit?
I have a collection of win32_process objects queried from a remote machine using WMI. How do I determine whether each process is 32-bit or 64-bit?

musaul
- 2,341
- 19
- 26