link2006 发表于 2016-5-18 23:46:55

返回UNICODE_STRING的问题

我想请教下大侠,这问题已经困扰我3天了。。。

在DispatchIoctl中,为何以下代码的数据返回不到应用层,直接蓝了?

pIoBuffer = pIrp->AssociatedIrp.SystemBuffer;
uOutSize = pIrpStack->Parameters.DeviceIoControl.OutputBufferLength;

UNICODE_STRING UnicodeString2 = { 0 };
UnicodeString2.Buffer = (PWSTR)ExAllocatePool(PagedPool, 4000);
UnicodeString2.MaximumLength = 4000;

//中间方法,给UnicodeString2做一些赋值操作

DbgPrint("len=%d,ttttttt=%S\n", UnicodeString2.Length, UnicodeString2.Buffer);
//上述Dbg能正常打印出长度和文本具体内容

uOutSize = UnicodeString2.Length;
RtlCopyMemory(pIoBuffer, UnicodeString2.Buffer, uOutSize);

但执行了最后2句,怎么都会蓝屏,就帮忙……

Tesla.Angela 发表于 2016-5-23 18:17:55

自己挂调试器调试啊。。。
页: [1]
查看完整版本: 返回UNICODE_STRING的问题