* converted nativent sysutils routines to accept unicodestring instead

of rawbytestring and indicate that this platform now uses a two-byte
    file system API for the sysutils unit

git-svn-id: branches/cpstrrtl@25074 -
This commit is contained in:
Jonas Maebe 2013-07-09 19:01:28 +00:00
parent c604e5af17
commit 00ce3c1f52

View File

@ -49,8 +49,8 @@ implementation
{$DEFINE FPC_NOGENERICANSIROUTINES}
{ used OS file system APIs use ansistring }
{$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
{ used OS file system APIs use unicodestring }
{$define SYSUTILS_HAS_UNICODESTR_FILEUTIL_IMPL}
{ Include platform independent implementation part }
{$i sysutils.inc}
@ -59,7 +59,7 @@ implementation
File Functions
****************************************************************************}
function FileOpen(const FileName : rawbytestring; Mode : Integer) : THandle;
function FileOpen(const FileName : UnicodeString; Mode : Integer) : THandle;
const
AccessMode: array[0..2] of ACCESS_MASK = (
GENERIC_READ,
@ -76,7 +76,7 @@ var
objattr: OBJECT_ATTRIBUTES;
iostatus: IO_STATUS_BLOCK;
begin
AnsiStrToNtStr(ToSingleByteFileSystemEncodedFileName(FileName), ntstr);
UnicodeStrToNtStr(FileName, ntstr);
InitializeObjectAttributes(objattr, @ntstr, 0, 0, Nil);
NtCreateFile(@Result, AccessMode[Mode and 3] or NT_SYNCHRONIZE, @objattr,
@iostatus, Nil, FILE_ATTRIBUTE_NORMAL, ShareMode[(Mode and $F0) shr 4],
@ -85,19 +85,19 @@ begin
end;
function FileCreate(const FileName : RawByteString) : THandle;
function FileCreate(const FileName : UnicodeString) : THandle;
begin
FileCreate := FileCreate(FileName, fmShareDenyNone, 0);
end;
function FileCreate(const FileName : RawByteString; Rights: longint) : THandle;
function FileCreate(const FileName : UnicodeString; Rights: longint) : THandle;
begin
FileCreate := FileCreate(FileName, fmShareDenyNone, Rights);
end;
function FileCreate(const FileName : RawByteString; ShareMode : longint; Rights: longint) : THandle;
function FileCreate(const FileName : UnicodeString; ShareMode : longint; Rights: longint) : THandle;
const
ShareModeFlags: array[0..4] of ULONG = (
0,
@ -111,7 +111,7 @@ var
iostatus: IO_STATUS_BLOCK;
res: NTSTATUS;
begin
AnsiStrToNTStr(ToSingleByteFileSystemEncodedFileName(FileName), ntstr);
UnicodeStrToNtStr(FileName, ntstr);
InitializeObjectAttributes(objattr, @ntstr, 0, 0, Nil);
NtCreateFile(@Result, GENERIC_READ or GENERIC_WRITE or NT_SYNCHRONIZE,
@objattr, @iostatus, Nil, FILE_ATTRIBUTE_NORMAL,