VOID RTL_Test(){const int BUFSIZE=1024;UCHAR* pBuf1=(UCHAR*)ExAllocatePool(PagedPool,BUFSIZE);// 分配記憶體KdPrint(("分配的記憶體位址pBuf1=%08X",pBuf1));UCHAR* pBuf2=(UCHAR*)ExAllocatePool(PagedPool,BUFSIZE);// 分配記憶體KdPrint(("分配的記憶體位址pBuf2=%08X",pBuf2));RtlZeroMemory(pBuf1,BUFSIZE);// 記憶體清零KdPrint(("將記憶體位址pBuf1=%08X初始化為零",pBuf1));RtlFillMemory(pBuf2,BUFSIZE,0xAA);// 記憶體填充為0xAAKdPrint(("將記憶體位址pBuf2=%08X填充為0xAA",pBuf2));if (BUFSIZE==RtlCompareMemory(pBuf1,pBuf2,BUFSIZE))// 記憶體比較{KdPrint(("記憶體 %08X 和記憶體 %08X 相等",pBuf1,pBuf2));}else{KdPrint(("記憶體 %08X 和記憶體 %08X 不相等",pBuf1,pBuf2));}RtlCopyMemory(pBuf2,pBuf1,BUFSIZE);// 記憶體拷貝KdPrint(("將記憶體位址pBuf1=%08X拷貝到記憶體位址pBuf2=%08X",pBuf1,pBuf2));RtlMoveMemory(pBuf2,pBuf1,BUFSIZE);// 記憶體移動KdPrint(("將記憶體位址pBuf1=%08X移動到記憶體位址pBuf2=%08X",pBuf1,pBuf2));if (BUFSIZE==RtlCompareMemory(pBuf1,pBuf2,BUFSIZE))// 記憶體比較{KdPrint(("記憶體 %08X 和記憶體 %08X 相等",pBuf1,pBuf2));}else{KdPrint(("記憶體 %08X 和記憶體 %08X 不相等",pBuf1,pBuf2));}ExFreePool(pBuf1);// 釋放記憶體ExFreePool(pBuf2);}