windows driver 分配内存

UNICODE_STRING str = {0};
	wchar_t strInfo[] = {L"马上就是光棍节了"};
	str.Buffer = (PWCHAR)ExAllocatePoolWithTag(NonPagedPool, ArrayLength, 'MY');
	str.Length = str.MaximumLength = (USHORT)wcslen(strInfo);
	RtlStringCbPrintfW(str.Buffer, ArrayLength, L"%ws", strInfo);
	KdPrint(("%ws\n", str.Buffer));
	ExFreePool(str.Buffer);
	str.Buffer = NULL;
	str.Length = str.MaximumLength = 0;

 

版权声明:本文为博主原创文章,未经博主允许不得转载。

 

posted @ 2014-11-13 20:20  QQ76211822  阅读(310)  评论(0编辑  收藏  举报