- Use the CommandLineToArgvW API function to parse the Unicode command line (we can use it since Win9x is not supported anymore).
- Implemented non-public functions ParamStrA and ParamStrU which are exposed in the objpas and uuchar units to provide correct AnsiString and UnicodeString versions of ParamStr().
- The cleanup code is moved from InternalExit to the finalization section of the System unit.
git-svn-id: trunk@45037 -
rtl/inc/systemh.inc & rtl/java/jsystemh_types.inc:
- TEntryInformation: remove WideInitTables
rtl/win/sysosh.inc:
+ TEntyrInformationOS: add WideInitTables
rtl/win/syswin.inc:
* adjust WStrInitTablesTable, so that it is now a pointer and can be used both with direct and indirect main entry
* InitWin32Widestrings: WStrInitTablesTable is now a pointer
rtl/win32/sysinit.inc:
* WideInitTables has moved to the OS specific part of the entry information
rtl/win32/system.pp:
* OsSetupEntryinformation: setup WStrInitTablesTable
git-svn-id: trunk@33571 -
rtl/inc/system.inc:
* SetupEntryInformation: call new, optional function OSSetupEntryInformation to handle platform specific entry information initialization
rtl/win/sysosh.inc, TEntryInformationOS:
+ new field TlsKeyAddr which will hold the address to the main binary's TlsKey variable
win32/sysinit.inc:
+ provide the variable holding the TlsKey and pass that on to the entry information record
win32/system.pp:
+ new OS specific entry information initialization (currently only the TlsKey)
win/systhrd.inc:
* declare TlsKey as a pointer to a DWord value instead of a DWord; on non-indirect entry platforms this is initialized with the address of new variable TlsKeyVar, on indirect entry platforms it will be initialized by the entry information initialization
* adjust usages of TlsKey from DWord to PDWord
win/systlsdir.inc:
* TlsKey is now a PDWord and (in sysinit) points to TlsKeyVar
win/syswin.inc:
* adjust TlsKey usage
inc/heaptrc.pp:
* TlsKey is now a PDWord, thus adjust the import and the usage
git-svn-id: trunk@33091 -
rtl/inc/system.inc:
+ new variables that hold pointers to the tables
+ new procedure SetupEntryInformation() that should be used in the entry points of indirect entry targets to setup cross target fields
+ for direct entry targets the two resource string tables are imported here and supplied as initialization to the table pointers
objpas/objpas.pp:
* adjust table declarations so that the pointers provided from the System unit are used
* adjust usages of the tables as they are now pointers
win32/system.pp:
* Exe_Entry: use SetupEntryInformation()
win/syswin.inc:
* Dll_Entry: use SetupEntryInformation()
git-svn-id: trunk@33028 -
o since we always use UTF-16 for OS file API calls, this will only affect
possible intermediate code page conversions inside RTL routines and hence
prevent potential data loss. This was already the same for NativeNT and
WinCE, which are in the same boat
o DefaultRTLFileSystemCodePage, which specifies the code page used to return
strings from single byte RTL routines, remains CP_ACP and hence nothing
will change as far as programs using the RTL are concerned
git-svn-id: trunk@26377 -
RTL units. Comes with a FPCRTL_FILESYSTEM_UTF8 define that can be
activated for targets whose single byte filesystem interface enforces
UTF-8; included in inc/systemh.inc and unix/cwstring.pp until now
+ DefaultFileSystemCodePage variable that holds the code page used for
communicating with the OS single byte file system APIs, and for the
strings returned by those same APIs. Initialized with
o the result of GetACP in the system unit of Windows platforms, except for
WinCE which uses UTF-8 since its file system OS API calls already use
the UTF-16 versions
o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
DefaultSystemCodePage on other Unix platforms
o DefaultSystemCodePage on Java/Android JVM targets
+ DefaultRTLFileSystemCodePage variable that holds the code page used to
encode strings returned by RTL routines that return filenames obtained
from OS API calls. By default the same as DefaultFileSystemCodePage on
all platforms. Separate from DefaultFileSystemCodePage for clarity on
platforms that may use either utf-16 or single byte OS API calls to
send/receive file names (such as most Windows platforms)
+ new scpFileSystemSingleByte enum that can be passed to
GetStandardCodePage() to get the default code page for OS single byte file
system APIs, with implementations for Unix and Windows
+ SetMultiByteFileSystemCodePage() procedure to override the value of
DefaultFileSystemCodePage
In principle, in the long run unchanged programs only using generic
ansistrings and unicodestrings should (mostly) behave the same as in
FPC 2.6.0 as far as RTL-level file system APIs are concerned if
they set DefaultFileSystemCodePage and DefaultRTLFileSystemCodePage
to DefaultSystemCodePage at the start of their execution
git-svn-id: branches/cpstrrtl@22466 -
* Unwind to DllEntry context only if called from DllEntry. Otherwise, terminate the entire process, making sure that RTL won't be finalized twice.
* Call DLL_process_detach_hook before RTL is finalized, not after.
git-svn-id: trunk@20367 -
* 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 -
* 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 -
- 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 -