while developing a custom windows GINA.DLL for a project it happen that is need to build it with for both platforms 32bit and 64bit after develop and testing for 32bit and code works great i tried to build it for 64bit platforms and it generated the following error :
Error 7 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 3 Gina
Error 8 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 3 Gina
Error 9 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 3 Gina
Error 10 error C2146: syntax error : missing ';' before identifier 'RealWlxActivateUserShell' d:\projects\prostick\prostick\gina\Trampulim.cpp 3 Gina
Error 11 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 3 Gina
Error 12 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 4 Gina
Error 13 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 4 Gina
Error 14 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 4 Gina
Error 15 error C2146: syntax error : missing ';' before identifier 'RealWlxDisplayLockedNotice' d:\projects\prostick\prostick\gina\Trampulim.cpp 4 Gina
Error 16 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 4 Gina
Error 17 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 5 Gina
Error 18 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 5 Gina
Error 19 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 5 Gina
Error 20 error C2146: syntax error : missing ';' before identifier 'RealWlxDisplaySASNotice' d:\projects\prostick\prostick\gina\Trampulim.cpp 5 Gina
Error 21 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 5 Gina
Error 22 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 6 Gina
Error 23 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 6 Gina
Error 24 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 6 Gina
Error 25 error C2146: syntax error : missing ';' before identifier 'RealWlxGetConsoleSwitchCredentials' d:\projects\prostick\prostick\gina\Trampulim.cpp 6 Gina
Error 26 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 6 Gina
Error 27 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 7 Gina
Error 28 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 7 Gina
Error 29 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 7 Gina
Error 30 error C2146: syntax error : missing ';' before identifier 'RealWlxGetStatusMessage' d:\projects\prostick\prostick\gina\Trampulim.cpp 7 Gina
Error 31 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 7 Gina
Error 32 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 8 Gina
Error 33 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 8 Gina
Error 34 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 8 Gina
Error 35 error C2146: syntax error : missing ';' before identifier 'RealWlxIsLockOk' d:\projects\prostick\prostick\gina\Trampulim.cpp 8 Gina
Error 36 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 8 Gina
Error 37 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 9 Gina
Error 38 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 9 Gina
Error 39 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 9 Gina
Error 40 error C2146: syntax error : missing ';' before identifier 'RealWlxIsLogoffOk' d:\projects\prostick\prostick\gina\Trampulim.cpp 9 Gina
Error 41 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 9 Gina
Error 42 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 10 Gina
Error 43 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 10 Gina
Error 44 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 10 Gina
Error 45 error C2146: syntax error : missing ';' before identifier 'RealWlxLoggedOnSAS' d:\projects\prostick\prostick\gina\Trampulim.cpp 10 Gina
Error 46 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 10 Gina
Error 47 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 11 Gina
Error 48 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 11 Gina
Error 49 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 11 Gina
Error 50 error C2146: syntax error : missing ';' before identifier 'RealWlxLoggedOutSAS' d:\projects\prostick\prostick\gina\Trampulim.cpp 11 Gina
Error 51 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 11 Gina
Error 52 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 12 Gina
Error 53 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 12 Gina
Error 54 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 12 Gina
Error 55 error C2146: syntax error : missing ';' before identifier 'RealWlxLogoff' d:\projects\prostick\prostick\gina\Trampulim.cpp 12 Gina
Error 56 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 12 Gina
Error 57 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 13 Gina
Error 58 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 13 Gina
Error 59 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 13 Gina
Error 60 error C2146: syntax error : missing ';' before identifier 'RealWlxNetworkProviderLoad' d:\projects\prostick\prostick\gina\Trampulim.cpp 13 Gina
Error 61 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 13 Gina
Error 62 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 14 Gina
Error 63 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 14 Gina
Error 64 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 14 Gina
Error 65 error C2146: syntax error : missing ';' before identifier 'RealWlxRemoveStatusMessage' d:\projects\prostick\prostick\gina\Trampulim.cpp 14 Gina
Error 66 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 14 Gina
Error 67 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 15 Gina
Error 68 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 15 Gina
Error 69 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 15 Gina
Error 70 error C2146: syntax error : missing ';' before identifier 'RealWlxScreenSaverNotify' d:\projects\prostick\prostick\gina\Trampulim.cpp 15 Gina
Error 71 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 15 Gina
Error 72 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 16 Gina
Error 73 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 16 Gina
Error 74 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 16 Gina
Error 75 error C2146: syntax error : missing ';' before identifier 'RealWlxShutdown' d:\projects\prostick\prostick\gina\Trampulim.cpp 16 Gina
Error 76 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 16 Gina
Error 77 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 17 Gina
Error 78 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 17 Gina
Error 79 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 17 Gina
Error 80 error C2146: syntax error : missing ';' before identifier 'RealWlxStartApplication' d:\projects\prostick\prostick\gina\Trampulim.cpp 17 Gina
Error 81 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 17 Gina
Error 82 error C2485: 'naked' : unrecognized extended attribute d:\projects\prostick\prostick\gina\Trampulim.cpp 18 Gina
Error 83 error C4235: nonstandard extension used : '_asm' keyword not supported on this architecture d:\projects\prostick\prostick\gina\Trampulim.cpp 18 Gina
Error 84 error C2065: 'jmp' : undeclared identifier d:\projects\prostick\prostick\gina\Trampulim.cpp 18 Gina
Error 85 error C2146: syntax error : missing ';' before identifier 'RealWlxWkstaLockedSAS' d:\projects\prostick\prostick\gina\Trampulim.cpp 18 Gina
Error 86 error C2143: syntax error : missing ';' before '}' d:\projects\prostick\prostick\gina\Trampulim.cpp 18 Gina
i think the problem is in this code in two places "naked" and the inline assembly jump statement :
#define IMPLEMENT_TRAMPULIM_PROC(ProcName) \
void* Real##ProcName = 0; \
extern "C" int __declspec(naked) ProcName(void) \
{ \
_asm jmp Real##ProcName \
} \
i posted the 2 files that contain this code in here : https://gist.github.com/emad-elsaid/cca68983951c82eb8e60
i use visual studio 2008 professional edition
please note that i didn't write most of this code i copied it from a website that i don't remember unfortunately. and as i don't have a large experience with windows programming with C++ i couldn't trace the error further.
The 64-bit version of MS Visual Studio compiler doesn't support inline assembler.
Without understanding WHY you are trampolining, it's hard to say what you should do instead (if anything).