#include <stdio.h>
#include <windows.h>
#include <unistd.h>
#define PORT 0x378
#define PORTA 0x379
//typedef short _stdcall (*inpfuncPtr)(short portaddr);
//typedef void _stdcall (*oupfuncPtr)(short portaddr, short datum);
int porg(int);
typedef short _stdcall (*inpfuncPtr)(short portaddr);
typedef void _stdcall (*oupfuncPtr)(short portaddr, unsigned char datum);
//definition
inpfuncPtr inp32;
oupfuncPtr oup32;
int main()
{
HINSTANCE hLib;
//int data;
hLib = LoadLibrary("inpout32.dll");
if (hLib == NULL) {
printf("LoadLibrary Failed.\n");
return -1;
}
inp32 = (inpfuncPtr) GetProcAddress(hLib, "Inp32");
if (inp32 == NULL) {
printf("GetProcAddress for Inp32 Failed.\n");
return -1;
}
oup32 = (oupfuncPtr) GetProcAddress(hLib, "Out32");
if (oup32 == NULL) {
printf("GetProcAddress for Oup32 Failed.\n");
return -1;
}
while(1)
{
oup32(PORT,1);
sleep(1);
oup32(PORT,0);
sleep(1);
}
//system("pause");
FreeLibrary(hLib);
return 0; ;
}