#include <windows.h> #include <stdio.h> typedef int (__cdecl *MYPROC)(LPWSTR); MYPROC Out32; MYPROC Inp32; HINSTANCE hinstLib; BOOL LoadIO32(void) { // Get a handle to the DLL module. hinstLib = LoadLibrary("inpout32.dll"); // If the handle is valid, try to get the function address. if (hinstLib != NULL) { Out32 = (MYPROC) GetProcAddress(hinstLib, "Out32"); Inp32 = (MYPROC) GetProcAddress(hinstLib, "Inp32"); return 1; } return 0; } void FreeIO32(void) { FreeLibrary(hinstLib); } void outport(int address, int value) { if(LoadIO32()) Out32(address, value); }