|
4鱼币
编译时出现错误
- extern "C"
- {
- #include <ntddk.h>//头文件
- }
- VOID DDK_delete (IN PDRIVER_OBJECT p) //卸载函数
- {
- DbgPrint("卸载成功");//调试信息
- }
- extern "C" int DriverEntry(PDRIVER_OBJECT p,PUNICODE_STRING t)//主函数
- {
- p->DriverUnload=DDK_delete; //调用卸载函数
- return 1;
- }
复制代码
错误信息
errors in directory c:\winddk
0.c(1) : error C2059: syntax error : 'string'
3790.1830\inc\ddk\w2k\ntddk.h(2087) : error C2059: syntax error : 'bad suffix on
number'
0.c(5) : error C2146: syntax error : missing ')' before identifier 'p'
0.c(5) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown
>'
0.c(5) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown
>'
0.c(5) : error C2143: syntax error : missing ')' before 'identifier'
0.c(5) : error C2061: syntax error : identifier 'p'
0.c(5) : error C2059: syntax error : ';'
0.c(5) : error C2059: syntax error : ')'
0.c(6) : error C2449: found '{' at file scope (missing function header?)
0.c(8) : error C2059: syntax error : '}'
BUILD: Compile errors: not linking c:\winddk directory
BUILD: Done
2 files compiled - 11 Errors
那里错了
|
|