我按你说的,在 Microsoft Visual C++ 6.0 中编译,得到如下结果
Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
c:\documents and settings\cjf\cpp1.cpp(3) : error C2146: syntax error : missing ';' before identifier 'Length'
c:\documents and settings\cjf\cpp1.cpp(3) : error C2501: 'USHORT' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(3) : error C2501: 'Length' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(4) : error C2146: syntax error : missing ';' before identifier 'MaximumLength'
c:\documents and settings\cjf\cpp1.cpp(4) : error C2501: 'USHORT' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(4) : error C2501: 'MaximumLength' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(5) : error C2146: syntax error : missing ';' before identifier 'Buffer'
c:\documents and settings\cjf\cpp1.cpp(5) : error C2501: 'PWSTR' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(5) : error C2501: 'Buffer' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(9) : error C2146: syntax error : missing ';' before identifier 'Length'
c:\documents and settings\cjf\cpp1.cpp(9) : error C2501: 'ULONG' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(9) : error C2501: 'Length' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(10) : error C2146: syntax error : missing ';' before identifier 'Initialized'
c:\documents and settings\cjf\cpp1.cpp(10) : error C2501: 'BOOLEAN' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(10) : error C2501: 'Initialized' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(11) : error C2146: syntax error : missing ';' before identifier 'SsHandle'
c:\documents and settings\cjf\cpp1.cpp(11) : error C2501: 'PVOID' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(11) : error C2501: 'SsHandle' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(12) : error C2146: syntax error : missing ';' before identifier 'InLoadOrderModuleList'
c:\documents and settings\cjf\cpp1.cpp(12) : error C2501: 'LIST_ENTRY' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(12) : error C2501: 'InLoadOrderModuleList' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(13) : error C2146: syntax error : missing ';' before identifier 'InMemoryOrderModuleList'
c:\documents and settings\cjf\cpp1.cpp(13) : error C2501: 'LIST_ENTRY' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(13) : error C2501: 'InMemoryOrderModuleList' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(14) : error C2146: syntax error : missing ';' before identifier 'InInitializationOrderModuleList'
c:\documents and settings\cjf\cpp1.cpp(14) : error C2501: 'LIST_ENTRY' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(14) : error C2501: 'InInitializationOrderModuleList' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(19) : error C2146: syntax error : missing ';' before identifier 'InLoadOrderModuleList'
c:\documents and settings\cjf\cpp1.cpp(19) : error C2501: 'LIST_ENTRY' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(19) : error C2501: 'InLoadOrderModuleList' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(20) : error C2146: syntax error : missing ';' before identifier 'InMemoryOrderModuleList'
c:\documents and settings\cjf\cpp1.cpp(20) : error C2501: 'LIST_ENTRY' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(20) : error C2501: 'InMemoryOrderModuleList' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(21) : error C2146: syntax error : missing ';' before identifier 'InInitializationOrderModuleList'
c:\documents and settings\cjf\cpp1.cpp(21) : error C2501: 'LIST_ENTRY' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(21) : error C2501: 'InInitializationOrderModuleList' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(24) : error C2146: syntax error : missing ';' before identifier 'SizeOfImage'
c:\documents and settings\cjf\cpp1.cpp(24) : error C2501: 'ULONG' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(24) : error C2501: 'SizeOfImage' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(27) : error C2146: syntax error : missing ';' before identifier 'Flags'
c:\documents and settings\cjf\cpp1.cpp(27) : error C2501: 'ULONG' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(27) : error C2501: 'Flags' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(28) : error C2146: syntax error : missing ';' before identifier 'LoadCount'
c:\documents and settings\cjf\cpp1.cpp(28) : error C2501: 'SHORT' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(28) : error C2501: 'LoadCount' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(29) : error C2146: syntax error : missing ';' before identifier 'TlsIndex'
c:\documents and settings\cjf\cpp1.cpp(29) : error C2501: 'SHORT' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(29) : error C2501: 'TlsIndex' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(30) : error C2146: syntax error : missing ';' before identifier 'SectionHandle'
c:\documents and settings\cjf\cpp1.cpp(30) : error C2501: 'HANDLE' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(30) : error C2501: 'SectionHandle' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(31) : error C2146: syntax error : missing ';' before identifier 'CheckSum'
c:\documents and settings\cjf\cpp1.cpp(31) : error C2501: 'ULONG' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(31) : error C2501: 'CheckSum' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(32) : error C2146: syntax error : missing ';' before identifier 'TimeDateStamp'
c:\documents and settings\cjf\cpp1.cpp(32) : error C2501: 'ULONG' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(32) : error C2501: 'TimeDateStamp' : missing storage-class or type specifiers
c:\documents and settings\cjf\cpp1.cpp(36) : error C2065: 'HMODULE' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(36) : error C2146: syntax error : missing ';' before identifier 'hMod'
c:\documents and settings\cjf\cpp1.cpp(36) : error C2065: 'hMod' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(36) : error C2039: 'GetModuleHandle' : is not a member of '`global namespace''
c:\documents and settings\cjf\cpp1.cpp(36) : error C2065: 'GetModuleHandle' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(37) : error C2065: 'PLIST_ENTRY' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(37) : error C2146: syntax error : missing ';' before identifier 'Head'
c:\documents and settings\cjf\cpp1.cpp(37) : error C2065: 'Head' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(37) : error C2065: 'Cur' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(46) : error C2039: 'InLoadOrderModuleList' : is not a member of '_PEB_LDR_DATA'
c:\documents and settings\cjf\cpp1.cpp(8) : see declaration of '_PEB_LDR_DATA'
c:\documents and settings\cjf\cpp1.cpp(47) : error C2227: left of '->Flink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(50) : error C2065: 'CONTAINING_RECORD' : undeclared identifier
c:\documents and settings\cjf\cpp1.cpp(50) : error C2275: 'LDR_MODULE' : illegal use of this type as an expression
c:\documents and settings\cjf\cpp1.cpp(33) : see declaration of 'LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(50) : error C2440: '=' : cannot convert from 'int' to 'struct _LDR_MODULE *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\cjf\cpp1.cpp(52) : error C2446: '==' : no conversion from 'void *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\documents and settings\cjf\cpp1.cpp(52) : error C2040: '==' : 'int' differs in levels of indirection from 'void *'
c:\documents and settings\cjf\cpp1.cpp(54) : error C2039: 'InLoadOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(54) : error C2228: left of '.Blink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(54) : error C2227: left of '->Flink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(55) : error C2039: 'InLoadOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(55) : error C2228: left of '.Flink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(56) : error C2039: 'InLoadOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(56) : error C2228: left of '.Flink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(56) : error C2227: left of '->Blink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(57) : error C2039: 'InLoadOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(57) : error C2228: left of '.Blink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(58) : error C2039: 'InInitializationOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(58) : error C2228: left of '.Blink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(58) : error C2227: left of '->Flink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(59) : error C2039: 'InInitializationOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(59) : error C2228: left of '.Flink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(60) : error C2039: 'InInitializationOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(60) : error C2228: left of '.Flink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(60) : error C2227: left of '->Blink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(61) : error C2039: 'InInitializationOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(61) : error C2228: left of '.Blink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(62) : error C2039: 'InMemoryOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(62) : error C2228: left of '.Blink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(62) : error C2227: left of '->Flink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(63) : error C2039: 'InMemoryOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(63) : error C2228: left of '.Flink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(64) : error C2039: 'InMemoryOrderModuleList' : is not a member of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(18) : see declaration of '_LDR_MODULE'
c:\documents and settings\cjf\cpp1.cpp(64) : error C2228: left of '.Flink' must have class/struct/union type
c:\documents and settings\cjf\cpp1.cpp(64) : error C2227: left of '->Blink' must point to class/struct/union
c:\documents and settings\cjf\cpp1.cpp(64) : fatal error C1003: error count exceeds 100; stopping compilation
执行 cl.exe 时出错.