I've tried to run the following code on my PC. With PORT 0x378 (LPT1 data) it works fine. But with PORT 0x379 (LPT1 status) it always returns 126 no matter what I output in the previous line. 0x37A works too. I have Windows XP
#define PORT 0x379
#define DATA 255
int main(int argc, char *argv[])
{
Input input;
Output output;
HINSTANCE hInstLib = LoadLibrary(TEXT("inpout32.dll"));
if (!hInstLib)
{
printf("No dll.\n");
system("PAUSE");
return 1;
}
input = (Input)GetProcAddress(hInstLib, "Inp32");
output = (Output)GetProcAddress(hInstLib, "Out32");
if (!input || !output)
{
printf("No funcion.\n");
FreeLibrary(hInstLib);
system("PAUSE");
return 1;
}
output(PORT, DATA);
printf("status: %i\n", input(PORT));
FreeLibrary(hInstLib);
system("PAUSE");
return EXIT_SUCCESS;
}