Commit Graph

491 Commits

Author SHA1 Message Date
nickysn
5242ed7864 * changed TResStrInitTable.Count and TWStrInitTablesTable.Count to nativeint
git-svn-id: trunk@26921 -
2014-03-02 13:27:59 +00:00
sergei
1f22c2de22 - Text i/o routines are not expected to return a value.
git-svn-id: trunk@26834 -
2014-02-22 13:42:41 +00:00
sergei
c83f4c5ddc * Windows targets: removed 'errno' threadvar, OS error codes can be passed directly to Errno2InOutRes().
git-svn-id: trunk@26815 -
2014-02-19 07:28:46 +00:00
sergei
489b23cecd * Made TStartupInfo type common for win32 and win64 and updated as suggested by Mantis #23074.
* Deprecated StartupInfo variable because it is not there for Delphi compatibility (Delphi apparently does not have such variable in interface of its System unit), and we don't have other reasons to export non-portable stuff.

git-svn-id: trunk@26810 -
2014-02-18 16:49:08 +00:00
sergei
5e762cc6ea * Second part of 64-bit Windows fixes and updates from Mantis #23074.
git-svn-id: trunk@26807 -
2014-02-18 09:26:47 +00:00
sergei
83deae45b8 * First part of 64-bit Windows fixes from Mantis #23074.
git-svn-id: trunk@26806 -
2014-02-18 02:10:35 +00:00
michael
f2d163cd38 * Fixed bug ID #23290 (FileSetDate on Dir)
git-svn-id: trunk@26682 -
2014-02-06 12:01:25 +00:00
Tomas Hajny
1a430d8110 * GetProcAddr added for OS/2, type of argument for ordinal target specific now
git-svn-id: trunk@26521 -
2014-01-19 21:15:26 +00:00
svenbarth
6273192ce1 + Add a new overload to DynLibs to allow loading by Ordinal only. This needs specific operating system support however and will return Nil (using a default implementation) if ordinals are not supported.
+ Implement overload for the three supported Windows targets.

git-svn-id: trunk@26457 -
2014-01-14 15:23:55 +00:00
marco
f09374a197 * winsock(and -2), sockets and gpm to rtl-extra.
git-svn-id: trunk@26426 -
2014-01-11 19:45:37 +00:00
marco
dea2c743d5 * Initial active version of
rtl-extra : objects matrix ucomplex
   rtl-objpas: convutil(s) dateutil(s) stdconvs variants varutils
   

git-svn-id: trunk@26398 -
2014-01-05 19:20:15 +00:00
Jonas Maebe
d1b2a5f362 * changed the initial value DefaultFileSystemCodePage from CP_ACP to CP_UTF8:
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 -
2014-01-04 15:05:42 +00:00
marco
a001e12d04 * rtl-console initial version.
git-svn-id: trunk@26372 -
2014-01-03 22:19:02 +00:00
marco
ebe262762a * Clean out of $i textrec and filerec includes that are redundant now that cpstrrtl exposes
those records via system. 

git-svn-id: trunk@26356 -
2014-01-02 13:26:09 +00:00
sergei
179586f589 + SEH support for Win32. Enable by cycling with OPT=-dTEST_WIN32_SEH.
Although basic things work (no regressions in test suite, also with TEST_OPT=-O2), there are some secondary issues/TODOs:
- Exception frame around PASCALMAIN is not properly removed in DLLs
- No stack traces yet
- Stack overallocated in finalizer procedures, their entry/exit code needs cleanup
- Signals unit is probably completely broken.

git-svn-id: trunk@26225 -
2013-12-12 12:43:46 +00:00
marco
67c21b3a5e * fix for #25402 One argument of GetICMProfileW missed an indirection
git-svn-id: trunk@26202 -
2013-12-09 18:19:31 +00:00
sergei
04c0845189 * Moved more reusable exception handling code from seh64.inc to syswin.inc.
* sysutils.pp: Install ExceptObjProc and ExceptClsProc also on Win32.

git-svn-id: trunk@26181 -
2013-12-04 14:02:54 +00:00
marco
23ac05cfdd * fix for #22546
git-svn-id: trunk@26177 -
2013-12-03 23:24:48 +00:00
sergei
6a40ff730c * In preparation to support SEH on Win32, moved definitions that apply to Win32 from seh64.inc into syswin.inc.
git-svn-id: trunk@26153 -
2013-11-29 14:23:46 +00:00
nickysn
6cf2382760 + added the PFD_DIRECT3D_ACCELERATED and PFD_SUPPORT_COMPOSITION constants to
the windows unit

