Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Writing WDF Drivers | 7 Dec 2020 | LIVE ONLINE |
Internals & Software Drivers | 25 Jan 2021 | LIVE ONLINE |
Developing Minifilters | 8 March 2021 | LIVE ONLINE |
Comments
>
> This sounds like the old issue. Well, it still remains as very
> possible issue with the latest W7 WDK.
> If one file includes wdm.h and the other includes ntddk.h or ntifs.h
> or FltKernel.h and the code uses KeInitializeSpinLock, there will be
> linker errors on both x86.
> The problem is with WDM_INCLUDED define. It's defined when WDM.h was
> included without ntddk.h or other two before it. The function is forced
> non-inline on x86 if ntddk/ntifs/FltKernel are used but is used as
> export if wdm is used.
> OK, not many will include different header files, but it's a bug
> nonetheless. And it just made me rewrite a C++ library that only used
> wdm.h because it gave out linker errors
AFAIK wdm.h should not be included directly for NT platform.
Just use ntddk.h or fltkernel.h always, and forget wdm.h.
However if you want to be compatible with win2k, there are some other
compatibility #defines that can affect libraries.
Maybe all libraries must be recompiled for specific kernel version to be
safe.
Regards,
--pa
> FYI for everyone, and I hope MS changes this to the same state
> regardless of which header in included (I don't see a reason why it
> would not be inline everywhere, can there possibly be anything more the
> Ntoskrnl version does for a spin lock apart from tracking?)
>
> --
> Kind regards, Dejan (MSN support: [email protected])
> http://www.alfasp.com
> File system audit, security and encryption kits.
>
>
>
> wdm.h.
Docs suggest wdm.h (as does the name for some). I don't remember why my library has wdm.h included though.
--
Kind regards, Dejan (MSN support: [email protected])
http://www.alfasp.com
File system audit, security and encryption kits.
>> AFAIK wdm.h should not be included directly for NT platform. Just use
>> ntddk.h or fltkernel.h always, and forget
>> wdm.h.
>
> Docs suggest wdm.h (as does the name for some). I don't remember
> why my library has wdm.h included though.
Most of sample drivers in the wdk use ntddk.h. Some still use wdm.h however.
--pa
> "Dejan Maksimovic" <[email protected]> wrote in message
news:[email protected]
> >> AFAIK wdm.h should not be included directly for NT platform. Just
use
> >> ntddk.h or fltkernel.h always, and forget
> >> wdm.h.
> >
> > Docs suggest wdm.h (as does the name for some). I don't
remember
> > why my library has wdm.h included though.
>
> Most of sample drivers in the wdk use ntddk.h. Some still use wdm.h
however.
>
> --pa
>
The docs I'm looking at
(http://msdn.microsoft.com/en-us/library/ff552160.aspx) say for
KeInitializeSpinLock "Header:
Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)", so it seems that including
wdm.h directly is still correct.
James
James Harper wrote:
> The docs I'm looking at
> (http://msdn.microsoft.com/en-us/library/ff552160.aspx) say for
> KeInitializeSpinLock "Header:
> Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)", so it seems that including
> wdm.h directly is still correct.
--
Kind regards, Dejan (MSN support: [email protected])
http://www.alfasp.com
File system audit, security and encryption kits.