I have tested this code and see that not worked when i tried inject a x64 (C++) dll into a x64 process, after CreateRemoteThread, GetLastError is <
CreateRemoteThread
GetLastError