git-svn-id: trunk@25774 -
2013-10-14 11:59:24 +00:00
marco
c7206dde97 * changed type of unused parameter in TWMSetFocus from WParam to LParam as
suggest by ChrisF, Mantis #25171

git-svn-id: trunk@25723 -
2013-10-08 16:02:25 +00:00
marco
bca1e53840 * fix for mantis #24920 try to properly update messages unit for win64.
git-svn-id: trunk@25639 -
2013-10-04 18:24:16 +00:00
paul
bc636658d6 rtl: add/change some token related types
git-svn-id: trunk@25574 -
2013-09-26 03:51:06 +00:00
paul
de6a53376c win32: update TOKEN_INFORMATION_CLASS from windows sdk
git-svn-id: trunk@25565 -
2013-09-25 08:50:38 +00:00
marco
1a4a745993 * fix for mantis #25078
git-svn-id: trunk@25546 -
2013-09-24 12:56:43 +00:00
Tomas Hajny
3e5601d89e * fix ChDir and GetDir handling for other than the current drive and avoid changing the current directory in GetDir in that case
git-svn-id: trunk@25541 -
2013-09-23 20:41:54 +00:00
nickysn
96c7a9325a * CrtOpen, CrtClose, CrtRead, CrtWrite and CrtReturn changed to procedures, instead of functions
git-svn-id: trunk@25506 -
2013-09-17 11:17:29 +00:00
Jonas Maebe
40ff1c77ca * updated GetWindowsSpecialDir():string so it uses the -A or -W api call
depending on whether the RTL is compiled in Unicode mode to avoid
    conversions

git-svn-id: branches/cpstrrtl@25310 -
2013-08-19 22:47:19 +00:00
Jonas Maebe
63e8d0c31c * do not yet map GetCommandLine() to GetCommandLineW() with -dFPC_UNICODE_RTL,
because its result is assigned to the global cmdline variable which is still
    a pchar in all cases

git-svn-id: branches/cpstrrtl@25309 -
2013-08-19 22:47:15 +00:00
Jonas Maebe
5b09435055 * explicitly call several windows *A() versions of APIs so the intended
routine is called even when we compile with -dFPC_UNICODE_RTL

git-svn-id: branches/cpstrrtl@25308 -
2013-08-19 22:47:12 +00:00
Jonas Maebe
2da7c3f05c * changed declarations in finah.inc and diskh.inc from ansistring to
rawbytestring
  * DoDirSeparators() and GetDirs() marked as "rtlproc" so they can accept
    non-rawbytestring arguments as their var-parameters

