How can i get the process identifier of any dll? I want to use this value for the OpenProcess API function
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance flag
DWORD dwProcessId // process identifier <---- Here is the problem!
);
I want to modify my dll by using the VirtualProtectEx function.
Regards,
Vortex
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance flag
DWORD dwProcessId // process identifier <---- Here is the problem!
);
I want to modify my dll by using the VirtualProtectEx function.
Regards,
Vortex
What are you trying to do? The only way I know to get the processID
is by using these api calls: CreateToolhelp32Snapshot, Process32First,
and Process32Next. (If you dont create it yourself that is...)
And the only time I have used those, was when I created a 'terminate process'
routine. The code below will enumerate all processe's running in the system.
Hope it can shed some light on your question.
TIP: lookup the following api calls: Module32First,Module32Next
Posted on 2002-11-11 06:08:39 by natas
is by using these api calls: CreateToolhelp32Snapshot, Process32First,
and Process32Next. (If you dont create it yourself that is...)
And the only time I have used those, was when I created a 'terminate process'
routine. The code below will enumerate all processe's running in the system.
Hope it can shed some light on your question.
TIP: lookup the following api calls: Module32First,Module32Next
Posted on 2002-11-11 06:08:39 by natas
How do you identify the dll? by HINSTANCE, probably? But HINSTANCE is process insensitive then. By process insensitive, I mean the HINSTANCE alone doesn't contain any information of the owner process, it's just a memory address.
Process identifiers are for processes, not DLLs. HINSTANCE are to identify DLLs, and they will always be specific to process address space they are loaded in.
Sorry frieds,It was just a misconception... The handle returned by the function GetCurrentProcessId is solving my problem.
Thanks for the replies,
Vortex
Thanks for the replies,
Vortex