Call SetInterrupt() only for Display drivers, call DrvrRemove() (why not ?)

This commit is contained in:
Laurent Vivier 2006-10-20 22:14:26 +00:00
parent 4d96dcd5a7
commit 3eb8a4e2cc

View File

@ -25,6 +25,8 @@ void turn_off_interrupts()
volatile OSErr err; /* because -O2 remove call to PBControlSync() otherwise... */
VDParamBlock pb;
VDFlagRec flag;
char name[256];
int j;
count = LMGetUnitTableEntryCount();
currentHandle = (DCtlEntry ***) LMGetUTableBase();
@ -43,9 +45,16 @@ void turn_off_interrupts()
else
driverPtr = (void*)(currentPtr->dCtlDriver);
for(j = 0; j < driverPtr->drvrName[0]; j++)
name[j] = driverPtr->drvrName[j + 1];
name[j] = 0;
err = OpenDriver(driverPtr->drvrName, &refnum);
if (err != noErr)
continue;
if (strncmp(name, ".Display", 8) == 0)
{
pb.ioRefNum = refnum;
pb.csCode = 7; /* SetInterrupt */
flag.flag = 1;
@ -53,4 +62,6 @@ void turn_off_interrupts()
err = PBControlSync((ParmBlkPtr) &pb);
}
DrvrRemove(refnum);
}
}