Windows Wdk: Når jeg forsøger at tilføje Windows.h og Wdm.h, er der en ny definition af fejl mellem ntdef.h og winnt.h

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg forsøger at finde EFI partition ved hjælp af CM\_Get\_Device\_ID\_ListW(), CM\_Get\_DevNode\_PropertyW() og ZwDeviceIoControlFile() Windows API. Dette er kun et shell-program. Jeg brugte stdio til at udskrive på terminal. Nedenfor er rækkefølgen af ​​at tilføje alle headerfiler. Jeg forsøgte at inkludere følgende filer:


#include <WINDOWS.h>
#include <initguid.h>
#include <devguid.h>
#include <devpkey.h>
#include <diskguid.h>
#include <stdio.h>
#include <cfgmgr32.h>
#include <Wdm.h>


Jeg bruger Windows 7, 64-bit, Visual Studio 2010. I VS2010 indstiller jeg inkluderingsbanen:


F:ProgramsWINDDK7600.16385.1inc;F:ProgramsWINDDK7600.16385.1incapi;F:ProgramsWINDDK7600.16385.1inccrt;F:ProgramsWINDDK7600.16385.1incddk;


Lib sti:


F:ProgramsWINDDK7600.16385.1libwin7i386


Jeg får kompilere fejl som:


f:programswinddk7600.16385.1incapi
tdef.h(128): warning C4005: 'MAX\_NATURAL\_ALIGNMENT' : macro redefinition
f:programswinddk7600.16385.1incapiwinnt.h(109) : see previous definition of 'MAX\_NATURAL\_ALIGNMENT'
f:programswinddk7600.16385.1incapi
tdef.h(161): warning C4005: 'PROBE\_ALIGNMENT' : macro redefinition
f:programswinddk7600.16385.1incapiwinnt.h(142) : see previous definition of 'PROBE\_ALIGNMENT'
f:programswinddk7600.16385.1incapi
tdef.h(614): error C2011: '\_PROCESSOR\_NUMBER' : 'struct' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(493) : see declaration of '\_PROCESSOR\_NUMBER'
f:programswinddk7600.16385.1incapi
tdef.h(625): error C2011: '\_GROUP\_AFFINITY' : 'struct' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(504) : see declaration of '\_GROUP\_AFFINITY'
f:programswinddk7600.16385.1incapi
tdef.h(882): error C2011: '\_FLOAT128' : 'struct' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(630) : see declaration of '\_FLOAT128'
f:programswinddk7600.16385.1incapi
tdef.h(933): error C2011: '\_LARGE\_INTEGER' : 'union' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(677) : see declaration of '\_LARGE\_INTEGER'
f:programswinddk7600.16385.1incapi
tdef.h(951): error C2011: '\_ULARGE\_INTEGER' : 'union' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(695) : see declaration of '\_ULARGE\_INTEGER'
f:programswinddk7600.16385.1incapi
tdef.h(973): error C2011: '\_LUID' : 'struct' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(717) : see declaration of '\_LUID'
f:programswinddk7600.16385.1incapi
tdef.h(1070): error C2084: function 'ULONGLONG Int64ShllMod32(ULONGLONG,DWORD)' already has a body
f:programswinddk7600.16385.1incapiwinnt.h(771) : see previous definition of 'Int64ShllMod32'
f:programswinddk7600.16385.1incapi
tdef.h(1086): error C2084: function 'LONGLONG Int64ShraMod32(LONGLONG,DWORD)' already has a body
f:programswinddk7600.16385.1incapiwinnt.h(778) : see previous definition of 'Int64ShraMod32'
f:programswinddk7600.16385.1incapi
tdef.h(1102): error C2084: function 'ULONGLONG Int64ShrlMod32(ULONGLONG,DWORD)' already has a body
f:programswinddk7600.16385.1incapiwinnt.h(785) : see previous definition of 'Int64ShrlMod32'
f:programswinddk7600.16385.1incapi
tdef.h(1318): warning C4005: 'UNICODE\_STRING\_MAX\_BYTES' : macro redefinition
f:programswinddk7600.16385.1incapiwinnt.h(957) : see previous definition of 'UNICODE\_STRING\_MAX\_BYTES'
f:programswinddk7600.16385.1incapi
tdef.h(1358): error C2011: '\_LIST\_ENTRY' : 'struct' type redefinition
f:programswinddk7600.16385.1incapiwinnt.h(966) : see declaration of '\_LIST\_ENTRY'....


Kan nogen hjælpe med at løse dette?

Bedste reference