Bug in ddk headers when used from cygwin

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Apr 8 09:38:00 GMT 2013


On Apr  8 01:59, Charles Wilson wrote:
> Recompiling getVolInfo (part of the csih package) with latest cygwin
> (32bit) toolchain:
> 
> gcc -ggdb -O2 -pipe -fdebug-prefix-map=/usr/src/packages/csih/csih-0.9.6-2/build=/usr/src/debug/csih-0.9.6-2 -fdebug-prefix-map=/usr/src/packages/csih/csih-0.9.6-2/src/csih-0.9.6=/usr/src/debug/csih-0.9.6-2
> -I/usr/include/w32api -I/usr/include/w32api/ddk   -c -o getVolInfo.o
> getVolInfo.c
> In file included from /usr/include/w32api/ddk/ntddk.h:38:0,
>                  from /usr/include/w32api/ddk/ntifs.h:34,
>                  from getVolInfo.c:30:
> /usr/include/w32api/ddk/wdm.h:68:20: fatal error: intrin.h: No such
> file or directory
> compilation terminated.
> 
> 
> 
> getVolInfo is a cygwin program that uses some w32api stuff under the
> hood.  It includes ntifs.h, which include ntddk.h, whch in turn
> include wdm.h, which (tries to) include intrin.h.
> 
> But intrin.h is only shipped in the mingw(64) compiler toolchains.
> So this looks like a bug: if the w32api header files for cygwin
> refer to a separate header file that is not included as part of that
> toolchain's installation footprint...
> 
> Any suggestions for a fix?

Yes.  Do not use the ddk headers with Cygwin.  Not only that intrin.h is
really missing(*), the ddk headers in mingw-w64 are not fit for usage in
user space code.  For that reason the latest Cygwin code does not use
these headers either.

There are two user space headers exposing ntdll stuff, winternl.h and
ntdef.h.  They partially contradict each other so they can't be used in
parallel.  Usage of winternl.h is preferred.  Wintern.h isn't exactly
set in stone upstream, so additions and fixes are welcome.
And, as a side note, <ddk/ntstatus.h> from mingw32 became just
<ntstatus.h> in mingw-w64.


Corinna


(*) The next Cygwin w32api headers will come with an internl.h, due to
    an important upstream fix in terms of adding the VC++ intrinsic
    functions, but that still doesn't mean you should use the ddk
    headers.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list