All communication to the PortIO95 VxD is done through the Windows 95 DeviceIoControl() function call. If the DeviceIoControl call is not successful it will return a value of 0 (non zero is returned for success). After an unsuccessful call further information on the cause of the error can be obtained through a second call to the function GetLastError(). For Visual C++ Version 4.0 it could be issued as:
int retval; retval=DeviceIoControl(hDevice, PORTIO_PIN2HIGH, NULL, 0,\ NULL, 0, NULL, NULL); if (!retval) { printf("Call failed, error=%d\n", GetLastError() ); exit (1); }The value returned by GetLastError() will be a number. This number can be used to look up the error message in the table below:
100 ERR_DEBUG_NOTON debug mode was never on 101 ERR_NO_IFSMGR could not find IFSMgr 102 ERR_CLOSEFILE could not close file 103 ERR_OPENFILE could not open file 104 ERR_NOTINIT PortIO95 VxD not initialized 105 ERR_MEMMAP could not map low memory 106 ERR_NOOUTAREA no output structure provided 107 ERR_NOINAREA no input structure provided 108 ERR_PORTNOTFOUND lpt port not found on system 109 ERR_INVALIDPORT no such port exists 110 ERR_PORTNOTSET port not set 111 ERR_DREGISINPUT data reg is being used for inputs 112 ERR_UNKNOWNCODE unknown control code 113 ERR_CREGPINISINPUT ctl reg (or pins on it) is set as an input 114 ERR_CREGPINISOUTPUT ctl reg (or pins on it) is set as an output