Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Solved (Was: [Slightly OT] Can't load my WDM driver under 98.)

OSR_Community_UserOSR_Community_User Member Posts: 110,217
From: "Matt A." <[email protected]>
Sent: Tuesday, April 25, 2000 9:43 PM


> I have a WDM driver that loads and works fine under Windows 2000. Under
> Windows 98, however, I get an error 192 from the Add Hardware Wizard
during
> Plug and Play installation which, intepreted as a Win32 error code, means
> ERROR_EXE_MARKED_INVALID.

[snip]

Well, it turns out error 192 displayed by the Wizard is not
ERROR_EXE_MARKED_INVALID -- it not a Win32 error at all. Neither does it
appear to be a Configuration Manager or Device Installer error. I don't
know what kind of error code it is, but apparently it means the Windows
cannot locate a file specified in the .inf. How as a developer you're
supposed to know this, I can't figure out.

In anycase, I tracked the 192 problem down to having a [SourceDisksNames]
section that looked like this:

[SourceDisksNames]
1=%DISK_NAME%,DISK1

When I changed it to the following, error 192 went away and Windows starting
loading my driver.

[SourceDisksNames]
1=%DISK_NAME%,,,

[snip]

> That is, I have created a registry key
> "HKLM\System\CurrentControlSet\Services\MyDriver" containing an
"ImagePath"
> string value (all modelled after some existing entries I found there) and
am
> passing the string "MyDriver" to NtKernLoadDriver() as a UNICODE_STRING.
My
> driver file is at the location specified by "ImagePath" (the same place,
in
> fact, that PELDR_LoadModule() is able to load it from). Am I missing
> something else?

I finally got NtKernLoadDriver() to work too -- verifying that my driver was
indeed a valid WDM driver as far as Win98 is concerned. I had been somewhat
misled by documentation which described the parameter to NtKernLoadDriver()
as being the "name of the driver's service key under
\HKLM\System\CurrentControlSet\Services". The problem was that I was
specifying only the "leaf" name of my service key (that is, literally just
"MyDriver") and not the whole branch. If the docs had said "*path* of the
driver's service key" I probably wouldn't have wasted any time on this.

Of course, you're also supposed to pass an NT Object Manager-style path like
"\Registry\Machine\System\CurrentControlSet\Services\MyDriver", not
"\HKLM\System\CurrentControlSet\Services" like the docs suggest. Thanks to
NuMega for an example of this at their Web site
(http://www.numega.com/drivercentral/tech_tips/ntloaddriver.shtml).

- Matt
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 January 2023 Live, Online
Developing Minifilters 20 March 2023 Live, Online
Internals & Software Drivers 17 April 2023 Live, Online
Writing WDF Drivers 22 May 2023 Live, Online