#include #include typedef void (WINAPI *BOOT)(void); void __declspec(dllimport) doIt( void ); int main( int argc, char **argv ) { char line[1024]; HMODULE ext; BOOT boot; doIt(); if( !( ext = LoadLibrary( argv[1] ) ) ) { printf( "Failed to load library %s: error: %d\n", argv[1], GetLastError() ); exit( -1 ); } if( !( boot = (BOOT)GetProcAddress( ext, "boot" ) ) ) { printf( "Failed to get proc address for boot; error: %d\n", GetLastError() ); exit( -2 ); } boot(); gets( line ); return 0; }