diff --git a/rtl/win/sysos.inc b/rtl/win/sysos.inc index e1434f18cc..eff12f30ec 100644 --- a/rtl/win/sysos.inc +++ b/rtl/win/sysos.inc @@ -211,6 +211,13 @@ threadvar function Win32GetCurrentThreadId:DWORD; 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} { module functions } @@ -267,6 +274,12 @@ threadvar function GetConsoleOutputCP : UINT; 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} Procedure Errno2InOutRes; diff --git a/rtl/win32/system.pp b/rtl/win32/system.pp index 8fc9780d4a..9a241d7cd9 100644 --- a/rtl/win32/system.pp +++ b/rtl/win32/system.pp @@ -126,19 +126,6 @@ var EntryInformation : TEntryInformation; 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 } {$I system.inc} @@ -239,12 +226,6 @@ procedure Exe_entry(const info : TEntryInformation);[public,alias:'_FPC_EXE_Entr system_exit; 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; var a : array[0..15] of byte; diff --git a/rtl/win64/system.pp b/rtl/win64/system.pp index 1cde1fc5e6..002b2f41e4 100644 --- a/rtl/win64/system.pp +++ b/rtl/win64/system.pp @@ -118,19 +118,6 @@ implementation var 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 } {$I system.inc} @@ -205,8 +192,6 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry']; system_exit; 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; @@ -230,12 +215,6 @@ begin DLL_Entry; 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; var a : array[0..15] of byte; @@ -569,7 +548,7 @@ end; procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup'; begin IsConsole:=true; - GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode); + GetConsoleMode(GetStdHandle((Std_Input_Handle)),@StartupConsoleMode); {$ifdef FPC_USE_TLS_DIRECTORY} LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback); {$endif FPC_USE_TLS_DIRECTORY}