简体   繁体   中英

CreateRemoteThread returns ERROR_ACCESS_DENIED (5) on win7 64 bit

How can i fix this problem? the code works fine as I tested it on a 32 bit computer but my 64 bit computer returns that error with getlasterror();

what can i do to fix this?

Partial info:

When I was working with CreateRemoteThread on Win2000, everything was working fine except for the cases when I was starting remote threads in the processes that belonged to different terminal server sessions. On Win2003 (and on) all system processes work in TS session 0 that is different from the interactive session that you are currently logged in. At that time I has not managed to solve the TS session boundary problem. This is what you might need to check first.

It is more likely that this is not a 32/64 bit problem but some sort of security problem that requires special privileges and/or permissions.

I'm going to guess that your target process is a Managed executable, compiled for "Any CPU"...

If so, when you launch that exe on 64-bit Windows, it will JIT compile to 64-bit code, and thus become a 64-bit process.

You can then not call CreateRemoteThread on it, from a 32-bit process.

The same Managed exe launched on 32-bit Windows would JIT to 32-bit code, and therefore would work.

If that's the case, and you are the author of the Managed exe in question, rebuild it for x86.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM