If the driver has been stopped ( using, say, "net stop inpout32") when the application using the inpout32.dll et al is ran the driver is successfully started but the input and output calls all fail because no handle was gotten for the driver.
Here's the perennate original code (of v1.0.0. in Opendriver.
Code: Select all
if(hdriver == INVALID_HANDLE_VALUE)
{
if(start(bX64 ? DRIVERNAMEx64 : DRIVERNAMEi386))
{
if (bX64)
inst64(); //Install the x64 driver
else
inst32(); //Install the i386 driver
start(bX64 ? DRIVERNAMEx64 : DRIVERNAMEi386);
hdriver = CreateFile(szFileName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if(hdriver != INVALID_HANDLE_VALUE)
{
OutputDebugString("Successfully opened ");
OutputDebugString(bX64 ? DRIVERNAMEx64 : DRIVERNAMEi386);
OutputDebugString(" driver");
return 0;
}
[b]}[/b]
return 1;
}
Code: Select all
if(hdriver == INVALID_HANDLE_VALUE)
{
if(start(bX64 ? DRIVERNAMEx64 : DRIVERNAMEi386))
{
if (bX64)
inst64(); //Install the x64 driver
else
inst32(); //Install the i386 driver
start(bX64 ? DRIVERNAMEx64 : DRIVERNAMEi386);
[b]}[/b]
hdriver = CreateFile(szFileName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if(hdriver != INVALID_HANDLE_VALUE)
{
OutputDebugString("Successfully opened ");
OutputDebugString(bX64 ? DRIVERNAMEx64 : DRIVERNAMEi386);
OutputDebugString(" driver");
return 0;
}
return 1;
}