How to use WDK Build system and specify OS as XP SP3?

I have an inherited minifilter driver (that was setup with custom visual studio builds etc). I’ve move it over to WDK Build system and I can compile it ok and it runs on win 7 32. If I setup the wdk build system to use win XP, I get an error because FltCreateFileEx is not defined in (flgKernel.h line 2788 conditional compiled out if not >= Windows XP SP3). Windows XP SP3 is my minimum base that I need to support. So what are my options? (the visual studio build system used the vista libraries and set NTDDI_VERSION to Win XP SP3) which seems to work.

If I build with the vista build or now have been trying to use wnet version, it compiles ok, and installs on XP SP3 except that it won’t start:

fltmc load xxxdrv -> Load failed with error: 0x8007007F (The specified procedure could not be found)

net start xxxdrv -> System error 127 has occurred. (The specified …same as above)

Other option is to build it with XP but somehow change the NTDDI_VERSION to Win XP SP3 - Does anyone know the best way to do that with WDK build system?

All the registry entries for the driver appear to be correct (in HKLM/SYSTEM/C.C.S/services/xxxdrv

Thanks,
Bernie

Try NTDDI_VERSION = NTDDI_WINXPSP3 in the SOURCES file.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, September 28, 2011 2:38 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] How to use WDK Build system and specify OS as XP SP3?

I have an inherited minifilter driver (that was setup with custom visual
studio builds etc). I’ve move it over to WDK Build system and I can compile
it ok and it runs on win 7 32. If I setup the wdk build system to use win
XP, I get an error because FltCreateFileEx is not defined in (flgKernel.h
line 2788 conditional compiled out if not >= Windows XP SP3). Windows XP
SP3 is my minimum base that I need to support. So what are my options?
(the visual studio build system used the vista libraries and set
NTDDI_VERSION to Win XP SP3) which seems to work.

If I build with the vista build or now have been trying to use wnet version,
it compiles ok, and installs on XP SP3 except that it won’t start:

fltmc load xxxdrv -> Load failed with error: 0x8007007F (The specified
procedure could not be found)

net start xxxdrv -> System error 127 has occurred. (The specified …same
as above)

Other option is to build it with XP but somehow change the NTDDI_VERSION to
Win XP SP3 - Does anyone know the best way to do that with WDK build system?

All the registry entries for the driver appear to be correct (in
HKLM/SYSTEM/C.C.S/services/xxxdrv

Thanks,
Bernie


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

I’ll try that in a bit, but I just noticed that if you select the Win XP build environment, there is no option to build 64 bit drivers for Win XP SP3 (start Windows driver Kits …Build Environments->Windows XP) but now I find in these links that Win2003 64 bit is same as win xp 64 bit:
Found this http://www.osronline.com/article.cfm?article=366
http://www.osronline.com/showthread.cfm?link=208026
http://www.winvistatips.com/building-common-driver-binary-both-xp-vista-and-7-a-t802832.html

So a question would be if Win2003 64 bit is same as winxp 64 bit, then is Win xp sp3 32 bit the same as Win2003 32 bit?

Bernie

Win xp sp3 32 bit is not the same as Win2003 32 bit. XP is 5.1 while W2K3 is
5.2. XP 64 bit edition is also 5.2.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, September 28, 2011 5:28 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] How to use WDK Build system and specify OS as XP SP3?

I’ll try that in a bit, but I just noticed that if you select the Win XP
build environment, there is no option to build 64 bit drivers for Win XP SP3
(start Windows driver Kits …Build Environments->Windows XP) but now I
find in these links that Win2003 64 bit is same as win xp 64 bit:
Found this http://www.osronline.com/article.cfm?article=366
http://www.osronline.com/showthread.cfm?link=208026
http://www.winvistatips.com/building-common-driver-binary-both-xp-vista-and-
7-a-t802832.html

So a question would be if Win2003 64 bit is same as winxp 64 bit, then is
Win xp sp3 32 bit the same as Win2003 32 bit?

Bernie


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

Look at the WDK documentation for NTDDI_VERSION. It is under build macros.
Also look at sdkddkver.h

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, September 28, 2011 5:28 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] How to use WDK Build system and specify OS as XP SP3?

