mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 17:40:30 +02:00
Merged revision(s) part of 63978 from trunk:
FpDebug: fix opening files with utf8 name on windows. Issue #37884 ........ git-svn-id: branches/fixes_2_0@63979 -
This commit is contained in:
parent
8e84940d5c
commit
d7ef338ff6
@ -188,14 +188,23 @@ end;
|
||||
|
||||
{ TDbgFileLoader }
|
||||
|
||||
{$ifdef USE_WIN_FILE_MAPPING}
|
||||
function CreateFileW(lpFileName:LPCWSTR; dwDesiredAccess:DWORD; dwShareMode:DWORD; lpSecurityAttributes:LPSECURITY_ATTRIBUTES; dwCreationDisposition:DWORD;dwFlagsAndAttributes:DWORD; hTemplateFile:HANDLE):HANDLE; external 'kernel32' name 'CreateFileW';
|
||||
{$ENDIF}
|
||||
|
||||
constructor TDbgFileLoader.Create(AFileName: String);
|
||||
{$IFDEF MacOS}
|
||||
var
|
||||
s: String;
|
||||
{$ENDIF}
|
||||
{$ifdef USE_WIN_FILE_MAPPING}
|
||||
var
|
||||
s: UnicodeString;
|
||||
{$ENDIF}
|
||||
begin
|
||||
{$ifdef USE_WIN_FILE_MAPPING}
|
||||
FFileHandle := CreateFile(PChar(AFileName), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
s := UTF8Decode(AFileName);
|
||||
FFileHandle := CreateFileW(PWideChar(s), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
Create(FFileHandle);
|
||||
{$else}
|
||||
FList := TList.Create;
|
||||
|
Loading…
Reference in New Issue
Block a user