mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 13:29:29 +02:00
* win32/system.pp, win64/system.pp: Moved duplicated declarations of WinAPI functions to sysos.inc (Florian's comment about include ordering is no longer true, wstrings.inc comes after sysos.inc these days).
* Result of GetCurrentProcess and first argument of ReadProcessMemory are THandle, not dword. git-svn-id: trunk@19726 -
This commit is contained in:
parent
c17d15cf72
commit
32094761ef
@ -211,6 +211,13 @@ threadvar
|
|||||||
|
|
||||||
function Win32GetCurrentThreadId:DWORD;
|
function Win32GetCurrentThreadId:DWORD;
|
||||||
stdcall; external KernelDLL name 'GetCurrentThreadId';
|
stdcall; external KernelDLL name 'GetCurrentThreadId';
|
||||||
|
|
||||||
|
function GetCurrentProcess : THandle;
|
||||||
|
stdcall;external 'kernel32' name 'GetCurrentProcess';
|
||||||
|
|
||||||
|
function ReadProcessMemory(process : THandle;address : pointer;dest : pointer;size : dword;bytesread : pdword) : longbool;
|
||||||
|
stdcall;external 'kernel32' name 'ReadProcessMemory';
|
||||||
|
|
||||||
{$endif WINCE}
|
{$endif WINCE}
|
||||||
|
|
||||||
{ module functions }
|
{ module functions }
|
||||||
@ -267,6 +274,12 @@ threadvar
|
|||||||
function GetConsoleOutputCP : UINT;
|
function GetConsoleOutputCP : UINT;
|
||||||
stdcall; external KernelDLL name 'GetConsoleOutputCP';
|
stdcall; external KernelDLL name 'GetConsoleOutputCP';
|
||||||
|
|
||||||
|
function SysAllocStringLen(psz:pointer;len:dword):pointer;
|
||||||
|
stdcall; external 'oleaut32.dll' name 'SysAllocStringLen';
|
||||||
|
procedure SysFreeString(bstr:pointer);
|
||||||
|
stdcall; external 'oleaut32.dll' name 'SysFreeString';
|
||||||
|
function SysReAllocStringLen(var bstr:pointer;psz: pointer;
|
||||||
|
len:dword): Integer; stdcall;external 'oleaut32.dll' name 'SysReAllocStringLen';
|
||||||
{$endif WINCE}
|
{$endif WINCE}
|
||||||
|
|
||||||
Procedure Errno2InOutRes;
|
Procedure Errno2InOutRes;
|
||||||
|
@ -126,19 +126,6 @@ var
|
|||||||
EntryInformation : TEntryInformation;
|
EntryInformation : TEntryInformation;
|
||||||
SysInstance : Longint;public name '_FPC_SysInstance';
|
SysInstance : Longint;public name '_FPC_SysInstance';
|
||||||
|
|
||||||
{ used by wstrings.inc because wstrings.inc is included before sysos.inc
|
|
||||||
this is put here (FK) }
|
|
||||||
|
|
||||||
function SysAllocStringLen(psz:pointer;len:dword):pointer;stdcall;
|
|
||||||
external 'oleaut32.dll' name 'SysAllocStringLen';
|
|
||||||
|
|
||||||
procedure SysFreeString(bstr:pointer);stdcall;
|
|
||||||
external 'oleaut32.dll' name 'SysFreeString';
|
|
||||||
|
|
||||||
function SysReAllocStringLen(var bstr:pointer;psz: pointer;
|
|
||||||
len:dword): Integer; stdcall;external 'oleaut32.dll' name 'SysReAllocStringLen';
|
|
||||||
|
|
||||||
|
|
||||||
{ include system independent routines }
|
{ include system independent routines }
|
||||||
{$I system.inc}
|
{$I system.inc}
|
||||||
|
|
||||||
@ -239,12 +226,6 @@ procedure Exe_entry(const info : TEntryInformation);[public,alias:'_FPC_EXE_Entr
|
|||||||
system_exit;
|
system_exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetCurrentProcess : dword;
|
|
||||||
stdcall;external 'kernel32' name 'GetCurrentProcess';
|
|
||||||
|
|
||||||
function ReadProcessMemory(process : dword;address : pointer;dest : pointer;size : dword;bytesread : pdword) : longbool;
|
|
||||||
stdcall;external 'kernel32' name 'ReadProcessMemory';
|
|
||||||
|
|
||||||
function is_prefetch(p : pointer) : boolean;
|
function is_prefetch(p : pointer) : boolean;
|
||||||
var
|
var
|
||||||
a : array[0..15] of byte;
|
a : array[0..15] of byte;
|
||||||
|
@ -118,19 +118,6 @@ implementation
|
|||||||
var
|
var
|
||||||
SysInstance : qword;public;
|
SysInstance : qword;public;
|
||||||
|
|
||||||
{ used by wstrings.inc because wstrings.inc is included before sysos.inc
|
|
||||||
this is put here (FK) }
|
|
||||||
|
|
||||||
function SysAllocStringLen(psz:pointer;len:dword):pointer;stdcall;
|
|
||||||
external 'oleaut32.dll' name 'SysAllocStringLen';
|
|
||||||
|
|
||||||
procedure SysFreeString(bstr:pointer);stdcall;
|
|
||||||
external 'oleaut32.dll' name 'SysFreeString';
|
|
||||||
|
|
||||||
function SysReAllocStringLen(var bstr:pointer;psz: pointer;
|
|
||||||
len:dword): Integer; stdcall;external 'oleaut32.dll' name 'SysReAllocStringLen';
|
|
||||||
|
|
||||||
|
|
||||||
{ include system independent routines }
|
{ include system independent routines }
|
||||||
{$I system.inc}
|
{$I system.inc}
|
||||||
|
|
||||||
@ -205,8 +192,6 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
|
|||||||
system_exit;
|
system_exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): Boolean; stdcall; external 'kernel32' name 'GetConsoleMode';
|
|
||||||
|
|
||||||
function Dll_entry{$ifdef FPC_HAS_INDIRECT_MAIN_INFORMATION}(const info : TEntryInformation){$endif FPC_HAS_INDIRECT_MAIN_INFORMATION} : longbool;forward;
|
function Dll_entry{$ifdef FPC_HAS_INDIRECT_MAIN_INFORMATION}(const info : TEntryInformation){$endif FPC_HAS_INDIRECT_MAIN_INFORMATION} : longbool;forward;
|
||||||
|
|
||||||
|
|
||||||
@ -230,12 +215,6 @@ begin
|
|||||||
DLL_Entry;
|
DLL_Entry;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetCurrentProcess : dword;
|
|
||||||
stdcall;external 'kernel32' name 'GetCurrentProcess';
|
|
||||||
|
|
||||||
function ReadProcessMemory(process : dword;address : pointer;dest : pointer;size : dword;bytesread : pdword) : longbool;
|
|
||||||
stdcall;external 'kernel32' name 'ReadProcessMemory';
|
|
||||||
|
|
||||||
function is_prefetch(p : pointer) : boolean;
|
function is_prefetch(p : pointer) : boolean;
|
||||||
var
|
var
|
||||||
a : array[0..15] of byte;
|
a : array[0..15] of byte;
|
||||||
@ -569,7 +548,7 @@ end;
|
|||||||
procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
|
procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
|
||||||
begin
|
begin
|
||||||
IsConsole:=true;
|
IsConsole:=true;
|
||||||
GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode);
|
GetConsoleMode(GetStdHandle((Std_Input_Handle)),@StartupConsoleMode);
|
||||||
{$ifdef FPC_USE_TLS_DIRECTORY}
|
{$ifdef FPC_USE_TLS_DIRECTORY}
|
||||||
LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback);
|
LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback);
|
||||||
{$endif FPC_USE_TLS_DIRECTORY}
|
{$endif FPC_USE_TLS_DIRECTORY}
|
||||||
|
Loading…
Reference in New Issue
Block a user