Strings Delphi

Title: How to read the environemnt strings
procedure TForm1.Button1Click(Sender: TObject);
var
DosEnv: PChar;
begin
Memo1.Lines.Clear;
DosEnv := GetEnvironmentStrings;
while DosEnv^ #0 do
begin
Memo1.Lines.Add(StrPas(DosEnv));
Inc(DosEnv, lStrLen(DosEnv) + 1);
end;
FreeEnvironmentStrings(DosEnv);
end;