阅读:1703回复:8
RtlInitEmptyUnicodeString函数到底在哪里啊?DDK中找不到
我找遍了DDK也没有发现这个函数声明啊,我的代码是这样的,编译通不过
NTSYSAPI VOID RtlInitEmptyUnicodeString( IN OUT PUNICODE_STRING DestinationString, IN PCWSTR Buffer, IN USHORT BufferSize); 。。。 PDEVICE_EXTENSION DevEx = OurDevice->DeviceExtension; RtlInitEmptyUnicodeString( &DevEx->DeviceName, DevEx->DeviceNameBuffer, sizeof(DevEx->DeviceNameBuffer)); SfGetObjectName(AttachedDevice, &DevEx->DeviceName); Test.obj : error LNK2001: unresolved external symbol __imp__RtlInitEmptyUnicodeString@12 |
|
沙发#
发布于:2007-09-14 09:11
下个 WinXP DDK SP1,即 2600.1106 就有了
|
|
板凳#
发布于:2007-09-03 11:26
呵,这样写当然可以了,不过还是定义下为好,毕竟其它地方要用,方便多了
|
|
地板#
发布于:2007-08-31 21:08
哦 那还不就是
DevEx->DeviceName.Length = 0; DevEx->DeviceName.MaximumLength = sizeof(DevEx->DeviceNameBuffer); DevEx->DeviceName.Buffer = DevEx->DeviceNameBuffer; |
|
地下室#
发布于:2007-08-31 15:21
这个函数只在XP和之后的系统里才有,ntifs.h头文件里有定义
如果在2000下使用的话,还是自己定义吧 #if WINVER == 0x0500 #define RtlInitEmptyUnicodeString(_ucStr,_buf,_bufSize) \ ((_ucStr)->Buffer = (_buf), \ (_ucStr)->Length = 0, \ (_ucStr)->MaximumLength = (USHORT)(_bufSize)) #endif |
|
5楼#
发布于:2007-08-31 09:37
自己翻译看吧。
|
|
6楼#
发布于:2007-08-31 09:35
Windows Driver Kit: Kernel-Mode Driver Architecture
RtlInitEmptyUnicodeString The RtlInitEmptyUnicodeString macro initializes an empty counted Unicode string. VOID RtlInitEmptyUnicodeString( IN OUT PUNICODE_STRING DestinationString, IN PCWSTR Buffer, IN USHORT BufferSize ); Parameters DestinationString Pointer to the UNICODE_STRING structure to be initialized. Buffer Pointer to a caller-allocated buffer to be used to contain a WCHAR string. BufferSize Length, in bytes, of the buffer that Buffer points to. Return Value None. Comments The members of the structure that the DestinationString parameters points to are initialized as follows. Member Value Length Zero MaximumLength BufferSize Buffer SourceString To initialize a non-empty counted Unicode string, call RtlInitUnicodeString. Callers of RtlInitEmptyUnicodeString can be running at any IRQL. Requirements Versions: Available on Microsoft Windows XP and later operating systems. Headers: Declared in wdm.h. Include wdm.h. See Also RtlInitUnicodeString, UNICODE_STRING |
|
7楼#
发布于:2007-08-24 16:28
发现这里基本没有什么人回答问题啊,真是失败
难怪都说驱动开发难搞,书好少,论坛人也不怎么回答你问题,好郁闷啊 莫非是我RPWT??? |
|
8楼#
发布于:2007-08-23 17:47
郁闷啊,google都找不到估计是自己写的吧???不是系统自己的
时不时我这样写就可以了啊?提示一下啊 DevEx->DeviceName.Length = 0; DevEx->DeviceName.MaximumLength = sizeof(DevEx->DeviceNameBuffer); DevEx->DeviceName.Buffer = DevEx->DeviceNameBuffer; |
|