*pBytesReturned = IMAGE_MEM_SIZE;
if (!VirtualCopy((void*)pOutBuf, (void *)(IMAGE_MEM_PA_START >> 8),IMAGE_MEM_SIZE,PAGE_PHYSICAL | PAGE_READWRITE | PAGE_NOCACHE))
{
RETAILMSG(1,(L"VirtualCopy is fault\r\n"));
break;
}
else
RETAILMSG(1,(L"VirtualCopy is OK\r\n"));
if (!CeSetMemoryAttributes((void *)pOutBuf, (void *)(IMAGE_MEM_PA_START>>8), IMAGE_MEM_SIZE, PAGE_PHYSICAL))
{
RETAILMSG(1,(L"CeSetMemoryAttributes is fault\r\n"));
}
else
RETAILMSG(1,(L"CeSetMemoryAttributes is OK\r\n"));
//CeOpenCallerBuffer((void**)pOutBuf,virtualMem,IMAGE_MEM_SIZE,ARG_IO_PTR, FALSE);
}
else
RETAILMSG(1,(L"VirtualAlloc is fault\r\n"));
break;
case IOCTL_VIRTUALMEM_FREE:
if (!VirtualFree(pOutBuf,0,MEM_RELEASE))
RETAILMSG(1,(L"VirtualFree is fault\r\n"));
break;
}