IoAcquireRemoveLock in 98

OK -

So I am now trying to make my driver work on Windows 98. As I was
developing the driver, I had to be sure to be Windows 98 Compatible, so
I made it a point to use the 98 DDk Docs on all routines I used. One
would think this would work *BUT*

The 98 DDK as a man page entry for IoAcquireRemoveLock(), but it does
not appear to be supported by the 98 DDK !

Am I confused, or does the 98 DDK document something that is not part of
the 98 DDK.

Thanks

-Chris

A function replacement for the code to allow a similar function to run on
Windows 98 is located in Walter Oneys Developing WDM Drivers book, just
refer to the book, I would have copied it into the message, but my book is
at home.

-john-

-----Original Message-----
From: Christopher Pane [mailto:xxxxx@vanteon.com]
Sent: Wednesday, May 24, 2000 10:09 AM
To: NT Developers Interest List
Subject: [ntdev] IoAcquireRemoveLock in 98

OK -

So I am now trying to make my driver work on Windows 98. As I was
developing the driver, I had to be sure to be Windows 98
Compatible, so
I made it a point to use the 98 DDk Docs on all routines I used. One
would think this would work *BUT*

The 98 DDK as a man page entry for IoAcquireRemoveLock(), but it does
not appear to be supported by the 98 DDK !

Am I confused, or does the 98 DDK document something that is
not part of
the 98 DDK.

Thanks

-Chris

From: “Christopher Pane”
Sent: Wednesday, May 24, 2000 11:08 AM

> OK -
>
> So I am now trying to make my driver work on Windows 98. As I was
> developing the driver, I had to be sure to be Windows 98 Compatible, so
> I made it a point to use the 98 DDk Docs on all routines I used. One
> would think this would work BUT
>
> The 98 DDK as a man page entry for IoAcquireRemoveLock(), but it does
> not appear to be supported by the 98 DDK !

Yes, that’s right.

> Am I confused, or does the 98 DDK document something that is not part of
> the 98 DDK.

The Windows 98 DDK is misleading. The “remove lock” functions are not
implemented in Windows 98. They aren’t even exported, so if you write a
driver that calls them it will not load under 98.

However, you can quite easily implement your own replacement functions. You
can even do so such that your driver is source-compatible with the real
functions. You’ll find that many DDK samples don’t use the remove lock
functions and instead implement their own locking, usually referring to an
“I/O count”, etc… This repetition of code obviously lead to the addition
of the remove lock functions as part of the OS.

A more advanced solution to the 98/2000 compatiblity problem is to use
Walter Oney’s “WDMSTUB” technique, which keeps your driver binary-compatible
with Windows 2000 by dynamically adding the remove lock functions to the
export tables used to load WDM drivers under 98. This allows a driver that
calls the remove lock functions to load (and work) under 98.

The WDMSTUB technique is covered in Walter’s book, “Programming the
Microsoft Windows Driver Model” from Microsoft Press. Note that
availability of an improved stub technique is mentioned on the book’s Web
page, http://www.oneysoft.com/wdmerr.htm (see the entry titled “Avoiding a
reboot when using WDMSTUB.VXD”).

- Matt