Thanks for detail explanation.
I’m aware of things to do for single binary on multiple OSes such as dynamic linking.
The problem I’m facing is ZwLoadDriver() fails to load driver, so DriverEntry is not even called.
Of course, error code of 0xC00000263 tells that no DriverEntry found.
I’m looking for the reason of failure and whether I’m doing possible work.
From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] on behalf of m [xxxxx@hotmail.com]
Sent: Wednesday, August 29, 2012 6:26 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Load Windows 8 driver on Windows 7 by ZwLoadDriver
If use separate binaries, then you should alter the code paths by using
pragmas not if statements. That way, the Windows 7 compatible code is not
even compiled into the Windows 8 binary and vice versa.
If you use a single binary, then you need to ensure that you don’t
statically link against any API (DDI) that is not available on your minimum
target OS (Windows 7 in this case). Then user MmGetSystemRoutineAddress
(the equivalent of GetProcAddress in UM) to get function pointers to the
newer APIs you want and can call them if present. Note that it is usually
better practice to check for the presence of the APIs themselves rather than
a specific OS version when deciding which logic to follow as APIs can be
(and in some cases have been) back ported to older OSes via service packs,
or removed from later OSes. The ones you statically link against will be
verified by the loader, but when you dynamically link, you should make sure
that you get valid function pointers for everything you need to call in a
certain path
“Woojung Huh” wrote in message news:xxxxx@ntdev…
Thanks Don & Phil.
First of all, I’m not using Win8 feature on Win7.
Driver goes different code path and uses different OS defined structure per
Window version.
For instance, Windows 8 WDK defined structure has more members in same
structure than Windows 7.
(I’m afraid that I may not be able to write details. Sorry about it.)
Driver will determine version of OS by API RtlIsNtDdiVersionAvailable() and
go different path.
My idea is building driver with Windows 8 WDK based on MSDN
(http://msdn.microsoft.com/en-us/library/windows/hardware/jj572863(v=vs.85).aspx
)
And, let it work on all version of OSes. Otherwise, I need to build two
separate drivers, Win7 and Win8.
As I wrote in 1st email, Boot Device driver built with Windows 8 WDK with
instruction in above link is working on Windows 7.
(It wasn’t working without changing link library.)
So, I was hopeful until getting error at ZwLoadDriver() to load another
kernel mode driver which is built with Windows 8 WDK with modification of
link library.
But, look like it is not possible at all.
Woojung
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-511972-
xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, August 29, 2012 1:43 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] RE:Re:Load Windows 8 driver on Windows 7 by
ZwLoadDriverYou can play games with MmGetSystemRoutineAddress but as Phil pointed
out you can’t use a Win8 only feature in Win7. Why would you have ever
thought you could?Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr“Woojung Huh” wrote in message
> news:xxxxx@ntdev:
>
> > Thanks Don.
> >
> > OK. I missed this part. Sorry.
> > I need Win8 specific features and it should be compiled with Win8 target
> > to
> work on Windows 8.
> > That makes me build two (Win7 & Win8) drivers and want to avoid it.
> >
> > It doesn’t look there is silver bullet.
> >
> >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com [mailto:bounce-511965-
> > > xxxxx@lists.osr.com] On Behalf Of Don Burn
> > > Sent: Wednesday, August 29, 2012 1:18 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: RE:[ntdev] Re:Load Windows 8 driver on Windows 7 by
> > > ZwLoadDriver
> > >
> > > Build the driver for Win7 and it should work on Win8.
> > >
> > >
> > > Don Burn
> > > Windows Filesystem and Driver Consulting
> > > Website: http://www.windrvr.com
> > > Blog: http://msmvps.com/blogs/WinDrvr
> > >
> > >
> > >
> > >
> > > “Woojung Huh” wrote in message
> > > news:xxxxx@ntdev:
> > >
> > > > Thanks for all you replies.
> > > >
> > > > Here are working scenarios.
> > > > 1. Driver built with Win7 DDK works well with ZwLoadDriver() on
> Windows 7
> > > > 2. Driver built with Win7 target on VS + Win8 WDK works well with
> > > ZwLoadDriver() on Windows 7
> > > > 3. Driver built with Win8 target on VS + Win8 WDK works well with
> > > ZwLoadDriver() on Windows 8
> > > >
> > > > Now I’m trying to have a single binary to work on all OSes.
> > > >
> > > > And, by MSDN link I posted in original email, Changing to
> > > BufferOverFlowK.lib is option to run a driver on all version of
> > > Windows.
> > > > Am I missing something?
> > > >
> > > > Thanks again.
> > > > Woojung
> > > >
> > > > > -----Original Message-----
> > > > > From: xxxxx@lists.osr.com [mailto:bounce-511961-
> > > > > xxxxx@lists.osr.com] On Behalf Of Doron Holan
> > > > > Sent: Wednesday, August 29, 2012 12:58 PM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: RE: Re:[ntdev] Load Windows 8 driver on Windows 7 by
> > > > > ZwLoadDriver
> > > > >
> > > > >
> > > > > What Os target did you build for? If you built for w8, it won’t
> > > > > load by
> > > default
> > > > > downlevel because you are linking against
> > > > > bufferoverflowfastfail.lib
> > > which
> > > > > requires win8 loader support for the security cookie to initialize
> > > > > d
> > > > >
> > > > >
> > > > > ________________________________________
> > > > > From: xxxxx@lists.osr.com [bounce-511958-
> > > > > xxxxx@lists.osr.com] on behalf of Don Burn [xxxxx@windrvr.com]
> > > > > Sent: Wednesday, August 29, 2012 9:39 AM
> > > > > To: Windows System Software Devs Interest List
> > > > > Subject: Re:[ntdev] Load Windows 8 driver on Windows 7 by
> > > ZwLoadDriver
> > > > >
> > > > > First, these drivers are built for Windows 7 right? Second is one
> > > > > of
> > > > > these a KMDF driver? In general ZwLoadDriver is not the way to
> > > > > load
> > > > > drivers (assuming you are calling it).
> > > > >
> > > > >
> > > > > Don Burn
> > > > > Windows Filesystem and Driver Consulting
> > > > > Website: http://www.windrvr.com
> > > > > Blog: http://msmvps.com/blogs/WinDrvr
> > > > >
> > > > >
> > > > > “Woojung Huh” wrote in message
> > > > > news:xxxxx@ntdev:
> > > > >
> > > > > > All,
> > > > > >
> > > > > > By MSDN (http://msdn.microsoft.com/en-
> > > > > us/library/windows/hardware/jj572863(v=vs.85).aspx), VS with Win8
> > > WDK
> > > > > can build the driver for all OSes.
> > > > > > With the guideline, I can load Win8-WDK-build BootDevice driver
> > > > > > on
> > > > > Windows 7.
> > > > > >
> > > > > > However, Windows7 fails to load another Win8-WDK-build kernel
> mode
> > > > > driver by ZwLoadDriver() API with error of 0xC0000263 (Driver
> > > > > Entry
> Point
> > > Not
> > > > > Found)
> > > > > > Error message tells there is version mismatch.
> > > > > >
> > > > > > I’d like to confirm that it is NOT possible or any mistake.
> > > > > >
> > > > > > Thanks in advance.
> > > > > > Woojung
> > > > >
> > > > >
> > > > > —
> > > > > NTDEV is sponsored by OSR
> > > > >
> > > > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > > > http://www.osr.com/seminars
> > > > >
> > > > > To unsubscribe, visit the List Server section of OSR Online at
> > > > > http://www.osronline.com/page.cfm?name=ListServer
> > > > >
> > > > >
> > > > >
> > > > > —
> > > > > NTDEV is sponsored by OSR
> > > > >
> > > > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > > > http://www.osr.com/seminars
> > > > >
> > > > > To unsubscribe, visit the List Server section of OSR Online at
> > > > > http://www.osronline.com/page.cfm?name=ListServer
> > >
> > >
> > > —
> > > NTDEV is sponsored by OSR
> > >
> > > For our schedule of WDF, WDM, debugging and other seminars visit:
> > > http://www.osr.com/seminars
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer