The driver I plan to write really doesn’t have any underlying hardware beneath, so I am not planning to import any power or Pnp functions. The only things there I need is memory manipulation functionality to compress and or encrypt user data. And since there are no hardware resources the driver will hold (I mean ports, ints, etc…) The Pnp OS should still be able to do all the Pnp interesting stuff like suspend, hibernation, etc…
-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, February 03, 2003 6:49 PM
To: NT Developers Interest List
Subject: [ntdev] Re: OS detection
Well my first suggestion is : Read what christiaan said carefully.
The system won’t load your driver on NT4 if it can’t find all of the
routines you import from the kernel. So if you need function X then
your driver won’t load, even if you were smart enough to put:
If(isXAvailable == TRUE) {
X();
Into your code. The fact that your code might call X means the loader
has to resolve the import and if it can’t be resolved you won’t load.
If you were to do
#if isXAvailable
X();
#endif
That would be a different story. But you’ve implied you want a single
binary.
That said - you could write a driver which only used NT4 routines and
probably still get some PNP support. However you wouldn’t have power
management (since you’d need to invoke PoCallDriver which isn’t
available on NT4) so it’s still probably not very helpful.
At the least you’ll probably need 2 driver binaries. One for NT4 and
one for WDM platforms.
-p
-----Original Message-----
From: xxxxx@KrollOntrack.com [mailto:xxxxx@KrollOntrack.com]
Sent: Monday, February 03, 2003 4:14 PM
To: NT Developers Interest List
That wasn’t the question… if I can detect correct os I’ll use
different execution paths inside DriverEntry… So, any usefull
suggestions?
-----Original Message-----
From: Christiaan Ghijselinck [mailto:xxxxx@CompaqNet.be]
Sent: Monday, February 03, 2003 5:49 PM
To: NT Developers Interest List
Subject: [ntdev] Re: OS detection
Even if you succeeded to distinguish between the OS’s, there is a great
chance that your PnP driver won’t load on NT40 because its kernel
doesn’t export entry points
that you driver want to resolve at driver load ( for example Po…
power
management
procedures )
----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Tuesday, February 04, 2003 12:04 AM
Subject: [ntdev] OS detection
> Here is one that I am stuck on…
>
> I am trying to create a hybrid, PNP vs. Legacy NT4. small driver that
would have same binary run on NT4 as regular NT driver and as WDM on 9x,
w2k, XP.
>
> Via registry keys access I can distinguish either OS 9x or NT. But
> then I
can’t use PsGetVersion, it is not available on 9x, or
IoIsWdmVersionAvailable because NT4 doesn’t have even a slightest idea
what wdm is all about. So, if I use either of these APIs, the binary
would fail to load on NT4 or Win9x OSs.
>
> So, using initial knowledge about Nt or 9x os platform how can a
> single
binary driver inside its DriverEntry dissect further what version of OS
it is running on?
>
> Thanks in advance,
>
> Paul
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@krollontrack.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
You are currently subscribed to ntdev as: xxxxx@krollontrack.com
To unsubscribe send a blank email to xxxxx@lists.osr.com