I have a 1394 NT4 middle-level driver laying on the top of the 1394 core
(basically, OHCI) driver. In DriverEntry, there is a call to the core
driver providing the core driver with the callbacks need to be called when a
device is added to / removed from the bus. This call to the core driver is
done from the routine running as a system thread. I am curious why it is
done via a system thread? Is it wrong to make this call directly from
DriverEntry?
The following is quoted code:
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
…
// Start a thread that will init callbacks
status = PsCreateSystemThread (
&ThreadHandle,
THREAD_ALL_ACCESS,
NULL,
NULL,
NULL,
MF1394DriverL2InitCallbacks,
pDevExt);
…
}
void MF1394DriverL2InitCallbacks (PVOID Context)
{
…
IoSetCompletionRoutine(
pIrp,
MF1394SynchCompletionRoutine,
&Event,
TRUE,
TRUE,
TRUE
);
// Call the core driver
ntStatus = IoCallDriver(pDevExt->StackDeviceObject, pIrp);
if(ntStatus == STATUS_PENDING) {
ntStatus = KeWaitForSingleObject(&Event,
Executive,
KernelMode,
FALSE,
NULL );
}
…
}
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com