From 3eb8a4e2cc62f0b0e4197d907c63c5973dee5de4 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Fri, 20 Oct 2006 22:14:26 +0000 Subject: [PATCH] Call SetInterrupt() only for Display drivers, call DrvrRemove() (why not ?) --- second/driver.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/second/driver.c b/second/driver.c index ee54aa8..fddc3aa 100644 --- a/second/driver.c +++ b/second/driver.c @@ -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,14 +45,23 @@ 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; - pb.ioRefNum = refnum; - pb.csCode = 7; /* SetInterrupt */ - flag.flag = 1; - pb.csParam = &flag; - err = PBControlSync((ParmBlkPtr) &pb); + if (strncmp(name, ".Display", 8) == 0) + { + pb.ioRefNum = refnum; + pb.csCode = 7; /* SetInterrupt */ + flag.flag = 1; + pb.csParam = &flag; + + err = PBControlSync((ParmBlkPtr) &pb); + } + DrvrRemove(refnum); } }