Второй день мучаю гугл. Никак не могу разобраться в чём проблема. В программе (не драйвер) нужно использовать некоторые структуры определённые в ddk. В настройках проекта подцепил хидеры. Дальше смех: (просто пример) Код (Text): #include <ntddk.h> int main() { DWORD ex; return 0; } - отвечает error C2065: 'DWORD' : undeclared identifier. Подцепляю winnt.h. Отвечает Код (Text): d:\winddk\3790.1830\inc\wxp\winnt.h(260) : error C2146: syntax error : missing ';' before identifier 'WCHAR' d:\winddk\3790.1830\inc\wxp\winnt.h(260) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(265) : error C2143: syntax error : missing ';' before '*' d:\winddk\3790.1830\inc\wxp\winnt.h(265) : error C2371: 'WCHAR' : redefinition; different basic types d:\winddk\3790.1830\inc\wxp\winnt.h(252) : see declaration of 'WCHAR' d:\winddk\3790.1830\inc\wxp\winnt.h(265) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(265) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(266) : error C2143: syntax error : missing ';' before '*' d:\winddk\3790.1830\inc\wxp\winnt.h(266) : error C2371: 'WCHAR' : redefinition; different basic types d:\winddk\3790.1830\inc\wxp\winnt.h(252) : see declaration of 'WCHAR' d:\winddk\3790.1830\inc\wxp\winnt.h(266) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(266) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(274) : error C2143: syntax error : missing ';' before '*' d:\winddk\3790.1830\inc\wxp\winnt.h(274) : error C2371: 'CHAR' : redefinition; different basic types d:\winddk\3790.1830\inc\wxp\winnt.h(242) : see declaration of 'CHAR' d:\winddk\3790.1830\inc\wxp\winnt.h(274) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(274) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(277) : error C2143: syntax error : missing ';' before '*' d:\winddk\3790.1830\inc\wxp\winnt.h(277) : error C2371: 'CHAR' : redefinition; different basic types d:\winddk\3790.1830\inc\wxp\winnt.h(242) : see declaration of 'CHAR' d:\winddk\3790.1830\inc\wxp\winnt.h(277) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(277) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(292) : error C2146: syntax error : missing ';' before identifier 'PCTSTR' d:\winddk\3790.1830\inc\wxp\winnt.h(292) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(292) : error C2378: 'LPCWSTR' : redefinition; symbol cannot be overloaded with a typedef d:\winddk\3790.1830\inc\wxp\winnt.h(265) : see declaration of 'LPCWSTR' d:\winddk\3790.1830\inc\wxp\winnt.h(292) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(292) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(294) : error C2146: syntax error : missing ';' before identifier 'PCUTSTR' d:\winddk\3790.1830\inc\wxp\winnt.h(294) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(294) : error C2378: 'LPCUWSTR' : redefinition; symbol cannot be overloaded with a typedef d:\winddk\3790.1830\inc\wxp\winnt.h(266) : see declaration of 'LPCUWSTR' d:\winddk\3790.1830\inc\wxp\winnt.h(294) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(294) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(331) : error C2146: syntax error : missing ';' before identifier 'FCHAR' d:\winddk\3790.1830\inc\wxp\winnt.h(331) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(331) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(332) : error C2146: syntax error : missing ';' before identifier 'FSHORT' d:\winddk\3790.1830\inc\wxp\winnt.h(332) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(332) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(333) : error C2146: syntax error : missing ';' before identifier 'FLONG' d:\winddk\3790.1830\inc\wxp\winnt.h(333) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(333) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(390) : error C2146: syntax error : missing ';' before identifier 'PLCID' d:\winddk\3790.1830\inc\wxp\winnt.h(390) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(390) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(7566) : error C2065: 'IN' : undeclared identifier d:\winddk\3790.1830\inc\wxp\winnt.h(7566) : error C2146: syntax error : missing ')' before identifier 'PSLIST_HEADER' d:\winddk\3790.1830\inc\wxp\winnt.h(7566) : warning C4229: anachronism used : modifiers on data are ignored d:\winddk\3790.1830\inc\wxp\winnt.h(7566) : error C2182: 'RtlInitializeSListHead' : illegal use of type 'void' d:\winddk\3790.1830\inc\wxp\winnt.h(7566) : error C2491: 'RtlInitializeSListHead' : definition of dllimport data not allowed d:\winddk\3790.1830\inc\wxp\winnt.h(7567) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7572) : error C2143: syntax error : missing ')' before 'const' d:\winddk\3790.1830\inc\wxp\winnt.h(7572) : error C2491: 'RtlFirstEntrySList' : definition of dllimport data not allowed d:\winddk\3790.1830\inc\wxp\winnt.h(7573) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7579) : error C2146: syntax error : missing ')' before identifier 'PSLIST_HEADER' d:\winddk\3790.1830\inc\wxp\winnt.h(7579) : warning C4229: anachronism used : modifiers on data are ignored d:\winddk\3790.1830\inc\wxp\winnt.h(7579) : error C2491: 'RtlInterlockedPopEntrySList' : definition of dllimport data not allowed d:\winddk\3790.1830\inc\wxp\winnt.h(7580) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7586) : error C2146: syntax error : missing ')' before identifier 'PSLIST_HEADER' d:\winddk\3790.1830\inc\wxp\winnt.h(7586) : warning C4229: anachronism used : modifiers on data are ignored d:\winddk\3790.1830\inc\wxp\winnt.h(7586) : error C2491: 'RtlInterlockedPushEntrySList' : definition of dllimport data not allowed d:\winddk\3790.1830\inc\wxp\winnt.h(7588) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7594) : error C2146: syntax error : missing ')' before identifier 'PSLIST_HEADER' d:\winddk\3790.1830\inc\wxp\winnt.h(7594) : warning C4229: anachronism used : modifiers on data are ignored d:\winddk\3790.1830\inc\wxp\winnt.h(7594) : error C2491: 'RtlInterlockedFlushSList' : definition of dllimport data not allowed d:\winddk\3790.1830\inc\wxp\winnt.h(7595) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7601) : error C2146: syntax error : missing ')' before identifier 'PSLIST_HEADER' d:\winddk\3790.1830\inc\wxp\winnt.h(7601) : warning C4229: anachronism used : modifiers on data are ignored d:\winddk\3790.1830\inc\wxp\winnt.h(7601) : error C2491: 'RtlQueryDepthSList' : definition of dllimport data not allowed d:\winddk\3790.1830\inc\wxp\winnt.h(7602) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7725) : error C2146: syntax error : missing ')' before identifier 'PVOID' d:\winddk\3790.1830\inc\wxp\winnt.h(7725) : error C2433: 'RtlSecureZeroMemory' : '__forceinline' not permitted on data declarations d:\winddk\3790.1830\inc\wxp\winnt.h(7727) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(7728) : error C2143: syntax error : missing ';' before '{' d:\winddk\3790.1830\inc\wxp\winnt.h(7728) : error C2447: '{' : missing function header (old-style formal list?) d:\winddk\3790.1830\inc\wxp\winnt.h(7882) : error C2146: syntax error : missing ')' before identifier 'ULONGLONG' d:\winddk\3790.1830\inc\wxp\winnt.h(7882) : warning C4229: anachronism used : modifiers on data are ignored d:\winddk\3790.1830\inc\wxp\winnt.h(7885) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(8056) : error C2146: syntax error : missing ')' before identifier 'PVOID' d:\winddk\3790.1830\inc\wxp\winnt.h(8060) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(8064) : error C2146: syntax error : missing ')' before identifier 'PVOID' d:\winddk\3790.1830\inc\wxp\winnt.h(8069) : error C2059: syntax error : ')' d:\winddk\3790.1830\inc\wxp\winnt.h(8123) : error C2146: syntax error : missing ';' before identifier 'lpFileName' d:\winddk\3790.1830\inc\wxp\winnt.h(8123) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(8123) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(8124) : error C2146: syntax error : missing ';' before identifier 'lpFilePath' d:\winddk\3790.1830\inc\wxp\winnt.h(8124) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(8124) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\winddk\3790.1830\inc\wxp\winnt.h(8154) : error C2146: syntax error : missing ';' before identifier 'lpAssemblyEncodedAssemblyIdentity ... d:\winddk\3790.1830\inc\wxp\ntdef.h(1183) : error C2227: left of '->Flink' must point to class/struct/union/generic type d:\winddk\3790.1830\inc\wxp\ntdef.h(1183) : error C2027: use of undefined type 'LIST_ENTRY64' d:\winddk\3790.1830\inc\wxp\winnt.h(780) : see declaration of 'LIST_ENTRY64' d:\winddk\3790.1830\inc\wxp\ntdef.h(1183) : fatal error C1003: error count exceeds 100; stopping compilation - короче начались проблемы с переопределением и ещё с хз чем. Пробовал NODEFAULTLIB - бестолку. Насколько я понял - надо копать в сторону namespace - на васме нашёл темы в которые тыкают - не вьехал ((. Обьясните что к чему.
В ntddk.h и winnt.h много одинаковых типов даных, следовательно имеет смысл ntddk.h обернуть в свой namespace, дабы избежать ругани компилятора. В общем, в правильном направлении копаешь.