Page 1 of 1

Required permissions of process handle for InjectLibrary

Posted: Thu Jan 13, 2005 8:15 pm
by dcsoft
What are the required permissions of the process handle passed to InjectLibrary() and UninjectLibrary()?

So far I've been getting the process handle by calling OpenProcess(PROCESS_ALL_ACCESS) but wish to use only the permissions that are absolutely required, to improve the chances that OpenProcess() will succeed. Is SYNCRONIZE or PROCESS_QUERY_INFORMATION, for example, enough?

Thanks,
David

Posted: Fri Jan 14, 2005 8:42 am
by madshi
You need quite a lot of access rights, namely those:

PROCESS_CREATE_THREAD
PROCESS_DUP_HANDLE
PROCESS_QUERY_INFORMATION
PROCESS_VM_OPERATION
PROCESS_VM_READ
PROCESS_VM_WRITE

Seeing all those I think they're not more difficult to get than PROCESS_ALL_ACCESS...

Posted: Fri Jan 14, 2005 10:39 pm
by dcsoft
madshi wrote:You need quite a lot of access rights, namely those:

PROCESS_CREATE_THREAD
PROCESS_DUP_HANDLE
PROCESS_QUERY_INFORMATION
PROCESS_VM_OPERATION
PROCESS_VM_READ
PROCESS_VM_WRITE

Seeing all those I think they're not more difficult to get than PROCESS_ALL_ACCESS...
Thanks Madshi, I'll stick with PROCESS_ALL_ACCESS for now.

-- David