* systlsdir.inc: don't invent own symbols for the same purpose, defining DLL_xx conditionally is enough to avoid duplicate declarations.
git-svn-id: trunk@20363 -
* EExternal.ExceptionRecord changed from field to property and made available on all Windows, not just win32.
* CatchUnhandledException: removed AnsiString variable, ideally there should be no memory allocations in this code path.
git-svn-id: trunk@19849 -
* In win32/sysinitXX units, rename EntryInforation
to SysInitEntryInformation.
include new win/systlsdir.inc file from
win/syswin.inc for win64 target
and from win32/sysinit.inc for win32 target.
Set fields of both SysInitEntryInformation and EntryInformation
by converting them into typed constants.
git-svn-id: trunk@19779 -
- a set of rtl changes from AnsiString to RawByteString to various conversion functions
- a test which proves output in cp1251 and cp866 codepages (standard for Russian windows)
git-svn-id: trunk@19093 -
+ Win32Unicode2AnsiMove and Win32Wide2AnsiMove support code page parameter
+ Win32Ansi2UnicodeMove and Win32Ansi2WideMove support code page parameter
+ code page parameter added for several compilerprocs
* unified more code between win32 and win64 (widestring conversion routines
git-svn-id: trunk@19082 -
* win/systhrd.inc: added error checking in several places. Fail with code 226 if resources cannot be allocated, as Delphi does.
* win/syswin.inc, Dll_entry: Don't call DoneThread in PROCESS_DETACH callback, it is redundant because the main thread is finalized by FPC_DO_EXIT. SysReleaseThreadVars is still necessary. Also removed redundant assignments to return value.
git-svn-id: trunk@17992 -
- removed assembler from SysRelocateThreadVars: never actually worked, and this file is shared between different CPUs - not a proper place for assembler anyway.
- Obtain handle of kernel32.dll using GetModuleHandle, allows to get rid of UnloadLibrary call.
git-svn-id: trunk@17975 -
- Completely removed DLL_PROCESS_DETACH callback for executables. Reason: 1) it is executed after RTL has been shut down and called ExitProcess(), at which point it is really not a good idea to do the cleanup. 2) In executable (in contrast with DLL) it is just fine to leave remaining resources alone and let OS reclaim them.
* Using 'cvar' for _tls_used and _tls_index to get proper prefixing without $ifdef's.
git-svn-id: trunk@17943 -
- Do not call DLL hooks from exe callback handler.
- Do not call SysInitMultitheading from DLL_THREAD_ATTACH handler, it may only be called from the main thread. See comments in syswin.inc for details. Reverts rev. 17892.
+ To guarantee that SysInitMultithreading is called from the main thread, assume executables always multithreaded, just like DLLs are.
- Also removed all checks with MainThreadIdWin32, except checks for double DLL_PROCESS_DETACH in DLLs. They duplicate what Windows already does (the main thread invokes only PROCESS_ATTACH/PROCESS_DETACH and never THREAD_ATTACH/THREAD_DETACH callbacks).
* Attempts to avoid double initialization/finalization (once in callback, second time in normal control flow).
* Net result: webtbs/tw2423 and webtbs/tw15530 fixed, webtbs/tw3661 broken (because heaptrc does not support checking pointers in TLS area, and with 'always multithreaded' apps the Output varible moves into TLS).
git-svn-id: trunk@17938 -
Used to support TlsCallbacks.
Tls callback code added inside
ifdef FPC_USE_TLS_DIRECTORY.
NOTE: This code needs compiler changes also to work.
* win/systhread.inc:
Exec_Tls_callback: Callback for main executable.
Several new external variables:
FreePascal_TLS_callback, FreePascal_end_of_TLS_callback
need to be placed into .CRT$XL* section,
using name '.section .CRT$XLFPC __FPC_tls_callbacks'
extension to be provided by compiler change.
tls_callbacks : pointer; external name '___crt_xl_start__';
tls_data_start : pointer; external name '___tls_start__';
tls_data_end : pointer; external name '___tls_end__';
provided by linker script.
tls_index : DWord that will contain the automatic
TlsIndex generated by executable launch code (not used by
FPC code, but might be used by code from loaded objects).
_tls_used: TTlsdirectory record.
* win32/system.pp and win64/system.pp:
Code to force loading of _tls_used record.
git-svn-id: trunk@17893 -