LazUtils: attempt to fix WinCE build after r38199 #1be9d080b5

git-svn-id: trunk@38235 -
This commit is contained in:
maxim 2012-08-13 22:18:20 +00:00
parent 59dd582337
commit 15460809da

View File

@ -604,9 +604,11 @@ const
FILE_SHARE_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE);
begin
{$ifndef WinCE}
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) then
Result := FileOpen(UTF8ToSys(FileName), Mode)
else
{$endif}
Result := CreateFileW(PWideChar(UTF8Decode(FileName)), dword(AccessMode[Mode and 3]),
dword(ShareMode[(Mode and $F0) shr 4]), nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0);
@ -615,18 +617,22 @@ end;
function FileCreateUTF8(Const FileName : string) : THandle;
begin
{$ifndef WinCE}
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) then
Result := FileCreate(Utf8ToSys(FileName))
else
{$endif}
Result := CreateFileW(PWideChar(UTF8Decode(FileName)), GENERIC_READ or GENERIC_WRITE,
0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
end;
function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle;
begin
{$ifndef WinCE}
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) then
Result := FileCreate(Utf8ToSys(FileName), Rights)
else
{$endif}
Result := CreateFileW(PWideChar(UTF8Decode(FileName)), GENERIC_READ or GENERIC_WRITE,
0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
end;