From ba49e4a29d736068dbdf4a013f2639048e33e7dc Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 12 Jul 2013 17:18:11 +0000 Subject: [PATCH] * 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 - --- rtl/win/sysdir.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtl/win/sysdir.inc b/rtl/win/sysdir.inc index 34ea24c42a..acc3ac7cc7 100644 --- a/rtl/win/sysdir.inc +++ b/rtl/win/sysdir.inc @@ -74,7 +74,7 @@ end; procedure do_GetDir (DriveNr: byte; var Dir: Unicodestring); {$ifndef WINCE} var - Drive:array[0..3]of char; + Drive:array[0..3]of widechar; defaultdrive:boolean; savebuf: UnicodeString; len : integer; @@ -97,7 +97,7 @@ begin errno := word (GetLastError); Errno2InoutRes; Dir := widechar (DriveNr + 64) + ':\'; - SetCurrentDirectoryW(@SaveBuf); + SetCurrentDirectoryW(punicodechar(SaveBuf)); Exit; end; end; @@ -106,7 +106,7 @@ begin setlength(dir,len-1); // -1 because len is #0 inclusive GetCurrentDirectoryW(len,punicodechar(dir)); if not defaultdrive then - SetCurrentDirectoryW(@SaveBuf); + SetCurrentDirectoryW(punicodechar(SaveBuf)); if not FileNameCasePreserving then dir:=upcase(dir); {$else WINCE}