git-svn-id: branches/cpstrrtl@25306 -
2013-08-19 22:04:40 +00:00
Jonas Maebe
af3f12f60c * rawbytestring/unicodestring versions of findfirst/findnext/findclose
o these routines are now generic wrappers in filutil.inc, and call
     the platform-dependent internalfindfirst/next/close routines
   o on unix, the fnmatch routine got proper support for UTF-8 matching
     (e.g., it won't match a partial UTF-8 code point to a "?" wildcard)
   o for NativeNT, a similar (untested) UTF-16 version has been added
  + test for the above
  * rawbytestring/unicodestring versions of fileage

git-svn-id: branches/cpstrrtl@25302 -
2013-08-19 22:04:25 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
3fdb3092af + defaultfilesystemcodepage support for dynlibs
+ unicodestring overloads for (safe)loadlibrary()

git-svn-id: branches/cpstrrtl@25162 -
2013-07-22 21:45:34 +00:00
Jonas Maebe
df6a2dce00 + unicodestring support for assign/erase/rename
+ codepage support for textrec/filerec and the above routines
  * textrec/filerec now store the filename by default using widechar. It is
    possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
    In that case, from now on the filename will always be stored in
    DefaultFileSystemEncoding
  * fixed potential buffer overflows and non-null-terminated file names in
    textrec/filerec
  + dodirseparators(pwidechar), changed the dodirseparators(pchar/pwidechar)
    parameters into var-parameters and gave those routines an extra parameter
    that indicates whether the p(wide)char can be changed in place if
    necessary or whether a copy must be made first (avoids us having to make
    all strings always unique everywhere, because they might be changed on
    some platforms via a pchar)
  * do_open/do_erase/do_rename got extra boolean parameters indicating whether
    the passed pchars point to data that can be freely changed (to pass on to
    dodirseparators() if applicable)
  * objects.pp: force assign(pchar) to be called, because
    assign(array[0..255]) cannot choose between pchar and rawbytestring
    versions (and removing the pchar version means that assign(pchar) will
    be mapped to assign(shortstring) in {$h-})
  * fixed up some routines in other units that depend on the format of
    the textrec/filerec.name field

git-svn-id: branches/cpstrrtl@25137 -
2013-07-19 16:30:51 +00:00
Jonas Maebe
155aafc255 * moved SYSUTILS_HAS_ANSISTR/UNICODESTR_FILEUTIL_IMPL define to interface
so declarations can also depend on it and similar defines (not yet the
    case)
  + added SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL/SYSUTILS_HAS_UNICODESTR_ENVVAR_IMPL
    to indicate whether the platform-dependent part of the unit provides
    an ansistring/unicodestring interface to get environment variables
  + Windows version of getenvironmentvariable(unicodestring)
  + generic ansistring/unicodestring versions of GetEnvironmentVariable()
    in case the platform doesn't provide them
  * result of GetEnvironmentString() is ansistring/unicodestring depending
    on the state of the FPC_RTL_UNICODE define

git-svn-id: branches/cpstrrtl@25116 -
2013-07-16 14:16:34 +00:00
Jonas Maebe
eeb98a0c0f - removed platform-specific implementations of GetCurrentDir, SetCurrentDir,
CreateDir and RemoveDir, and implemented a generic one (based on the OS/2
    version) in the shared sysutils code (so that the filesystem code page
    support for the system unit routines can be reused)
  * include both ansistring and unicodestring versions of the above routines,
    and of ForceDirectories. Exception: GetCurrentDir, which cannot be
    overloaded based on function result and whose return type currently
    dependends on the FPC_UNICODE_RTL define

git-svn-id: branches/cpstrrtl@25113 -
2013-07-16 14:15:55 +00:00
Jonas Maebe
8b77f62873 * don't truncate environment variable strings in GetEnvironmentString()
* set the correct code page for the result of GetEnvironmentString() on
    Windows and NativeNT

git-svn-id: branches/cpstrrtl@25103 -
2013-07-15 09:21:20 +00:00
Jonas Maebe
08099c8558 * explicitly call *A routines from ansistring environment variable routines
git-svn-id: branches/cpstrrtl@25102 -
2013-07-15 09:21:03 +00:00
Jonas Maebe
d919794fdf * handle the fact that GetEnvironmentStringsA returns the environment in the
OEM instead of in the Ansi code page (mantis #22524, #15233)

git-svn-id: branches/cpstrrtl@25092 -
2013-07-12 17:18:28 +00:00
Jonas Maebe
a5273abc9c + support for CP_OEMCP
* changed all mappings from CP_ACP to DefaultSystemCodePage to calls to the
    new TranslatePlaceholderCP() routine (which also handles CP_OEMCP)
  * removed unnecessary CP_ACP adaptations in fpc_AnsiStr_Concat_multi()
    for JVM target (now handled in the ansistring to unicodestring conversion
    routine)

git-svn-id: branches/cpstrrtl@25091 -
2013-07-12 17:18:24 +00:00
Jonas Maebe
ba49e4a29d * fixed do_getdir() for non-defaultdrive after r25042 ("drive" array has to
be an array of widechar now)
  * fixed restoring of original path in do_getdir() (pass contents of
    unicodestring to SetCurrentDirectoryW(), not its address)

git-svn-id: branches/cpstrrtl@25088 -
2013-07-12 17:18:11 +00:00
Jonas Maebe
26b2149ced * converted the following sysutils routines to unicodestring and
rawbytestring: FileExists, DirectoryExists, FileSetDate, FileGetAttr,
    FileSetAttr, DeleteFile, RenameFile, FileSearch, ExeSearch,
    FileIsReadOnly

git-svn-id: branches/cpstrrtl@25078 -
2013-07-09 19:01:45 +00:00
marco
609f6255d4 * added layout constants.
git-svn-id: trunk@25053 -
2013-07-06 20:46:30 +00:00
Jonas Maebe
d66d15aad3 + added mkdir/chdir/rmdir(rawbytestring) and (unicodestring) to the system unit
* renamed platform-specific pchar versions of those rouines to do_*() and
    changed them to either rawbytestring or unicodestring depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API setting
  * implemented generic shortstring versions of those routines on top of either
    rawbytestring or unicodestring depending on the API-kind (in case of the
    embedded target, if ansistring are not supported they will map directly
    to shortstring routines instead)
  * all platform-specific *dir() routines with rawbytestring parameters now
    receive their parameters in DefaultFileSystemCodePage
  - removed no longer required ansistring variants from the objpas unit
  - removed no longer required FPC_SYS_MKDIR etc aliases
  * factored out empty string and inoutres<>0 checks from platform-specific
    *dir() routines to generic ones
  o platform-specific notes:
   o amiga/morphos: check new pathconv(rawbytestring) function
   o macos TODO: convert PathArgToFSSpec (and the routines it calls) to
     rawbytestring
   o nativent: added SysUnicodeStringToNtStr() function
   o wii: convert dirio callbacks to use rawbytestring to avoid conversion
  + test for unicode mk/ch/rm/getdir()

git-svn-id: branches/cpstrrtl@25048 -
2013-07-04 22:28:37 +00:00
Jonas Maebe
8368f7dba5 * call unicodestring version of ExpandUNCFileName from ansistring version
instead of infinitely recursing into the ansistring version

git-svn-id: branches/cpstrrtl@25044 -
2013-07-04 22:28:20 +00:00
Jonas Maebe
08ab4dcabe * convert calls to GetCurrentDirectory to *W in Windows do_getdir()
git-svn-id: branches/cpstrrtl@25042 -
2013-07-04 22:28:13 +00:00
Jonas Maebe
b08d8091b2 * made fexpand unicodestring-safe (use charinset instead of "in" --
"widechar in set" compiles, but results in a runtime conversion of
    the widechar into an ansistring and then getting the first character
    of that ansistring, which is horribly slow -- and Delphi-incompatible,
    but introduced a long time ago because of bug #7758)
  * replaced all "in" operations in sysutils fina.inc with CharInSet for
    the same reason
  * replaced all "string" declarations in finah.inc/fina.inc with "PathStr"
    and "pchar" with "PathPChar", and include them twice in sysutilh.inc/
    sysutils.inc, once with PathStr=UnicodeString/PathPChar=PWideChar and
    once with PathStr=AnsiString/PathPChar=PAnsiChar (not rawbytestring
    because there are several routines with var-parameters and then the
    string type has to match exactly; the "rtlproc" modifier could circumvent
    this, but should be used sparingly, and additionally the routine's
    internals would then first also have to be reviewed to ensure that at
    no point they start mixing in strings with the defaultsystemcodepage
    (e.g. directory separators) without first adjusting their codepage)
  * call GetShortPathNameA or GetShortPathNameW in ExtractShortPathName on
    Windows depending on whether we are parsing the RawByteString/UnicodeString
    version of fina.inc
  + ExpandUNCFileName(unicode) version for Windows, let its
    ExpandUNCFileName(ansistring) call the unicode version (avoid data loss
    due to ansi conversion) and convert the result to
    DefaultRTLFileSystemCodePage (to have no more data loss than what's
    specified by the user)

git-svn-id: branches/cpstrrtl@24999 -
2013-06-27 21:38:10 +00:00
Jonas Maebe
62ee16278b * changed getdir(ansistring):ansistring to
getdir(rawbytestring):rawbytestring so it can accept strings in any
    encoding and cleanly return results in DefaultRTLFileSystemCodePage
  + getdir(unicodestring):unicodestring
  * renamed the getdir implementation of all platforms except for embedded-
    without-ansistring-support to do_getdir(), and depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API define
    changed its shortstring parameter to ansistring or unicodestring. The
    do_getdir(rawbytestring) routine should just set the code page of the
    return value to DefaultFileSystemCodePage without conversion (not
    DefaultRTLFileSystemCodePage with conversion, that conversion is performed
    in getdir if necessary; this avoids double conversions in case
    getdir(unicodestring) is called)
  + generic getdir(shortstring) for platforms supporting either ansistrings or widestrings
  o platform maintainers:
   o OS/2: adjust code to supports paths > 255 characters if those are supported
   o Wii: adjust used callback to use rawbytestring to support paths > 255 characters and
     avoid shortstring->rawbytestring conversion overhead
   o Windows: GetCurrentDirectoryW is now always used (to prevent data loss)

git-svn-id: branches/cpstrrtl@24993 -
2013-06-27 21:37:47 +00:00
Jonas Maebe
b0613d9ec5 * converted Windows FileCreate/FileOpen to use unicode interface instead of
ansistring

git-svn-id: branches/cpstrrtl@24969 -
2013-06-24 21:24:13 +00:00