I've just discovered that the Visual Studio can't even compile 64-bit DLL if it has an naked attribute; apparently the DLL I've produced was 32-bit DLL; now the settings are right, since I've checked the Linker command-line options include /MACHINE:X64. I'm getting the following errors while compiling:
Severity Code Description Project File Line Suppression State
Error C2065 'jmp': undeclared identifier dnsapi C:\Users\windbg\Desktop\dnsapi\dnsapi\dnsapi.cpp 551
Error C2485 'naked': unrecognized extended attribute dnsapi C:\Users\windbg\Desktop\dnsapi\dnsapi\dnsapi.cpp 250
The following link: https://msdn.microsoft.com/en-us/library/h5w10wxs.aspx
, says that naked attribute is not supported on X64:
For functions declared with the naked attribute, the compiler generates code without prolog and epilog code. You can use this feature to write your own prolog/epilog code sequences using inline assembler code. Naked functions are particularly useful in writing virtual device drivers. Note that the naked attribute is only valid on x86 and ARM, and is not available on x64.
What can I use to replace the naked attribute, I'm a little hesitant at actually providing and overwriting the parameters or every single dnsapi.dll functions, since that would be a lot of work and would also include the functions I'm not interested in; I'm only interested in the DNSQuery function for now (maybe later I'll add two or three more functions, but that's it).
Any ideas, how do you compile and use 64-bit proxy DLLs?