我的源代码如下:
procedure TForm1.Button1Click(Sender: TObject);
var
dz:pointer;
lp:MEMORY_BASIC_INFORMATION;
h:thandle;
b:bool;
c:integer;
pid:integer;
begin
dz:=pchar($400000);
Virtualquery(dz,lp,sizeof(lp));
b:=VirtualProtect(dz,lp.RegionSize,PAGE_NOACCESS,lp.AllocationProtect);
edit1.text:=inttostr(getlasterror);
if b then
begin
showmessage('yes');
end
else
begin
showmessage('no');
end;
end;
请教下各位高手这里我把地址设为400000时运行正常,可为什么当我将地址改为411111或其它值时程序就出错了呢?