资 源 简 介
program VirtualMemory {$APPTYPE CONSOLE} uses SysUtils, Windows const PageSize = 4096 //定义页面大小 var VmAddress, CommitAddress: Pointer //存放虚拟内存基址 Text: Pchar begin //保留二页虚拟内存 VmAddress := VirtualAlloc(nil, PageSize * 2, MEM_RESERVE, PAGE_READWRITE) if not Assigned(VmAddress) then begin WriteLn( 保留虚拟内存失败! ) ExitProcess(0) end else WriteLn(Format( 保留虚拟内存成功, 基址为:[%8.8x]! , [Longint(VmAddress)])) //提交第二页虚拟内存 CommitAddress := Pointer(Longint(VmAddress) + PageSize) CommitAddress := VirtualAlloc(CommitAddress, PageSize, MEM_COMMIT, PAGE_READWRITE) if not Assigne-program VirtualMemory ($ APPTYPE CONSOLE) uses SysUtils, Windows const PageSize = 4096// definition pages size var VmAddress, CommitAddress : Pointer// virtual memory-based storage site Text : Pchar begin// reservations two virtual memory VmAddress : = VirtualAlloc (nil. PageSize* 2, MEM_RESERVE, PAGE_READWRITE) if not Assigned (VmAddress) then begin WriteLn (reservations virtual memory failure!) ExitProcess (0) end else WriteLn (Format