|
我想请教下大侠,这问题已经困扰我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句,怎么都会蓝屏,就帮忙…… |
|