Re: Fastcode StrCopy B&V 2.0
From: Aleksandr Sharahov (alsha-on-mail333.com)
Date: 05/31/04
- Previous message: Aleksandr Sharahov: "Re: Fastcode StrCopy B&V 2.0"
- In reply to: Aleksandr Sharahov: "Re: Fastcode StrCopy B&V 2.0"
- Next in thread: Zinvob: "Re: Fastcode StrCopy B&V 2.0"
- Reply: Zinvob: "Re: Fastcode StrCopy B&V 2.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 May 2004 15:58:52 +0400
Some correctons:
procedure TForm1.Button1Click(Sender: TObject);
const
block= 4*1024;
var
protect: dword;
s: string;
p: pointer;
begin
SetLength(s,2*block);
FillChar(s[1],Length(s),0);
//make p points at the end of first part of s
p:=pointer(s);
integer(p):=(integer(p) and -block) + block - 1;
//protect the next block
VirtualProtect(pchar(p)+1,1,PAGE_NOACCESS,@protect);
try
ShowMessage(IntToStr(integer(p^)));
except
VirtualProtect(pchar(p)+1,1,protect,@protect);
end;
end;
- Previous message: Aleksandr Sharahov: "Re: Fastcode StrCopy B&V 2.0"
- In reply to: Aleksandr Sharahov: "Re: Fastcode StrCopy B&V 2.0"
- Next in thread: Zinvob: "Re: Fastcode StrCopy B&V 2.0"
- Reply: Zinvob: "Re: Fastcode StrCopy B&V 2.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|