Question

I am trying to create a driver in Windows 7 32 bit.

I am writing the driver in C. In the driver code I am trying to get the process id of notepad.exe.

I don't know how to get the id of that process, if I use GetProcessesByName I get errors like PROCESS undeclared identifier.

Était-ce utile?

La solution

The CreateToolhelp32Snapshot and associated functions are what you need. Example code for using these functions can be found here. Note that the PROCESSENTRY32 struct contains the EXE file name, so you're looking for "notepad.exe". You probably should get the full path as described in the link and make sure it's in the \windows\system directory.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top