Utility Driver (No Device)

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

Walter Oney’s DevView program appears to do this. It loads a DevView.sys
driver when the program starts and unloads it when it exits.

Thanks for any help that can be provided.

Thomas McCormick
xxxxx@smartm.com

The toaster sample in the ddk does this. The pnp term for this is a
root enumerated driver. If you don’t need pnp, you can always create an
NT4 style legacy driver which creates its device objects in DriverEntry
and does its thing.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of McCormick, Tom
Sent: Wednesday, February 09, 2005 8:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Utility Driver (No Device)

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

Walter Oney’s DevView program appears to do this. It loads a DevView.sys
driver when the program starts and unloads it when it exits.

Thanks for any help that can be provided.

Thomas McCormick
xxxxx@smartm.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

McCormick, Tom wrote:

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

Walter Oney’s DevView program appears to do this. It loads a DevView.sys
driver when the program starts and unloads it when it exits.

Apologies for my last accidental reply.

You do this with a “legacy” driver that gets installed and started with
the service control manager APIs, the way all drivers were done in
Windows NT 4.0. There are lots of examples of this on the web. Look
for OpenSCManager.

You still have to use ioctls to communicate with it. It doesn’t
“export” services in the sense of the direct linking of a DLL.

Doran:

Thanks for the input. Driver mechanics are fully understood. I am unsure of
how to load such a driver. What technique/API is used?

(Sorry, I guess I wasn’t clear enough in my original query.)

Thomas McCormick
xxxxx@smartm.com

-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, February 09, 2005 12:27 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Utility Driver (No Device)

The toaster sample in the ddk does this. The pnp term for this is a
root enumerated driver. If you don’t need pnp, you can always create an
NT4 style legacy driver which creates its device objects in DriverEntry
and does its thing.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of McCormick, Tom
Sent: Wednesday, February 09, 2005 8:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Utility Driver (No Device)

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

Walter Oney’s DevView program appears to do this. It loads a DevView.sys
driver when the program starts and unloads it when it exits.

Thanks for any help that can be provided.

Thomas McCormick
xxxxx@smartm.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Use StartService() and ControlService() to start and stop a legacy driver.
You can also use “net start” and “net stop” from the command line or
download the OSRLoader utility:
http://www.osronline.com/article.cfm?article=157

Shahar

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of McCormick, Tom
Sent: Wednesday, February 09, 2005 8:10 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Utility Driver (No Device)

Doran:

Thanks for the input. Driver mechanics are fully understood. I am unsure of
how to load such a driver. What technique/API is used?

(Sorry, I guess I wasn’t clear enough in my original query.)

Thomas McCormick
xxxxx@smartm.com

-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, February 09, 2005 12:27 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Utility Driver (No Device)

The toaster sample in the ddk does this. The pnp term for this is a root
enumerated driver. If you don’t need pnp, you can always create an
NT4 style legacy driver which creates its device objects in DriverEntry and
does its thing.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of McCormick, Tom
Sent: Wednesday, February 09, 2005 8:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Utility Driver (No Device)

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

Walter Oney’s DevView program appears to do this. It loads a DevView.sys
driver when the program starts and unloads it when it exits.

Thanks for any help that can be provided.

Thomas McCormick
xxxxx@smartm.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@safend.com To unsubscribe
send a blank email to xxxxx@lists.osr.com

For an NT4 driver, look at the SCM APIs (service control manager). To
install a pnp driver, you need to use setupapi, I would suggest looking
at the DDK example devcon.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of McCormick, Tom
Sent: Wednesday, February 09, 2005 10:10 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Utility Driver (No Device)

Doran:

Thanks for the input. Driver mechanics are fully understood. I am unsure
of
how to load such a driver. What technique/API is used?

(Sorry, I guess I wasn’t clear enough in my original query.)

Thomas McCormick
xxxxx@smartm.com

-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, February 09, 2005 12:27 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Utility Driver (No Device)

The toaster sample in the ddk does this. The pnp term for this is a
root enumerated driver. If you don’t need pnp, you can always create an
NT4 style legacy driver which creates its device objects in DriverEntry
and does its thing.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of McCormick, Tom
Sent: Wednesday, February 09, 2005 8:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Utility Driver (No Device)

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

Walter Oney’s DevView program appears to do this. It loads a DevView.sys
driver when the program starts and unloads it when it exits.

Thanks for any help that can be provided.

Thomas McCormick
xxxxx@smartm.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

McCormick, Tom wrote:

All:

Has anyone come across any discussion about how to create a driver that
exports kernel mode services to a user mode EXE? (As opposed to a common
function driver that loads in response to a specific device.)

You mean a driver for a pseudo device, yes?

The way this is typically done is by creating a “legacy” (NT V4 style)
driver. The user-mode app then sends IOCTLs to the driver to request
information.

I don’t know about Wally’s utility, but for things like DeviceTree,
IRPTracker, and the like (see www.osronline.com), we actually embed the
driver in a binary resource in the executable. At run time, we create a
file from the binary resource, start the driver using the service
control manager, and then mark the file for delete (so that it’s
automagically deleted when the driver exits).

There’s no reason you’re restricted to doing this with a “legacy” NT V4
stye driver, of course. You COULD write a PnP software-only driver –
Just make it root enumerated. You’ll be automagically called at your
AddDevice entry point.

Peter
OSR