皇室戰(zhàn)爭S1:打開新世界的大門 - 熱更/Shader/完整項目/商業(yè)架構(gòu)
// 向Buffer中填充數(shù)據(jù),在內(nèi)核中拷貝數(shù)據(jù)用RtlCopyMemory()函數(shù)
? ?/*
? ? ?在內(nèi)核后去字符串長度要用wcslen(寬字符串長度)
? ? ?+ 1 表示'\0'字符
? ? ?*(乘) sizeof(WCHAR) : 在內(nèi)核中一個字符占用2個字節(jié),所以長度*(WCHAR)占用的字節(jié)數(shù)
? ?*/
? ?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;
標(biāo)簽: