void main(void) {
func1();
}
call func1
call 0x4000000 ; The address of 'func1'.
0x40000000: jmp DWORD PTR __imp_func1
__declspec(dllimport) void func1(void);
void main(void) {
func1();
}
call DWORD PTR __imp_func1
// project.h
#ifdef _DLL // If accessing the data from inside the DLL
ULONG ulDataInDll;
else // If accessing the data from outside the DLL
ULONG *ulDataInDll;
#endif
// project.def
LIBRARY project
EXPORTS
ulDataInDll CONSTANT
if (*ulDataInDll == 0L) {
// Do stuff here
}
__declspec(dllexport) ULONG ulDataInDLL;
// project.def
LIBRARY project
EXPORTS
ulDataInDll DATA
Keyword Emits in the import lib Exports CONSTANT __imp_ulDataInDll ulDataInDll __ulDataInDll DATA __imp_ulDataInDll ulDataInDll
__declspec(dllimport) ULONG ulDataInDll; /*prototype*/
if (ulDataInDll == 0L) /*sample code fragment*/
ULONG *ulDataInDll; /*prototype*/
if (*ulDataInDll == 0L) /*sample code fragment*/
__declspec(dllimport) ULONG ulDataInDll;
if (ulDataInDll == 0L) /*sample code fragment*/