Hi Ed,
Thanks a lot for the info. It really worked !! But you have mentioned below that the ZwLoadDriver() causes the loader to call the second driver’s DriverEntry(). In our case, the driver got loaded but the DriverEntry() did not get executed.
Any idea why this might be happening ?? By the way, this is on a Windows 2000 system.
Thanks,
Ravi
----- Original Message -----
From: elau
To: NT Developers Interest List
Sent: Thursday, December 21, 2000 9:38 AM
Subject: [ntdev] Re: How to load a Driver
Another option is to use the (undocumented) call ZwLoadDriver(…) to load the driver and then use IoGetDeviceObjectPointer(…) to get a pointer to the second driver’s device object. This pointer can be used in calls to IoCallDriver(…) if you need that functionality. The call to ZwLoadDriver(…) will cause the loader to call the second driver’s DriverEntry(…) function. The prototype for ZwLoadDriver() is:
NTSYSAPI NTSTATUS NTAPI ZwLoadDriver(IN PUNICODE_STRING RegistryPath);
where RegistryPath is in the form:
\Registry\Machine\System\CurrentControlSet\Services\MyDriver
The registry key for your driver must exist. Also, the call must be made while your first driver is at PASSIVE_LEVEL (such as during DriverEntry()). Of course, this is an undocumented function, so use it at your own risk.
Ed Lau
MidCore Software, Inc.
900 Straits Tpke
Middlebury, CT 06762
www.midcore.com
----- Original Message -----
From: jags
To: NT Developers Interest List
Sent: Wednesday, December 20, 2000 4:40 PM
Subject: [ntdev] How to load a Driver
Hi,
I have a situation where I need to load a driver(Driver1) from the Initialization thread OR DriverEntry() function of another driver (Driver2). Are there any specific calls to do that ??
Thanks,
Ravi
You are currently subscribed to ntdev as: xxxxx@midcore.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@atlanta.nsc.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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