I’ll try that in a bit, but I just noticed that if you select the Win XP
build environment, there is no option to build 64 bit drivers for Win XP SP3
(start Windows driver Kits …Build Environments->Windows XP) but now I
find in these links that Win2003 64 bit is same as win xp 64 bit:
Found this http://www.osronline.com/article.cfm?article=366
http://www.osronline.com/showthread.cfm?link=208026
http://www.winvistatips.com/building-common-driver-binary-both-xp-vista-and-
7-a-t802832.html

So a question would be if Win2003 64 bit is same as winxp 64 bit, then is
Win xp sp3 32 bit the same as Win2003 32 bit?

Bernie


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

> So a question would be if Win2003 64 bit is same as winxp 64 bit,

Yes.

XP64 was created as a consumer desktop version of 2003 64.

then is Win xp sp3 32 bit the same as Win2003 32 bit?

No.

XP 32bit is another OS version, older then 2003 32bit.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>

So a question would be if Win2003 64 bit is same as winxp 64 bit, then is Win xp sp3 32 bit the same as Win2003 32 bit?

No. Absolutely not.

Thanks for clarification as this was not obvious to me and I made some assumptions that weren’t correct.

Well at least now it’s documented here in OSR to help others.

Thanks,
Bernie

More questions. I have setup my Win XP 32 bit compile to use the setenv for win xp. I’ve added the folling to my sources file (this makes it so that if win xp is target, set it up for SP3):

!IF ( $(_NT_TARGET_VERSION) == $(_NT_TARGET_VERSION_WINXP) )
NTDDI_VERSION = NTDDI_WINXPSP3
!ENDIF

however it compiles ok but I now get unsresolved external symbol on function FltCreateFileEx (which FltKernal.h allows you to reference if you compile for windows xp sp3 (line 2798).

The documentation for FltCreateFileEx in WDK states in the defintion of FltCreateFileEx:
Available in Microsoft Windows 2000 Update Rollup 1 for SP4, Windows XP SP3, Windows Server 2003 SP1, and later versions of the Windows operating system.

I went and looked at the fltmgr.lib for windows XP and it doesn’t include the FltCreateFileEx function in it (using dumpbin /exports).

So the question is where do I get a fltmgr.lib that includes a definition for Windows XP SP3?
Do I go ahead and use fltmgr.lib from the wnet set of libraries?

Bernie

Ok i’ve compiled and linked with the wxp build environment (with the exception of using the fltmgr from wnet (2003) and this is still failing per my first post on a windows XP 32 bit sp3 system (all the same symptoms).

Can someone give me clues on the best way to debug this?

Thanks,
Bernie

Instead of linking to FltCreateFileEx you can use FltGetRoutineAddress at
runtime to get the address of FltCraeteFileEx. If the routine exists then
you use the function through the pointer. If it doesn’t exist then use
FlrCreateFile and then ObReferenceObjectByHandle to get the FILE_OBJECT.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Thursday, September 29, 2011 2:23 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] How to use WDK Build system and specify OS as XP SP3?

More questions. I have setup my Win XP 32 bit compile to use the setenv for
win xp. I’ve added the folling to my sources file (this makes it so that if
win xp is target, set it up for SP3):

!IF ( $(_NT_TARGET_VERSION) == $(_NT_TARGET_VERSION_WINXP) ) NTDDI_VERSION =
NTDDI_WINXPSP3 !ENDIF

however it compiles ok but I now get unsresolved external symbol on function
FltCreateFileEx (which FltKernal.h allows you to reference if you compile
for windows xp sp3 (line 2798).

The documentation for FltCreateFileEx in WDK states in the defintion of
FltCreateFileEx:
Available in Microsoft Windows 2000 Update Rollup 1 for SP4, Windows XP SP3,
Windows Server 2003 SP1, and later versions of the Windows operating system.

I went and looked at the fltmgr.lib for windows XP and it doesn’t include
the FltCreateFileEx function in it (using dumpbin /exports).

So the question is where do I get a fltmgr.lib that includes a definition
for Windows XP SP3?
Do I go ahead and use fltmgr.lib from the wnet set of libraries?

Bernie


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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