Commit Graph

404 Commits

Author SHA1 Message Date
Jonas Maebe
a3c936fe5f + rawbytestring/unicodestring overloads for FileCreate and FileOpen.
The WinCE implementation converts the rawbytestring arguments to
    unicodestring and calls unicode OS APIs, while the others convert
    unicodestring arguments to DefaultFileSystemCodePage and call
    single byte OS APIs
  + test for the above

git-svn-id: branches/cpstrrtl@22467 -
2012-09-27 07:54:25 +00:00
Jonas Maebe
598d2feeb6 + rtldefs.inc file for every target that contains defines shared by multiple
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 -
2012-09-27 07:54:06 +00:00
marco
1dbde17516 * fix some of the overloads for -A and -W routines.
git-svn-id: trunk@22427 -
2012-09-20 16:56:28 +00:00
florian
df83d96559 + patch by CA Gorski adding missing 'kernel32' strings
git-svn-id: trunk@21982 -
2012-07-29 10:34:03 +00:00
michael
1f25547903 * Fixed compilation (mantis #22413)
git-svn-id: trunk@21891 -
2012-07-12 08:37:40 +00:00
michael
8eeb22720b * Added GetLoadErrorStr function by Mark Morgan Loyd (Bug ID 22321)
git-svn-id: trunk@21880 -
2012-07-11 15:31:09 +00:00
michael
64ab9c06d3 * Added GetLocalTimeOffset function
git-svn-id: trunk@21865 -
2012-07-11 09:56:34 +00:00
marco
1a3d8f483e * crtwrite didn't handle buffer writes > 255 chars properly, and the textrec buffer is 256 currently (and has been since svn history start). Mantis #22334
git-svn-id: trunk@21738 -
2012-06-30 13:23:26 +00:00
paul
82bfe995ef rtl: move WM_APP to messages.inc instead of defines.inc. In other case it is not visible if only Message.pas is included into uses.
git-svn-id: trunk@21320 -
2012-05-18 08:59:23 +00:00
marco
fedd899736 * deprecated winexec, a win16 overleft which MS deprecated 17 years ago.
git-svn-id: trunk@21291 -
2012-05-14 09:43:53 +00:00
Tomas Hajny
27403b542b + FileNameCasePreserving added - see #18066 in Mantis
git-svn-id: trunk@20896 -
2012-04-15 21:21:53 +00:00
marco
06688db698 * wvsprintf* to stdcall, mantis #21591
--This line, and those below, will be ignored--

M    win/wininc/unidef.inc
M    win/wininc/ascfun.inc
M    win/wininc/ascdef.inc
M    win/wininc/unifun.inc

git-svn-id: trunk@20655 -
2012-03-29 17:43:38 +00:00
paul
fc8692e7c9 win rtl: add BM_SETDONTCLICK message
git-svn-id: trunk@20509 -
2012-03-11 01:45:35 +00:00
sergei
cd44c5f45c Win32 and Win64, fixed DLL exit sequence, resolves #14603:
* 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 -
2012-02-16 23:39:03 +00:00
marco
136b7dee9b * fix for bug #21281, some functions were missing dllname.
git-svn-id: trunk@20364 -
2012-02-16 20:54:37 +00:00
sergei
167ee9867e * Moved DLL_xxx declarations to sysos.inc, so they can be reused by wince.
* 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 -
2012-02-16 17:13:32 +00:00
sergei
c3b106fde3 * StringToOleStr(UnicodeString), reduced to single SetString call, this way it does not depend on private functions and does not require $ifdef's.
git-svn-id: trunk@20263 -
2012-02-05 18:43:20 +00:00
pierre
f80bc70707 + Add _FPC_TlsSize public symbol for use by heaptrc unit
git-svn-id: trunk@20180 -
2012-01-26 13:51:34 +00:00
pierre
573102fa70 * Explicitly disable checkpointer for functions using GetEnvironmentStrings
git-svn-id: trunk@20179 -
2012-01-26 13:50:36 +00:00
marco
51f99c57c3 * Add CancelIO, CancelIOex Mantis #21079
git-svn-id: trunk@20063 -
2012-01-13 09:02:54 +00:00
marco
397a6059f8 * correct INVALID_SOCKET to NOT 0, mantis #20946
git-svn-id: trunk@19883 -
2011-12-22 12:20:00 +00:00
sergei
ce2812e24a * Split combined declarations of GetModuleHandle and GetModuleFileName into separate WinCE and non-WinCE versions. Using Pointer as 'common denominator' in combined declarations was making it impossible to use e.g. GetModuleHandle('literal') in System unit.
* Also fixed parameter and return types for these declarations.

git-svn-id: trunk@19881 -
2011-12-22 02:17:02 +00:00
sergei
ebb2205c63 * Moved TExceptionRecord definition to sysos.inc, it is identical for all Windows targets.
git-svn-id: trunk@19868 -
2011-12-18 00:45:52 +00:00
sergei
abdbe49861 + SysUtils part of SEH (enabled only for win64)
* 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 -
2011-12-14 10:47:26 +00:00
sergei
bcbd25568e * Call InitHeap before InitSystemThreads in TLS callback (necessary because InitSystemThreads calls RelocateHeap), and skip both of them in initialization section of system.pp if they have been called from TLS callback. This restores correct initialization sequence which was broken by r19779, resulting in lots of debug messages about corrupted heap when running tests/test/theapthread.pp
git-svn-id: trunk@19836 -
2011-12-13 07:40:02 +00:00
sergei
76b9d7e766 - Removed Win32Wide2AnsiMove() again, it was removed already in r17202 but got restored during subsequent cpstrnew merging.
git-svn-id: trunk@19781 -
2011-12-08 21:28:12 +00:00
pierre
4a9c8e330b + Move EXEC_callback into separate file win/systlsdir.inc
* 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 -
2011-12-08 16:11:07 +00:00
marco
f89e32c034 * expanded VK_ codes. Patch by Nikolay N. Mantis #20801
git-svn-id: trunk@19734 -
2011-12-03 16:41:06 +00:00
sergei
32094761ef * 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 -
2011-12-02 18:52:48 +00:00
sergei
37abdd52df * Reverted r19693, calling SysInitMultithreading from PROCESS_ATTACH is plain wrong because it depends on initialized thread manager. Calling InitSystemThreads is more correct, but in case of Win32 it further depends on EnrtyInformation, which is not available at this point. Properly solving the issue requires moving the entire TLS stuff into sysinit units or something like that.
git-svn-id: trunk@19715 -
2011-11-30 15:14:00 +00:00
sergei
266acd1bed * Windows TLS callbacks, call SysInitMultithreading early, it is necessary because if a statically loaded DLL creates a thread, apparently DLL_THREAD_ATTACH callback executes right away before the entry point. In turn, DLL_THREAD_ATTACH requires TLSIndex to be initialized.
git-svn-id: trunk@19693 -
2011-11-26 20:52:27 +00:00
paul
270fb09e87 rtl: add WideStringManager.GetStandardCodePageProc method to retrieve system ansi and console code pages
git-svn-id: trunk@19539 -
2011-10-25 01:39:11 +00:00
florian
3c0256bd7b * patch by Ludo Brands to fix #20481: GetFileType cannot be used on windows to determine if a handle is a console handle because the function does not distinguish between consoles and printers, resolves #20481
git-svn-id: trunk@19532 -
2011-10-23 14:20:00 +00:00
paul
5bf39cd1c1 rtl: remove ver2_2 define
git-svn-id: trunk@19471 -
2011-10-12 01:55:46 +00:00
paul
6131a9188c rtl: fix wince compilation, reimplement WinCEWide2AnsiMove, WinCEAnsi2WideMove by copying win32 code
git-svn-id: trunk@19470 -
2011-10-12 01:50:14 +00:00
paul
836889fc64 rtl: move some CP_xxx constants from syswin into systemh for generic use, redeclare UTF8Sting, RawByteString using constant identifiers instead of pure numbers. replace comparison with $ffff codepage to CP_NONE
git-svn-id: trunk@19354 -
2011-10-04 05:05:14 +00:00
pierre
7e87ca4c3c * Comment about mingw tlssup.c added
git-svn-id: trunk@19349 -
2011-10-03 22:03:02 +00:00
sergei
ad5d2ccabb * Moved command line handling and randomize() to syswin.inc, so a single copy of code is used for both win32 and win64. This implies that apostrophe is no longer supported as quoting symbol in win64.
Win64 doesn't support it itself either.

git-svn-id: trunk@19201 -
2011-09-23 21:45:02 +00:00
sergei
f35a8179b1 * Status codes are identical for win32 and win64, moved them to syswin.inc.
git-svn-id: trunk@19160 -
2011-09-20 15:01:22 +00:00
sergei
6f20627220 * Use rip-relative offsets in assembler, fixes linking text mode IDE with internal linker. The better way would be to get rid of this assembler altogether.
git-svn-id: trunk@19149 -
2011-09-19 15:18:28 +00:00
paul
9e0ad7baae merge r17318 from cpstrnew branch by florian:
* compilation fix by Inoussa OUEDRAOGO, resolves #19160

git-svn-id: trunk@19104 -
2011-09-17 13:01:20 +00:00
paul
233004f72b merge r14144 from cpstrnew branch by paul:
call MultiByteToWideChar with dwFlags=0 for UTF8 code page

git-svn-id: trunk@19100 -
2011-09-17 11:56:16 +00:00
paul
2162add8ac merge r14132 from cpstrnew branch by paul:
- 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 -
2011-09-17 11:39:13 +00:00
paul
8cc22972a0 merge r13488 from cpstrnew branch by florian except ncgcon.pas which has a difficult merge conflict (code moved to another unit which is not at the branch during the revision):
* first batch of patches to make tcpstr1.pp work

git-svn-id: trunk@19085 -
2011-09-17 11:16:45 +00:00
paul
ae0d732c8f merge r13485 from cpstrnew branch by florian:
* fixed compilation of system unit after last changes

git-svn-id: trunk@19083 -
2011-09-17 11:01:42 +00:00
paul
28627482c5 merge r13483 from cpstrnew branch by florian:
+ 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 -
2011-09-17 10:54:00 +00:00
marco
d6962106b9 * typecast that fixes range error, part of mantis #16172
git-svn-id: trunk@19040 -
2011-09-09 20:03:08 +00:00
marco
1f5333a80a * fixes from Mantis #20194, derived from patch and description by G. Fink.
git-svn-id: trunk@19035 -
2011-09-08 20:42:39 +00:00
marco
01d686c11d * paper size constants updated, patch by G. Fink, Mantis #20120
git-svn-id: trunk@18932 -
2011-09-01 08:40:51 +00:00
marco
9772257404 * fix for mantis #20047 ddeconnect VAR Parameter issue that can take NIL.
git-svn-id: trunk@18853 -
2011-08-26 13:16:37 +00:00