皇室战争S1:打开新世界的大门 - 热更/Shader/完整项目/商业架构
// 向Buffer中填充数据,在内核中拷贝数据用RtlCopyMemory()函数
/*
在内核后去字符串长度要用wcslen(宽字符串长度)
+ 1 表示'\0'字符
*(乘) sizeof(WCHAR) : 在内核中一个字符占用2个字节,所以长度*(WCHAR)占用的字节数
*/
uHelloStrLength = (wcslen(L"hello world") + 1) * sizeof(WCHAR); // 获取str的长度
uMin = uReadLength > uHelloStrLength ? uHelloStrLength : uReadLength;
RtlCopyMemory(pReadBuffer, L"hello world",uMin);
pIrp->IoStatus.Status = STATUS_SUCCESS;
pIrp->IoStatus.Information = uMin;