草庐IT

flAllocationType

全部标签

windows - 为什么当 flAllocationType = MEM_RESERVE 时 VirtualAlloc() 需要 flProtect = PAGE_NOACCESS?

以下对VirtualAlloc()的调用在x64上返回错误ERROR_INVALID_PARAMETER:LPVOIDlp=VirtualAlloc(NULL,0x10000000000,MEM_RESERVE,0);也就是说,我必须使用PAGE_NOACCESS作为VirtualAlloc的最后一个参数。但是当我查看PAGE_NOACCESShere的定义时,我发现:Disablesallaccesstothecommittedregionofpages.Anattempttoreadfrom,writeto,orexecutethecommittedregionresultsina