Annoying DDK problem with AMD64/XP

I’ve searched for this online for a day or so to no avail, though I
found lots of mentions of the problems along with “Oh, I fixed it!” with
no real explanation of the process. So, here goes:

I’m trying to compile just a sample KMDF driver (before I get started on
the real one I’ve been tasked with) for XP, and while it compiles
absolutely fine for the 32-bit version, as soon as I do “build -amd64”,
it blows up with some buggy header issues. The first error is about a
redefinition of size_t in string.h, which I can make go away by adding
-D_SIZE_T_DEFINED in the AMD64_FLAGS environment variable of my sources
file (ugly kludge, but since it’s internally defined…). However, the
bulk of my problems lie in the wxp system header files (mainly wdm.h at
the moment), involving various undefined functions or invalid intrinsics
if I define _M_AMD64 in the preprocessor flags.

The really annoying bit is that if I build in the Server 2003 x64
environment, everything is just peachy. Clearly, the wnet header files
have no problem with AMD64 defines. I’d just go ahead and do that
anyway, but since I’m targeting XP at the moment, it would be nice to
have a 64-bit XP driver available for our client.

To compound my frustration, most of the responses I’ve seen online are
“I don’t experience that problem”. I’ve uninstalled and reinstalled a
few times to no avail. This is the one close-to-useful post I’ve seen
on the subject, from January on this very list:

http://www.osronline.com/showThread.cfm?link=69731

If Uwe Kirst is reading, please let me know what you did to fix it. :slight_smile:


David Riley
Hardware Engineer
Mantaro Networks
20410 Century Blvd
Germantown, MD 20874

The Server 2003 x64 environment is the right envirnoment for building
XP64 drivers. There is no XP64 environment and you cannot build XP64
drivers in the XP 32-bit environment.

Beverly

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Riley
Sent: Tuesday, June 27, 2006 11:09 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Annoying DDK problem with AMD64/XP

I’ve searched for this online for a day or so to no avail, though I
found lots of mentions of the problems along with “Oh, I fixed it!” with
no real explanation of the process. So, here goes:

I’m trying to compile just a sample KMDF driver (before I get started on
the real one I’ve been tasked with) for XP, and while it compiles
absolutely fine for the 32-bit version, as soon as I do “build -amd64”,
it blows up with some buggy header issues. The first error is about a
redefinition of size_t in string.h, which I can make go away by adding
-D_SIZE_T_DEFINED in the AMD64_FLAGS environment variable of my sources
file (ugly kludge, but since it’s internally defined…). However, the
bulk of my problems lie in the wxp system header files (mainly wdm.h at
the moment), involving various undefined functions or invalid intrinsics
if I define _M_AMD64 in the preprocessor flags.

The really annoying bit is that if I build in the Server 2003 x64
environment, everything is just peachy. Clearly, the wnet header files
have no problem with AMD64 defines. I’d just go ahead and do that
anyway, but since I’m targeting XP at the moment, it would be nice to
have a 64-bit XP driver available for our client.

To compound my frustration, most of the responses I’ve seen online are
“I don’t experience that problem”. I’ve uninstalled and reinstalled a
few times to no avail. This is the one close-to-useful post I’ve seen
on the subject, from January on this very list:

http://www.osronline.com/showThread.cfm?link=69731

If Uwe Kirst is reading, please let me know what you did to fix it. :slight_smile:


David Riley
Hardware Engineer
Mantaro Networks
20410 Century Blvd
Germantown, MD 20874


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

DAVID:

W2K3 and XP have the same kernel on x64. Just use W2K3. I’ve seen the
size_t error when something like the conditional compilation constants
for both x86 and x64 get defined. As I’m of the camp who only uses
BUILD under life threatening situations, I don’t know what to tell you
as to why this might be happening, aside from:

  1. Checkthat your build environment batch file is running without
    errors
  2. Examine the warnings and information log after a build. BUILD
    sometimes suppresses information that might be useful in addressing this
    situation.

For whatever it is worth, I have always used X86 and AMD64 in my
custom makefiles, not M_AMD64. I have no idea if this is the problem,
or even if what I do is correct, but it does seem to work, so I thought
I’d pass it on to you.

MM

>> bbrown@mc.com 2006-06-27 11:16 >>>
The Server 2003 x64 environment is the right envirnoment for building
XP64 drivers. There is no XP64 environment and you cannot build XP64
drivers in the XP 32-bit environment.

Beverly

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Riley
Sent: Tuesday, June 27, 2006 11:09 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Annoying DDK problem with AMD64/XP

I’ve searched for this online for a day or so to no avail, though I
found lots of mentions of the problems along with “Oh, I fixed it!”
with
no real explanation of the process. So, here goes:

I’m trying to compile just a sample KMDF driver (before I get started
on
the real one I’ve been tasked with) for XP, and while it compiles
absolutely fine for the 32-bit version, as soon as I do “build
-amd64”,
it blows up with some buggy header issues. The first error is about a
redefinition of size_t in string.h, which I can make go away by adding
-D_SIZE_T_DEFINED in the AMD64_FLAGS environment variable of my
sources
file (ugly kludge, but since it’s internally defined…). However,
the
bulk of my problems lie in the wxp system header files (mainly wdm.h
at
the moment), involving various undefined functions or invalid
intrinsics
if I define _M_AMD64 in the preprocessor flags.

The really annoying bit is that if I build in the Server 2003 x64
environment, everything is just peachy. Clearly, the wnet header
files
have no problem with AMD64 defines. I’d just go ahead and do that
anyway, but since I’m targeting XP at the moment, it would be nice to
have a 64-bit XP driver available for our client.

To compound my frustration, most of the responses I’ve seen online are
“I don’t experience that problem”. I’ve uninstalled and reinstalled a
few times to no avail. This is the one close-to-useful post I’ve seen
on the subject, from January on this very list:

http://www.osronline.com/showThread.cfm?link=69731

If Uwe Kirst is reading, please let me know what you did to fix it.
:slight_smile:


David Riley
Hardware Engineer
Mantaro Networks
20410 Century Blvd
Germantown, MD 20874


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer