阅读:1521回复:3
为何在passthru中加入RtlInitUnicodeString、IoCreateDevice等编译不过
我想在passthru中加入和应用程序通信的代码,仿照packet中的加入IoCreateDevice等代码,但是编译不过,如下:
assthru.c(81) : error C4013: 'RtlInitUnicodeString' undefined; assuming extern returning int passthru.c(83) : error C4013: 'IoCreateDevice' undefined; assuming extern returning int 我包含了ntddk.h头文件啊,是版本问题吗,敬请指点 :P [编辑 - 9/19/04 by birdtomaster] |
|
沙发#
发布于:2004-09-18 13:52
define in wdm.h or ntddk.h
这两个中都有定义,试一试wdm.h |
|
|
板凳#
发布于:2004-09-19 13:18
define in wdm.h or ntddk.h #include "iocontrol.h" #include "ntddk.h" #include "wdm.h" #include "ndis.h" #include "stdio.h" ... driverentry()... NTSTATUS Status = STATUS_SUCCESS; WCHAR deviceNameBuffer[] = L"\Device\passthru"; WCHAR deviceLinkBuffer[] = L"\DosDevices\passthru"; UNICODE_STRING ntDeviceName; UNICODE_STRING win32DeviceName; BOOLEAN fSymbolicLink = FALSE; PDEVICE_OBJECT deviceObject; NdisInitUnicodeString( &ntDeviceName, deviceNameBuffer); Status = IoCreateDevice (DriverObject, 0, &ntDeviceName, FILE_DEVICE_PASSTHRU, 0, TRUE, &deviceObject); 用NdisInitUnicodeString行,用RtlInitUnicodeString就不行,但是IoCreateDevice始终显示是没有定义函数,还有几个也这样,ddk帮助文档里面好像说NDIS里面不能用IoCreateDevice,NDIS drivers should never call IoCreateDevice or IoCreateSymbolicLink. Instead, if an NDIS driver must create a device object, it should call NdisMRegisterDevice. 但是packet例程里面就用了,没有问题啊? |
|
地板#
发布于:2005-07-26 15:45
我也遇到到相同的问题
|
|