loading a driver dynamically in windows98

Hai All,

I have a driver and an application which load driver dynamically using
StartService() function the application works fine in windows2000 and
fails in windows98 SE. MSDN says the StartService works only for windowsNT
or later.

Could anyone of you please tell me how to load a driver(.sys) file
dynamically in windows98 SE.

Any kind of information would be helpful.

Thanks in advance.

Regards,
Kedar.

kedar wrote:

Could anyone of you please tell me how to load a driver(.sys) file
dynamically in windows98 SE.

Any kind of information would be helpful.

You can’t do it from user mode at all. In the kernel, you could load the
driver by calling ZwLoadDriver, but ZwUnloadDriver is not implemented
and there’s no documented way to unload the driver.

If it were me, I’d write a VxD and use the vxdwdm library to let me call
NtKern entry points. One of the samples in my WDM book (PNPMON) shows
how to do this.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

In 9x you can dynamically load a driver (certain types, at least) by doing
this:

File is driver.vxd

CreateFile(“\\.\driver”, 0, 0, 0, 0, FILE_FLAG_DELETE_ON_CLOSE, 0);

It may be required that your driver have an IOCTL interface, as that’s the
only type of driver I’ve tested this method against.
The FILE_FLAG_DELETE_ON_CLOSE will cause the driver to be dynamically
unloaded after you call CloseHandle on the handle you’re returned from
CreateFile.

I also have only tried this with .VXD’s so I’m not sure this will work for
.sys files.

This URL on msdn have more information:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win9x/devio
_886c.asp

Hope that helps,
Matt Miller

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of kedar
Sent: Thursday, June 19, 2003 6:11 AM
To: NT Developers Interest List
Subject: [ntdev] loading a driver dynamically in windows98

Hai All,

I have a driver and an application which load driver dynamically using
StartService() function the application works fine in windows2000 and
fails in windows98 SE. MSDN says the StartService works only for windowsNT
or later.

Could anyone of you please tell me how to load a driver(.sys) file
dynamically in windows98 SE.

Any kind of information would be helpful.

Thanks in advance.

Regards,
Kedar.


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

Matt Miller wrote:

I also have only tried this with .VXD’s so I’m not sure this will work for
.sys files.

It won’t, and you really should have checked before posting this answer.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

Mr Oney,

It’s a good thing you suggested that he write a .VXD instead, and, as such,
my suggestion will be useful to him should he choose to go this route. I
did do some minimal searching before posting on whether the previously
supplied solution would work for .sys and came up empty handed, which seems
to make sense now that you say it wont work. For that reason I posted
saying that it may work, not that it would work.

It’s been my experiencing that when one is asking questions on this list,
any information on the topic, even if not directly applicable, is better
than no response at all.

Obviously, you don’t have to ask this list questions, but for those who
do…

Matt Miller

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Walter Oney
Sent: Thursday, June 19, 2003 11:11 AM
To: NT Developers Interest List
Subject: [ntdev] Re: loading a driver dynamically in windows98

Matt Miller wrote:

I also have only tried this with .VXD’s so I’m not sure this will work for
.sys files.

It won’t, and you really should have checked before posting this answer.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com


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