- removed: startupheapend, it's unused

- fixed calling convention which fixes startup crash
- cleaner implementation GetEnv, GetEnvironmentStrings is deprecated

git-svn-id: trunk@5396 -
This commit is contained in:
micha 2004-04-11 10:15:58 +00:00
parent 915d4573eb
commit 5c6cbc475a

View File

@ -868,7 +868,6 @@ var
{$ifdef win32} {$ifdef win32}
var var
StartUpHeapEnd : pointer;
{ I found no symbol for start of text section :( { I found no symbol for start of text section :(
so we usee the _mainCRTStartup which should be so we usee the _mainCRTStartup which should be
in wprt0.ow or wdllprt0.ow PM } in wprt0.ow or wdllprt0.ow PM }
@ -1179,9 +1178,6 @@ begin
{$ifdef go32v2} {$ifdef go32v2}
Heap_at_init:=HeapPtr; Heap_at_init:=HeapPtr;
{$endif} {$endif}
{$ifdef win32}
StartupHeapEnd:=HeapEnd;
{$endif}
end; end;
@ -1217,32 +1213,26 @@ begin
end; end;
{$ifdef win32} {$ifdef win32}
function GetEnvironmentStrings : pchar;
external 'kernel32' name 'GetEnvironmentStringsA'; {$h+}
function FreeEnvironmentStrings(p : pchar) : longbool;
external 'kernel32' name 'FreeEnvironmentStringsA'; function GetEnvironmentVariable(lpName: pchar; lpBuffer: pchar; nSize: dword) : dword; stdcall;
external 'kernel32' name 'GetEnvironmentVariableA';
function FreeEnvironmentStrings(p : pchar) : longbool; stdcall;
external 'kernel32' name 'FreeEnvironmentStringsA';
Function GetEnv(envvar: string): string; Function GetEnv(envvar: string): string;
var var
s : string; len : longint;
i : longint;
hp,p : pchar;
begin begin
getenv:=''; len := GetEnvironmentVariable(pchar(envvar), nil, 0);
p:=GetEnvironmentStrings; if len = 0 then
hp:=p; begin
while hp^<>#0 do getenv := ''
begin end else begin
s:=strpas(hp); { len includes null-terminator }
i:=pos('=',s); SetLength(getenv, len-1);
if upcase(copy(s,1,i-1))=upcase(envvar) then GetEnvironmentVariable(pchar(envvar), pchar(getenv), len);
begin end;
getenv:=copy(s,i+1,length(s)-i);
break;
end;
{ next string entry}
hp:=hp+strlen(hp)+1;
end;
FreeEnvironmentStrings(p);
end; end;
{$else} {$else}
Function GetEnv(P:string):Pchar; Function GetEnv(P:string):Pchar;
@ -2568,6 +2558,11 @@ end.
{ {
$Log$ $Log$
Revision 1.30 2004/04/11 10:15:58 micha
- removed: startupheapend, it's unused
- fixed calling convention which fixes startup crash
- cleaner implementation GetEnv, GetEnvironmentStrings is deprecated
Revision 1.29 2004/02/21 01:01:02 mattias Revision 1.29 2004/02/21 01:01:02 mattias
added uninstall popupmenuitem to package graph explorer added uninstall popupmenuitem to package graph explorer