这段程序如下,我单独写了一个头文件,然后用C++方式在DDK下编译,出现了一大堆报错,在C下编译也是大堆错误,请求高手解决。
typedef struct _SECTION_IMAGE_INFORMATION {
PVOID EntryPoint; 
ULONG StackZeroBits; 
ULONG StackReserved; 
ULONG StackCommit; 
ULONG ImageSubsystem; 
WORD SubsystemVersionLow; 
WORD SubsystemVersionHigh; 
ULONG Unknown1; 
ULONG ImageCharacteristics; 
ULONG ImageMachineType; 
ULONG Unknown2[3];
} SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;DWORD GetDllFunctionAddress(char* lpFunctionName, PUNICODE_STRING pDllName) 
{
    HANDLE hThread, hSection, hFile, hMod;
     SECTION_IMAGE_INFORMATION sii;
     IMAGE_DOS_HEADER* dosheader;
     IMAGE_OPTIONAL_HEADER* opthdr;
     IMAGE_EXPORT_DIRECTORY* pExportTable;
     DWORD* arrayOfFunctionAddresses;
     DWORD* arrayOfFunctionNames;
     WORD* arrayOfFunctionOrdinals;
     DWORD functionOrdinal;
     DWORD Base, x, functionAddress;
    char* functionName;
     STRING ntFunctionName, ntFunctionNameSearch;
     PVOID BaseAddress = NULL;
     SIZE_T size=0;     OBJECT_ATTRIBUTES oa = {sizeof oa, 0, pDllName, OBJ_CASE_INSENSITIVE};     IO_STATUS_BLOCK iosb;   //_asm int 3;
     ZwOpenFile(&hFile, FILE_EXECUTE | SYNCHRONIZE, &oa, &iosb, FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_NONALERT);     oa.ObjectName = 0;
     ZwCreateSection(&hSection, SECTION_ALL_ACCESS, &oa, 0,PAGE_EXECUTE, SEC_IMAGE, hFile);
    
     ZwMapViewOfSection(hSection, NtCurrentProcess(), &BaseAddress, 0, 1000, 0, &size, (SECTION_INHERIT)1, MEM_TOP_DOWN, PAGE_READWRITE); 
    
     ZwClose(hFile);
    
     hMod = BaseAddress;
    
     dosheader = (IMAGE_DOS_HEADER *)hMod;
    
     opthdr =(IMAGE_OPTIONAL_HEADER *) ((BYTE*)hMod+dosheader->e_lfanew+24);     pExportTable =(IMAGE_EXPORT_DIRECTORY*)((BYTE*) hMod + opthdr->DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT]. VirtualAddress);    // now we can get the exported functions, but note we convert from RVA to address
     arrayOfFunctionAddresses = (DWORD*)( (BYTE*)hMod + pExportTable->AddressOfFunctions);     arrayOfFunctionNames = (DWORD*)( (BYTE*)hMod + pExportTable->AddressOfNames);     arrayOfFunctionOrdinals = (WORD*)( (BYTE*)hMod + pExportTable->AddressOfNameOrdinals);     Base = pExportTable->Base;    RtlInitString(&ntFunctionNameSearch, lpFunctionName);
    for(x = 0; x < pExportTable->NumberOfFunctions; x++)
{
         functionName = (char*)( (BYTE*)hMod + arrayOfFunctionNames[x]);         RtlInitString(&ntFunctionName, functionName);         functionOrdinal = arrayOfFunctionOrdinals[x] + Base - 1; // always need to add base, -1 as array counts from 0
        // this is the funny bit.   you would expect the function pointer to simply be arrayOfFunctionAddresses[x]
        // oh no thats too simple.   it is actually arrayOfFunctionAddresses[functionOrdinal]!!
         functionAddress = (DWORD)( (BYTE*)hMod + arrayOfFunctionAddresses[functionOrdinal]);
        if (RtlCompareString(&ntFunctionName, &ntFunctionNameSearch, TRUE) == 0) 
      {
             ZwClose(hSection);
            return functionAddress;
         }
     }     ZwClose(hSection);
    return 0;
}C++编译的时候的错误报告:
1>mini_ddk1.h(34) : error C2065: 'IMAGE_DOS_HEADER' : undeclared identifier
1>mini_ddk1.h(34) : error C2065: 'dosheader' : undeclared identifier
1>mini_ddk1.h(35) : error C2065: 'IMAGE_OPTIONAL_HEADER' : undeclared identifier
1>mini_ddk1.h(35) : error C2065: 'opthdr' : undeclared identifier
1>mini_ddk1.h(36) : error C2065: 'IMAGE_EXPORT_DIRECTORY' : undeclared identifier
1>mini_ddk1.h(36) : error C2065: 'pExportTable' : undeclared identifier
1>mini_ddk1.h(55) : error C2065: 'SEC_IMAGE' : undeclared identifier
1>mini_ddk1.h(63) : error C2059: syntax error : ')'
1>mini_ddk1.h(65) : error C2059: syntax error : ')'
1>mini_ddk1.h(67) : error C2059: syntax error : ')'
1>mini_ddk1.h(70) : error C2227: left of '->AddressOfFunctions' must point to class/struct/union
1>mini_ddk1.h(63) : error C3861: 'dosheader': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(63) : error C3861: 'IMAGE_DOS_HEADER': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(65) : error C3861: 'opthdr': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(65) : error C3861: 'IMAGE_OPTIONAL_HEADER': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(67) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(67) : error C3861: 'IMAGE_EXPORT_DIRECTORY': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(70) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(72) : error C2227: left of '->AddressOfNames' must point to class/struct/union
1>mini_ddk1.h(72) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(74) : error C2227: left of '->AddressOfNameOrdinals' must point to class/struct/union
1>mini_ddk1.h(74) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(76) : error C2227: left of '->Base' must point to class/struct/union
1>mini_ddk1.h(76) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
1>mini_ddk1.h(79) : error C2227: left of '->NumberOfFunctions' must point to class/struct/union
1>mini_ddk1.h(79) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(34) : error C2065: 'IMAGE_DOS_HEADER' : undeclared identifier
101>mini_ddk1.h(34) : error C2065: 'dosheader' : undeclared identifier
101>mini_ddk1.h(35) : error C2065: 'IMAGE_OPTIONAL_HEADER' : undeclared identifier
101>mini_ddk1.h(35) : error C2065: 'opthdr' : undeclared identifier
101>mini_ddk1.h(36) : error C2065: 'IMAGE_EXPORT_DIRECTORY' : undeclared identifier
101>mini_ddk1.h(36) : error C2065: 'pExportTable' : undeclared identifier
101>mini_ddk1.h(55) : error C2065: 'SEC_IMAGE' : undeclared identifier
101>mini_ddk1.h(63) : error C2059: syntax error : ')'
101>mini_ddk1.h(65) : error C2059: syntax error : ')'
101>mini_ddk1.h(67) : error C2059: syntax error : ')'
101>mini_ddk1.h(70) : error C2227: left of '->AddressOfFunctions' must point to class/struct/union
101>mini_ddk1.h(63) : error C3861: 'dosheader': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(63) : error C3861: 'IMAGE_DOS_HEADER': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(65) : error C3861: 'opthdr': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(65) : error C3861: 'IMAGE_OPTIONAL_HEADER': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(67) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(67) : error C3861: 'IMAGE_EXPORT_DIRECTORY': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(70) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(72) : error C2227: left of '->AddressOfNames' must point to class/struct/union
101>mini_ddk1.h(72) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(74) : error C2227: left of '->AddressOfNameOrdinals' must point to class/struct/union
101>mini_ddk1.h(74) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(76) : error C2227: left of '->Base' must point to class/struct/union
101>mini_ddk1.h(76) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup
101>mini_ddk1.h(79) : error C2227: left of '->NumberOfFunctions' must point to class/struct/union
101>mini_ddk1.h(79) : error C3861: 'pExportTable': identifier not found, even with argument-dependent lookup

