阅读:773回复:0
protocol driver 程序 compile error 的问题
小弟刚入门 DDK, 想写一个能够分析封包内容的程序, 看了一下文件好像得从 protocol driver 下手, 于是写了一个测试用的程序, 没想到compile error
想请问各位先进们, 小弟错在哪里呢? 附上小弟的原码和 compile error message, 望各位先进们指教, 或是能否告诉小弟一个简单的 protocol driver 撰写范例? 只要能够拦截到封包即可, 谢谢! =========== 原码: =========== #include <stdio.h> #include <ndis.h> #include <ndisuio.h> VOID __cdecl main( INT argc, CHAR *argv[] ) { NDIS_STATUS Status = NDIS_STATUS_SUCCESS; NDIS_HANDLE NdisProtocolHandle = NULL; NDIS_PROTOCOL_CHARACTERISTICS PChars; NdisZeroMemory(&PChars, sizeof(NDIS_PROTOCOL_CHARACTERISTICS)); PChars.MajorNdisVersion = 5; PChars.MinorNdisVersion = 5; NdisRegisterProtocol(&Status, &NdisProtocolHandle, &PChars, sizeof(NDIS_PROTOCOL_CHARACTERISTICS)); printf(\"TEST\\n\"); } ===================== compile error message: ===================== BUILD: Object root set to: ==> objfre BUILD: Adding /Y to COPYCMD so xcopy ops won\'t hang. BUILD: /i switch ignored BUILD: Compile and Link for i386 BUILD: Examining e:\\winddk\\2600\\src\\network\\ndis\\mytest directory tree for files to compile. BUILD: Compiling e:\\winddk\\2600\\src\\network\\ndis\\mytest\\driver directory Compiling - driver\\uiotest.c for i386 BUILD: Linking e:\\winddk\\2600\\src\\network\\ndis\\mytest\\driver directory Linking Executable - driver\\objfre\\i386\\uiotest.exe for i386 driver\\uiotest.obj() : error LNK2019: unresolved external symbol __imp__NdisRegi sterProtocol@16 referenced in function _main driver\\objfre\\i386\\uiotest.exe() : error LNK1120: 1 unresolved externals BUILD: Done 2 files compiled 1 executable built - 2 Errors |
|