阅读:4204回复:23
一个不明白的调试错误,请高手帮忙
我调用NDISRegester()函数注册一个新协议栈,在Win2000DDK下build,结果出来如下错误:
wdmdriver.cpp(112) : error C2039: \'BindAdapterHandler\' : is not a member of \'_NDIS30_PROTOCOL_CHARACTERISTICS\' wdmdriver.cpp(113) : error C2039: \'UnbindAdapterHandler\' : is not a member of \'_NDIS30_PROTOCOL_CHARACTERISTICS\' wdmdriver.cpp(114) : error C2039: \'UnloadHandler\' : is not a member of \'_NDIS30_PROTOCOL_CHARACTERISTICS\' wdmdriver.cpp(115) : error C2039: \'ReceivePacketHandler\' : is not a member of \'_NDIS30_PROTOCOL_CHARACTERISTICS\' wdmdriver.cpp(116) : error C2039: \'PnPEventHandler\' : is not a member of \'_NDIS30_PROTOCOL_CHARACTERISTICS\' win2000DDK下显示的是_NDIS50_PROTOCOL_CHARACTERISTICS\'而不是 _NDIS30_PROTOCOL_CHARACTERISTICS\',我觉得很怪,那位大虾知道这个问题指点一下,万分感谢,20分酬谢 |
|
|
沙发#
发布于:2003-02-25 10:32
你用的是什么版本的ddk?还有代码,_NDIS30_PROTOCOL_CHARACTERISTICS里面没有那些成员的,编译肯定错误。
如果你在2k上使用就定义宏ndis50或者ndis40也行,在mak文件里面, 或者直接使用NDIS40_PROTOCOL_CHARACTERISTICS或者NDIS50_PROTOCOL_CHARACTERISTICS |
|
|
板凳#
发布于:2003-02-25 13:45
你用的是什么版本的ddk?还有代码,_NDIS30_PROTOCOL_CHARACTERISTICS里面没有那些成员的,编译肯定错误。 非常感谢你的回答,我已经知道错在哪里了,不过分还是照送给你,请接收 |
|
|
地板#
发布于:2003-02-25 13:52
你用的是什么版本的ddk?还有代码,_NDIS30_PROTOCOL_CHARACTERISTICS里面没有那些成员的,编译肯定错误。 分已经给了,不过还有一个问题,我调用 NdisRegisterProtocol( &status, &DevExt.NdisProtocolHandle, &protocolChar, sizeof( NDIS_PROTOCOL_CHARACTERISTICS)); 时候,编译报了一个这样的错误 error C2664: \'NdisRegisterProtocol\' : cannot convert parameter 1 from \'long *\' to \'int *\' 不知道这是为什么! |
|
|
地下室#
发布于:2003-02-25 14:10
你的第一个参数是怎么声明的?用NDIS_STATUS就可以了
|
|
|
5楼#
发布于:2003-02-25 14:37
你的第一个参数是怎么声明的?用NDIS_STATUS就可以了 我的参数申明的就是NDIS_STATUS status = STATUS_SUCCESS; 还有一个地方也就是open = DeviceObject->DeviceExtension; 这个地方报了一个initializing\' : cannot convert from \'void *\' to \'struct OPEN_INSTANCE *\'的错误,我看packet程序里面它也是这么用的,不知道什么地方错了。 请再次出手指点,20分奉送 |
|
|
6楼#
发布于:2003-02-25 15:50
你的open声明的不对吧
packet里面的是POPEN_INSTANCE open; 或者是你包含的头文件不对? |
|
|
7楼#
发布于:2003-02-25 17:29
你的open声明的不对吧 我的申明和头文件都没错,不过如果我对open = (POPEN_INSTANCE)DeviceObject->DeviceExtension;进行强制转换就没问题了,但是不知道这样转换过来后会不会引起其他值的改变。 |
|
|
8楼#
发布于:2003-02-25 20:38
编译器说你的是一个 void *
这样强制转换可以的 |
|
|
9楼#
发布于:2003-02-25 23:37
编译器说你的是一个 void * 谢谢mikeluo的指点,我的编译已经全部通过了,可是连接的时候出现了如下错误: wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall ExFreePool(void *)\" (__imp_?ExFreePool@@YGXPAX@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall ExFreePool(void *)\" (__imp_?ExFreePool@@YGXPAX@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoDeleteSymbolicLink(struct _UNICODE_STRING *)\" (__imp_?IoDeleteSymbolicLink@@YGJPAU_UNICODE_STRING@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoDeleteSymbolicLink(struct _UNICODE_STRING *)\" (__imp_?IoDeleteSymbolicLink@@YGJPAU_UNICODE_STRING@@@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoDeleteDevice(struct _DEVICE_OBJECT *)\" (__imp_?IoDeleteDevice@@YGXPAU_DEVICE_OBJECT@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoDeleteDevice(struct _DEVICE_OBJECT *)\" (__imp_?IoDeleteDevice@@YGXPAU_DEVICE_OBJECT@@@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisRegisterProtocol(int *,void * *,struct _NDIS50_PROTOCOL_CHARACTERISTICS *,unsigned int)\" (__imp_?NdisRegisterProtocol@@YGXPAHPAPAXPAU_NDIS50_PROTOCOL_CHARACTERISTICS@@I@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall KeInitializeSpinLock(unsigned long *)\" (__imp_?KeInitializeSpinLock@@YGXPAK@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall KeInitializeSpinLock(unsigned long *)\" (__imp_?KeInitializeSpinLock@@YGXPAK@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoCreateSymbolicLink(struct _UNICODE_STRING *,struct _UNICODE_STRING *)\" (__imp_?IoCreateSymbolicLink@@YGJPAU_UNICODE_STRING@@0@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoCreateSymbolicLink(struct _UNICODE_STRING *,struct _UNICODE_STRING *)\" (__imp_?IoCreateSymbolicLink@@YGJPAU_UNICODE_STRING@@0@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoCreateDevice(struct _DRIVER_OBJECT *,unsigned long,struct _UNICODE_STRING *,unsigned long,unsigned long,unsigned char,struct _DEVICE_OBJECT * *)\" (__imp_?IoCreateDevice@@YGJPAU_DRIVER_OBJECT@@KPAU_UNICODE_STRING@@KKEPAPAU_DEVICE_OBJECT@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoCreateDevice(struct _DRIVER_OBJECT *,unsigned long,struct _UNICODE_STRING *,unsigned long,unsigned long,unsigned char,struct _DEVICE_OBJECT * *)\" (__imp_?IoCreateDevice@@YGJPAU_DRIVER_OBJECT@@KPAU_UNICODE_STRING@@KKEPAPAU_DEVICE_OBJECT@@@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall RtlInitUnicodeString(struct _UNICODE_STRING *,unsigned short const *)\" (__imp_?RtlInitUnicodeString@@YGXPAU_UNICODE_STRING@@PBG@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall RtlInitUnicodeString(struct _UNICODE_STRING *,unsigned short const *)\" (__imp_?RtlInitUnicodeString@@YGXPAU_UNICODE_STRING@@PBG@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall RtlCopyUnicodeString(struct _UNICODE_STRING *,struct _UNICODE_STRING *)\" (__imp_?RtlCopyUnicodeString@@YGXPAU_UNICODE_STRING@@0@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void * __stdcall ExAllocatePoolWithTag(enum _POOL_TYPE,unsigned long,unsigned long)\" (__imp_?ExAllocatePoolWithTag@@YGPAXW4_POOL_TYPE@@KK@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void * __stdcall ExAllocatePoolWithTag(enum _POOL_TYPE,unsigned long,unsigned long)\" (__imp_?ExAllocatePoolWithTag@@YGPAXW4_POOL_TYPE@@KK@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"unsigned long __cdecl DbgPrint(char *,...)\" (?DbgPrint@@YAKPADZZ) protocol.obj() : error LNK2001: unresolved external symbol \"unsigned long __cdecl DbgPrint(char *,...)\" (?DbgPrint@@YAKPADZZ) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall ZwClose(void *)\" (__imp_?ZwClose@@YGJPAX@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall ZwQueryValueKey(void *,struct _UNICODE_STRING *,enum _KEY_VALUE_INFORMATION_CLASS,void *,unsigned long,unsigned long *)\" (__imp_?ZwQueryValueKey@@YGJPAXPAU_UNICODE_STRING@@W4_KEY_VALUE_INFORMATION_CLASS@@0KPAK@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall RtlAppendUnicodeToString(struct _UNICODE_STRING *,unsigned short const *)\" (__imp_?RtlAppendUnicodeToString@@YGJPAU_UNICODE_STRING@@PBG@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall ZwEnumerateKey(void *,unsigned long,enum _KEY_INFORMATION_CLASS,void *,unsigned long,unsigned long *)\" (__imp_?ZwEnumerateKey@@YGJPAXKW4_KEY_INFORMATION_CLASS@@0KPAK@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall ZwOpenKey(void * *,unsigned long,struct _OBJECT_ATTRIBUTES *)\" (__imp_?ZwOpenKey@@YGJPAPAXKPAU_OBJECT_ATTRIBUTES@@@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisDeregisterProtocol(int *,void *)\" (__imp_?NdisDeregisterProtocol@@YGXPAHPAX@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __fastcall IofCompleteRequest(struct _IRP *,char)\" (__imp_?IofCompleteRequest@@YIXPAU_IRP@@D@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __fastcall IofCompleteRequest(struct _IRP *,char)\" (__imp_?IofCompleteRequest@@YIXPAU_IRP@@D@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) struct _LIST_ENTRY * __fastcall ExfInterlockedInsertTailList(struct _LIST_ENTRY *,struct _LIST_ENTRY *,unsigned long *)\" (__imp_?ExfInterlockedInsertTailList@@YIPAU_LIST_ENTRY@@PAU1@0PAK@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) struct _LIST_ENTRY * __fastcall ExfInterlockedInsertTailList(struct _LIST_ENTRY *,struct _LIST_ENTRY *,unsigned long *)\" (__imp_?ExfInterlockedInsertTailList@@YIPAU_LIST_ENTRY@@PAU1@0PAK@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __fastcall InterlockedExchange(long *,long)\" (__imp_?InterlockedExchange@@YIJPAJJ@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __fastcall InterlockedExchange(long *,long)\" (__imp_?InterlockedExchange@@YIJPAJJ@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisAllocatePacket(int *,struct _NDIS_PACKET * *,void *)\" (__imp_?NdisAllocatePacket@@YGXPAHPAPAU_NDIS_PACKET@@PAX@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) unsigned char __stdcall NdisWaitEvent(struct _NDIS_EVENT *,unsigned int)\" (__imp_?NdisWaitEvent@@YGEPAU_NDIS_EVENT@@I@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) unsigned char __stdcall NdisWaitEvent(struct _NDIS_EVENT *,unsigned int)\" (__imp_?NdisWaitEvent@@YGEPAU_NDIS_EVENT@@I@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisResetEvent(struct _NDIS_EVENT *)\" (__imp_?NdisResetEvent@@YGXPAU_NDIS_EVENT@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisResetEvent(struct _NDIS_EVENT *)\" (__imp_?NdisResetEvent@@YGXPAU_NDIS_EVENT@@@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __fastcall InterlockedIncrement(long *)\" (__imp_?InterlockedIncrement@@YIJPAJ@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisSetEvent(struct _NDIS_EVENT *)\" (__imp_?NdisSetEvent@@YGXPAU_NDIS_EVENT@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisSetEvent(struct _NDIS_EVENT *)\" (__imp_?NdisSetEvent@@YGXPAU_NDIS_EVENT@@@Z) wdmdriver.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __fastcall InterlockedDecrement(long *)\" (__imp_?InterlockedDecrement@@YIJPAJ@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisFreePacket(struct _NDIS_PACKET *)\" (__imp_?NdisFreePacket@@YGXPAU_NDIS_PACKET@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoFreeMdl(struct _MDL *)\" (__imp_?IoFreeMdl@@YGXPAU_MDL@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"void __stdcall DbgBreakPoint(void)\" (?DbgBreakPoint@@YGXXZ) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) struct _LIST_ENTRY * __fastcall ExfInterlockedRemoveHeadList(struct _LIST_ENTRY *,unsigned long *)\" (__imp_?ExfInterlockedRemoveHeadList@@YIPAU_LIST_ENTRY@@PAU1@PAK@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoBuildPartialMdl(struct _MDL *,struct _MDL *,void *,unsigned long)\" (__imp_?IoBuildPartialMdl@@YGXPAU_MDL@@0PAXK@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) struct _MDL * __stdcall IoAllocateMdl(void *,unsigned long,unsigned char,unsigned char,struct _IRP *)\" (__imp_?IoAllocateMdl@@YGPAU_MDL@@PAXKEEPAU_IRP@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void * __stdcall MmMapLockedPagesSpecifyCache(struct _MDL *,char,enum _MEMORY_CACHING_TYPE,void *,unsigned long,enum _MM_PAGE_PRIORITY)\" (__imp_?MmMapLockedPagesSpecifyCache@@YGPAXPAU_MDL@@DW4_MEMORY_CACHING_TYPE@@PAXKW4_MM_PAGE_PRIORITY@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisFreePacketPool(void *)\" (__imp_?NdisFreePacketPool@@YGXPAX@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) int __stdcall NdisQueryAdapterInstanceName(struct _UNICODE_STRING *,void *)\" (__imp_?NdisQueryAdapterInstanceName@@YGHPAU_UNICODE_STRING@@PAX@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisOpenAdapter(int *,int *,void * *,unsigned int *,enum _NDIS_MEDIUM *,unsigned int,void *,void *,struct _UNICODE_STRING *,unsigned int,struct _STRING *)\" (__imp_?NdisOpenAdapter@@YGXPAH0PAPAXPAIPAW4_NDIS_MEDIUM@@IPAX4PAU_UNICODE_STRING@@IPAU_STRING@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisInitializeEvent(struct _NDIS_EVENT *)\" (__imp_?NdisInitializeEvent@@YGXPAU_NDIS_EVENT@@@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisAllocatePacketPool(int *,void * *,unsigned int,unsigned int)\" (__imp_?NdisAllocatePacketPool@@YGXPAHPAPAXII@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisFreeMemory(void *,unsigned int,unsigned int)\" (__imp_?NdisFreeMemory@@YGXPAXII@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __fastcall KfReleaseSpinLock(unsigned long *,unsigned char)\" (__imp_?KfReleaseSpinLock@@YIXPAKE@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) unsigned char __fastcall KfAcquireSpinLock(unsigned long *)\" (__imp_?KfAcquireSpinLock@@YIEPAK@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall RtlAssert(void *,void *,unsigned long,char *)\" (__imp_?RtlAssert@@YGXPAX0KPAD@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisCloseAdapter(int *,void *)\" (__imp_?NdisCloseAdapter@@YGXPAHPAX@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall NdisCopyFromPacketToPacket(struct _NDIS_PACKET *,unsigned int,unsigned int,struct _NDIS_PACKET *,unsigned int,unsigned int *)\" (__imp_?NdisCopyFromPacketToPacket@@YGXPAU_NDIS_PACKET@@II0IPAI@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoReleaseCancelSpinLock(unsigned char)\" (__imp_?IoReleaseCancelSpinLock@@YGXE@Z) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) unsigned char __stdcall KeGetCurrentIrql(void)\" (__imp_?KeGetCurrentIrql@@YGEXZ) protocol.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __fastcall KefAcquireSpinLockAtDpcLevel(unsigned long *)\" (__imp_?KefAcquireSpinLockAtDpcLevel@@YIXPAK@Z) packet32.obj() : error LNK2001: unresolved external symbol __afxForceEXCLUDE packet32.obj() : error LNK2001: unresolved external symbol __imp__GlobalLock@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__GlobalAlloc@8 packet32.obj() : error LNK2001: unresolved external symbol __imp__GlobalFree@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__GlobalUnlock@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__GlobalHandle@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__GetLastError@0 packet32.obj() : error LNK2001: unresolved external symbol __imp__CreateFileA@28 packet32.obj() : error LNK2001: unresolved external symbol __imp__wsprintfA packet32.obj() : error LNK2001: unresolved external symbol __imp__CloseHandle@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__CreateEventA@16 packet32.obj() : error LNK2001: unresolved external symbol __imp__GetOverlappedResult@16 packet32.obj() : error LNK2001: unresolved external symbol __imp__WriteFile@20 packet32.obj() : error LNK2001: unresolved external symbol __imp__ResetEvent@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__ReadFile@20 packet32.obj() : error LNK2001: unresolved external symbol __imp__DeviceIoControl@32 packet32.obj() : error LNK2001: unresolved external symbol __imp__CloseServiceHandle@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__Sleep@4 packet32.obj() : error LNK2001: unresolved external symbol __imp__QueryServiceStatus@8 packet32.obj() : error LNK2001: unresolved external symbol __imp__StartServiceA@12 packet32.obj() : error LNK2001: unresolved external symbol __imp__OpenServiceA@12 packet32.obj() : error LNK2001: unresolved external symbol __imp__MessageBoxA@16 packet32.obj() : error LNK2001: unresolved external symbol __imp__OpenSCManagerA@12 packet32.obj() : error LNK2001: unresolved external symbol __imp__ControlService@12 objchk\\i386\\wdmdriver.sys() : error LNK1120: 71 unresolved externals 我不知道是怎么回事,请指点,还是20分奉送,明天开新帖给分 |
|
|
10楼#
发布于:2003-02-26 09:53
包含的库不对。
你的makefile和source文件是什么样的?包含了那些头文件? |
|
|
11楼#
发布于:2003-02-26 15:17
包含的库不对。 这是我的source文件: TARGETNAME=wdmdriver TARGETTYPE=DRIVER TARGETPATH=obj TARGETLIBS=$(DDK_LIB_PATH)\\ndis.lib C_DEFINES=$(C_DEFINES) -DNDIS50 INCLUDES=..\\..\\inc;..\\inc; SOURCES=wdmdriver.cpp\\ Protocol.cpp\\ packet32.cpp\\ 这是我的makefile文件: # # DO NOT EDIT THIS FILE!!! Edit .\\sources. if you want to add a new source # file to this component. This file merely indirects to the real make file # that is shared by all the driver components of the Windows NT DDK # !INCLUDE $(NTMAKEENV)\\makefile.def |
|
|
12楼#
发布于:2003-02-26 15:35
你在wdmdriver.c和protocvol.c里面都包含了那些头文件??这个问题肯定是什么头文件有问题了。
|
|
|
13楼#
发布于:2003-02-26 16:04
我提一点建议:
我看你还是换成C语言写wdmdriver.cpp这些东东吧,这肯能是一个 C与VC函数名处理的问题,这些内核函数是C语言写的,而你用在了 VC中,要用也得加extern \"c\",看着办吧 |
|
14楼#
发布于:2003-02-26 16:12
我提一点建议: extern \"c\"我是加了,也有可能是这个问题,我换成c写试一下 |
|
|
15楼#
发布于:2003-02-26 16:20
你在wdmdriver.c和protocvol.c里面都包含了那些头文件??这个问题肯定是什么头文件有问题了。 我的windrive.c里面包括的头文件是: #include <stdio.h> #include <ntddk.h> #include \"wdmdriver.h\" #include \"ntddpack.h\" #define BINARY_COMPATIBLE 0 #define NDIS_WDM 1 #include <ndis.h> protocol.c包括的头文件是: #include \"ntddk.h\" #include \"ndis.h\" //#include <basetsd.h> #include \"ntddpack.h\" #include \"wdmdriver.h\" #include \"stdio.h\" 不知道那个头文件出错了 |
|
|
16楼#
发布于:2003-02-26 16:35
你把文件名该成.c的试试,为什么用.cpp?
|
|
|
17楼#
发布于:2003-02-26 16:42
你把文件名该成.c的试试,为什么用.cpp? 我想.c和.cpp只是在填写NDIS_PROTOCOL_CHARACTERISTICS这张表时有点区别而已吧,我是这样填写的: protocolChar.Ndis40Chars.Ndis30Chars.MajorNdisVersion=5; protocolChar.Ndis40Chars.Ndis30Chars.MinorNdisVersion=0; protocolChar.Ndis40Chars.Ndis30Chars.Name = protoName; protocolChar.Ndis40Chars.Ndis30Chars.OpenAdapterCompleteHandler = WDMOpenAdapterComplete; protocolChar.Ndis40Chars.Ndis30Chars.CloseAdapterCompleteHandler = WDMCloseAdapterComplete; protocolChar.Ndis40Chars.Ndis30Chars.SendCompleteHandler = WDMSendComplete; protocolChar.Ndis40Chars.Ndis30Chars.TransferDataCompleteHandler = WDMTransferDataComplete; protocolChar.Ndis40Chars.Ndis30Chars.ResetCompleteHandler = WDMResetComplete; protocolChar.Ndis40Chars.Ndis30Chars.RequestCompleteHandler = WDMRequestComplete; protocolChar.Ndis40Chars.Ndis30Chars.ReceiveHandler = WDMReceiveIndicate; protocolChar.Ndis40Chars.Ndis30Chars.ReceiveCompleteHandler = WDMReceiveComplete; protocolChar.Ndis40Chars.Ndis30Chars.StatusHandler = WDMStatus; protocolChar.Ndis40Chars.Ndis30Chars.StatusCompleteHandler = WDMStatusComplete; protocolChar.Ndis40Chars.BindAdapterHandler = WDMBindAdapter; protocolChar.Ndis40Chars.UnbindAdapterHandler = WDMUnbindAdapter; protocolChar.Ndis40Chars.UnloadHandler = NULL; protocolChar.Ndis40Chars.ReceivePacketHandler = WDMReceivePacket; protocolChar.Ndis40Chars.PnPEventHandler = WDMPNPHandler; 这应该没错的,我看过ndis.h里面对它的定义 |
|
|
18楼#
发布于:2003-02-26 16:52
怎么会和这个有关系? |
|
|
19楼#
发布于:2003-02-26 16:59
还有,你的protocol和wdmdriver的两个文件里面的函数好像都是一样的吧???完成同样的功能的?
|
|
|
上一页
下一页