解决方案 »

  1.   

    在C下进行DDK的编译错误报告如下:
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(96) : error C2143: syntax error : missing ';' before 'type'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(97) : error C2275: 'ULONG' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\ntdef.h(414) : see declaration of 'ULONG'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(97) : error C2146: syntax error : missing ';' before identifier 'Old_Addr'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(97) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(97) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(97) : error C2143: syntax error : missing ';' before 'identifier'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(97) : error C2065: 'Old_Addr' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(98) : error C2065: 'Old_NtOpenProcess' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(98) : warning C4133: 'function' : incompatible types - from 'int *' to 'PUNICODE_STRING'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(99) : warning C4133: 'function' : incompatible types - from 'int *' to 'PUNICODE_STRING'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(182) : error C2065: 'IMAGE_DOS_HEADER' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(182) : error C2065: 'dosheader' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(182) : error C4552: '*' : operator has no effect; expected operator with side-effect
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(183) : error C2065: 'IMAGE_OPTIONAL_HEADER' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(183) : error C2065: 'opthdr' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(183) : error C4552: '*' : operator has no effect; expected operator with side-effect
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(184) : error C2065: 'IMAGE_EXPORT_DIRECTORY' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(184) : error C2065: 'pExportTable' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(184) : error C4552: '*' : operator has no effect; expected operator with side-effect
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(185) : error C2275: 'DWORD' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\windef.h(141) : see declaration of 'DWORD'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(185) : error C2065: 'arrayOfFunctionAddresses' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(186) : error C2275: 'DWORD' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\windef.h(141) : see declaration of 'DWORD'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(186) : error C2065: 'arrayOfFunctionNames' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(187) : error C2275: 'WORD' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\windef.h(144) : see declaration of 'WORD'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(187) : error C2065: 'arrayOfFunctionOrdinals' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(188) : error C2275: 'DWORD' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\windef.h(141) : see declaration of 'DWORD'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(188) : error C2146: syntax error : missing ';' before identifier 'functionOrdinal'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(188) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(188) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(188) : error C2143: syntax error : missing ';' before 'identifier'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(188) : error C2065: 'functionOrdinal' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2275: 'DWORD' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\windef.h(141) : see declaration of 'DWORD'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2146: syntax error : missing ';' before identifier 'Base'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2143: syntax error : missing ';' before 'identifier'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2065: 'Base' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2065: 'x' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(189) : error C2065: 'functionAddress' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(190) : error C2143: syntax error : missing ';' before 'type'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2275: 'STRING' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\ntdef.h(1057) : see declaration of 'STRING'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2146: syntax error : missing ';' before identifier 'ntFunctionName'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2143: syntax error : missing ';' before 'identifier'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2065: 'ntFunctionName' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(191) : error C2065: 'ntFunctionNameSearch' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : error C2275: 'PVOID' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\ntdef.h(265) : see declaration of 'PVOID'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : error C2146: syntax error : missing ';' before identifier 'BaseAddress'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : error C2143: syntax error : missing ';' before 'identifier'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : error C2065: 'BaseAddress' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(192) : warning C4047: '=' : 'int' differs in levels of indirection from 'void *'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(193) : error C2275: 'SIZE_T' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\basetsd.h(298) : see declaration of 'SIZE_T'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(193) : error C2146: syntax error : missing ';' before identifier 'size'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(193) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(193) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(193) : error C2143: syntax error : missing ';' before 'identifier'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(193) : error C2065: 'size' : undeclared identifier
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(195) : error C2275: 'OBJECT_ATTRIBUTES' : illegal use of this type as an expression
    1>        d:\WINDDK\3790.1830\inc\wxp\ntdef.h(1264) : see declaration of 'OBJECT_ATTRIBUTES'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(195) : error C2146: syntax error : missing ';' before identifier 'oa'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(195) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(195) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
    1>d:\郁金香过驱动保护视频教程1-51课\021_绕过驱动保护\mini_ddk\mini_ddk.h(195) : error C2143: syntax error : missing ';' before 'identifier'
    //后面太多了,共有二百多个错误。。
      

  2.   

    错误报告如下,全部报的是winnt.h的错哦。
    >d:\winddk\3790.1830\inc\wxp\winnt.h(54) : error C2220: warning treated as error - no object file generated
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(54) : error C4005: 'MAX_NATURAL_ALIGNMENT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(81) : error C4005: 'PROBE_ALIGNMENT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(415) : error C2011: '_FLOAT128' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(458) : error C2011: '_LARGE_INTEGER' : 'union' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(476) : error C2011: '_ULARGE_INTEGER' : 'union' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(498) : error C2011: '_LUID' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(602) : error C4005: 'UInt32x32To64' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(636) : error C2084: function 'ULONGLONG Int64ShllMod32(ULONGLONG,ULONG)' already has a body
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(652) : error C2084: function 'LONGLONG Int64ShraMod32(LONGLONG,ULONG)' already has a body
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(668) : error C2084: function 'ULONGLONG Int64ShrlMod32(ULONGLONG,ULONG)' already has a body
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(747) : error C4005: 'UNICODE_STRING_MAX_BYTES' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(756) : error C2011: '_LIST_ENTRY' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(766) : error C2011: '_SINGLE_LIST_ENTRY' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(774) : error C2011: 'LIST_ENTRY32' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(780) : error C2011: 'LIST_ENTRY64' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1186) : error C4005: 'MAKELANGID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1187) : error C4005: 'PRIMARYLANGID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1188) : error C4005: 'SUBLANGID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1214) : error C4005: 'MAKELCID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1217) : error C4005: 'MAKESORTLCID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1218) : error C4005: 'LANGIDFROMLCID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1219) : error C4005: 'SORTIDFROMLCID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1220) : error C4005: 'SORTVERSIONFROMLCID' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1317) : error C4005: 'STATUS_WAIT_0' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1318) : error C4005: 'STATUS_ABANDONED_WAIT_0' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1319) : error C4005: 'STATUS_USER_APC' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1320) : error C4005: 'STATUS_TIMEOUT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1321) : error C4005: 'STATUS_PENDING' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1322) : error C4005: 'DBG_EXCEPTION_HANDLED' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1323) : error C4005: 'DBG_CONTINUE' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1324) : error C4005: 'STATUS_SEGMENT_NOTIFICATION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1325) : error C4005: 'DBG_TERMINATE_THREAD' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1326) : error C4005: 'DBG_TERMINATE_PROCESS' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1327) : error C4005: 'DBG_CONTROL_C' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1328) : error C4005: 'DBG_CONTROL_BREAK' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1329) : error C4005: 'STATUS_GUARD_PAGE_VIOLATION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1330) : error C4005: 'STATUS_DATATYPE_MISALIGNMENT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1331) : error C4005: 'STATUS_BREAKPOINT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1332) : error C4005: 'STATUS_SINGLE_STEP' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1333) : error C4005: 'DBG_EXCEPTION_NOT_HANDLED' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1334) : error C4005: 'STATUS_ACCESS_VIOLATION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1335) : error C4005: 'STATUS_IN_PAGE_ERROR' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1336) : error C4005: 'STATUS_INVALID_HANDLE' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1337) : error C4005: 'STATUS_NO_MEMORY' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1338) : error C4005: 'STATUS_ILLEGAL_INSTRUCTION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1339) : error C4005: 'STATUS_NONCONTINUABLE_EXCEPTION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1340) : error C4005: 'STATUS_INVALID_DISPOSITION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1341) : error C4005: 'STATUS_ARRAY_BOUNDS_EXCEEDED' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1342) : error C4005: 'STATUS_FLOAT_DENORMAL_OPERAND' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1343) : error C4005: 'STATUS_FLOAT_DIVIDE_BY_ZERO' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1344) : error C4005: 'STATUS_FLOAT_INEXACT_RESULT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1345) : error C4005: 'STATUS_FLOAT_INVALID_OPERATION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1346) : error C4005: 'STATUS_FLOAT_OVERFLOW' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1347) : error C4005: 'STATUS_FLOAT_STACK_CHECK' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1348) : error C4005: 'STATUS_FLOAT_UNDERFLOW' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1349) : error C4005: 'STATUS_INTEGER_DIVIDE_BY_ZERO' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1350) : error C4005: 'STATUS_INTEGER_OVERFLOW' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1351) : error C4005: 'STATUS_PRIVILEGED_INSTRUCTION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1352) : error C4005: 'STATUS_STACK_OVERFLOW' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1353) : error C4005: 'STATUS_CONTROL_C_EXIT' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1354) : error C4005: 'STATUS_FLOAT_MULTIPLE_FAULTS' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1355) : error C4005: 'STATUS_FLOAT_MULTIPLE_TRAPS' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1356) : error C4005: 'STATUS_REG_NAT_CONSUMPTION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1358) : error C4005: 'STATUS_SXS_EARLY_DEACTIVATION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(1359) : error C4005: 'STATUS_SXS_INVALID_DEACTIVATION' : macro redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(2003) : error C2011: '_FLOATING_SAVE_AREA' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(2027) : error C2011: '_CONTEXT' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(3357) : error C2011: '_EXCEPTION_RECORD' : 'struct' type redefinition
    1>d:\winddk\3790.1830\inc\wxp\winnt.h(3368) : error C2011: '_EXCEPTION_RECORD32' : 'struct' type redefinition
      

  3.   

    我包含了一个window.h进行以后,只有两个错误了
    1>mini_ddk1.h(2) : error C1083: Cannot open include file: 'window.h': No such file or directory
    101>mini_ddk1.h(2) : error C1083: Cannot open include file: 'window.h': No such file or directory
      

  4.   

    缺少PE结构体的相关说明,你不要包含winnt.h,你应该把那些结构体声明,宏定义等,直接拷贝到一个新建的头文件里