ntddk.h and wdm.h

I used to include <wdm.h> in my driver. Now I need to include some function
that is included only in <ntddk.h>. It’s not possible to include both, I
therefore only include <ntddk.h>, which happens to be also what I have read
in the archive, under this thread:
http://www.osronline.com/lists_archive/ntdev/thread8453.html

The problem I’m facing now is that I also need to include <stdunk.h>, which
in turn includes <wdm.h>. Multiple definitions!! Bummer.

How should I circumvent this? I hope there is something else to do, other
than to copy-paste the function prototypes in my project.

Mat</wdm.h></stdunk.h></ntddk.h></ntddk.h></wdm.h>

> ----------

From: xxxxx@guillemot.com[SMTP:xxxxx@guillemot.com]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, August 21, 2003 10:17 PM
To: xxxxx@lists.osr.com
Subject: [ntdev] ntddk.h and wdm.h

I used to include <wdm.h> in my driver. Now I need to include some
> function
> that is included only in <ntddk.h>. It’s not possible to include both, I
> therefore only include <ntddk.h>, which happens to be also what I have
> read
> in the archive, under this thread:
> http://www.osronline.com/lists_archive/ntdev/thread8453.html
>
> The problem I’m facing now is that I also need to include <stdunk.h>,
> which
> in turn includes <wdm.h>. Multiple definitions!! Bummer.
>
> How should I circumvent this? I hope there is something else to do, other
> than to copy-paste the function prototypes in my project.
>
A quick and dirty way is:

#define WDMDDK

before including stdunk.h. It should work if wdm.h is really a subset of
ntddk.h. Note I know nothing about stdunk.h and its needs.

Best regards
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]</wdm.h></stdunk.h></ntddk.h></ntddk.h></wdm.h>

Try creating a dummy blank wdm.h and make sure it’s installed earlier in
the include path,
or temporarily rename the real wdm.h.

George

At 01:17 PM 8/21/2003, you wrote:

I used to include <wdm.h> in my driver. Now I need to include some function
>that is included only in <ntddk.h>. It’s not possible to include both, I
>therefore only include <ntddk.h>, which happens to be also what I have read
>in the archive, under this thread:
>http://www.osronline.com/lists_archive/ntdev/thread8453.html
>
>The problem I’m facing now is that I also need to include <stdunk.h>, which
>in turn includes <wdm.h>. Multiple definitions!! Bummer.
>
>How should I circumvent this? I hope there is something else to do, other
>than to copy-paste the function prototypes in my project.
>
>Mat
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@ntrealtime.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

George Blat
NT with real time performance
8016 188th SW, Edmonds, WA 98026

phone: 425-775-7475
fax: 781-998-5940
mailto:xxxxx@ntrealtime.com</wdm.h></stdunk.h></ntddk.h></ntddk.h></wdm.h>

If you are using c++ you could use a namespace to avoid multiple
definitions:

#include <ntddk.h>

namespace WDM
{
#include <wdm.h>
};

This will still give you many macro redefinition errors as macros are not
considered in the namespace. I have used this successfully with ntddk.h and
ntifs.h

“Mathieu Routhier” wrote in message
news:xxxxx@ntdev…
>
> I used to include <wdm.h> in my driver. Now I need to include some
function
> that is included only in <ntddk.h>. It’s not possible to include both, I
> therefore only include <ntddk.h>, which happens to be also what I have
read
> in the archive, under this thread:
> http://www.osronline.com/lists_archive/ntdev/thread8453.html
>
> The problem I’m facing now is that I also need to include <stdunk.h>,
which
> in turn includes <wdm.h>. Multiple definitions!! Bummer.
>
> How should I circumvent this? I hope there is something else to do, other
> than to copy-paste the function prototypes in my project.
>
> Mat
>
>
></wdm.h></stdunk.h></ntddk.h></ntddk.h></wdm.h></wdm.h></ntddk.h>

You could try to isolate the functions using the extra part of ntddk.h and
stdunk.h from each other, encapsulate them into separated C resp. C++
modules and include only one of them - ntddk.h or stdunk.h - in each of
both. However exported interfaces of both modules (and rest of driver) must
depend only from wdm.h to realize this.

Regards
Volker

-----Original Message-----
From: Mathieu Routhier [mailto:xxxxx@guillemot.com]
Sent: Thursday, August 21, 2003 10:17 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] ntddk.h and wdm.h

I used to include <wdm.h> in my driver. Now I need to
> include some function
> that is included only in <ntddk.h>. It’s not possible to
> include both, I
> therefore only include <ntddk.h>, which happens to be also
> what I have read
> in the archive, under this thread:
> http://www.osronline.com/lists_archive/ntdev/thread8453.html
>
> The problem I’m facing now is that I also need to include
> <stdunk.h>, which
> in turn includes <wdm.h>. Multiple definitions!! Bummer.
>
> How should I circumvent this? I hope there is something else
> to do, other
> than to copy-paste the function prototypes in my project.
>
> Mat
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@baslerweb.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
></wdm.h></stdunk.h></ntddk.h></ntddk.h></wdm.h>

Thank you guys for your suggestions. I think the “#define WDMDDK” trick
is the cleanest one. It simply fools wdm.h into thinking it’s already been
included. Works for me.

Mat

-----Original Message-----
From: Michal Vodicka [mailto:xxxxx@veridicom.cz.nospam]
Sent: Thursday, August 21, 2003 5:24 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] RE: ntddk.h and wdm.h


From: xxxxx@guillemot.com[SMTP:xxxxx@guillemot.com]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, August 21, 2003 10:17 PM
To: xxxxx@lists.osr.com
Subject: [ntdev] ntddk.h and wdm.h

I used to include <wdm.h> in my driver. Now I need to include some
> function
> that is included only in <ntddk.h>. It’s not possible to include both, I
> therefore only include <ntddk.h>, which happens to be also what I have
> read
> in the archive, under this thread:
> http://www.osronline.com/lists_archive/ntdev/thread8453.html
>
> The problem I’m facing now is that I also need to include <stdunk.h>,
> which
> in turn includes <wdm.h>. Multiple definitions!! Bummer.
>
> How should I circumvent this? I hope there is something else to do, other
> than to copy-paste the function prototypes in my project.
>
A quick and dirty way is:

#define WDMDDK

before including stdunk.h. It should work if wdm.h is really a subset of
ntddk.h. Note I know nothing about stdunk.h and its needs.

Best regards
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


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

You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</wdm.h></stdunk.h></ntddk.h></ntddk.h></wdm.h>