CreateMutex fails with ERROR_BAD_PATHNAME

CreateMutex fails with ERROR_BAD_PATHNAME

Post by e3 » Wed, 30 Mar 2005 18:46:46


Hi,
I have a simple program that just calls CreateMutex at startup. The problem
arises when I try to inject its code into another process (created with
CreateProcess using the flag CREATE_SUSPENDED).
In the injected process CreateMutex fails with ERROR_BAD_PATHNAME (161L), so
I'm wondering why it doesn't fail when the code is not injected.
Any idea?
Thanks
 
 
 

CreateMutex fails with ERROR_BAD_PATHNAME

Post by qfel » Wed, 30 Mar 2005 19:40:41

There's some initialization code that is executed in first thread prior to
calling app-defined entry-point, and your injected code is executed before
it. Maybe try hooking app-defined entry-point so you can execute after
system has initialized its components.