io.files.temp.windows: fix up

db4
Joe Groff 2012-03-31 17:11:38 -07:00 committed by John Benediktsson
parent 5948f53725
commit 8b9b8df457
2 changed files with 11 additions and 6 deletions

View File

@ -1,13 +1,17 @@
! (c)2012 Joe Groff bsd license
USING: ;
USING: alien.data alien.strings io.directories
io.encodings.utf16n io.files.temp io.pathnames kernel math
memoize specialized-arrays system windows.errors
windows.kernel32 windows.ole32 windows.shell32
windows.types ;
SPECIALIZED-ARRAY: WCHAR
IN: io.files.temp.windows
<PRIVATE
: (get-temp-directory) ( -- path )
MAX_PATH dup <WCHAR-array> [ GetTempPath ] keep
swap win32-error
MAX_PATH 1 + dup WCHAR <c-array> [ GetTempPath ] keep
swap win32-error=0/f
utf16n alien>string ;
: (get-appdata-directory) ( -- path )
@ -15,9 +19,9 @@ IN: io.files.temp.windows
CSIDL_LOCAL_APPDATA CSIDL_FLAG_CREATE bitor
f
0
MAX_PATH <WCHAR-array>
MAX_PATH 1 + WCHAR <c-array>
[ SHGetFolderPath ] keep
swap win32-error
swap ole32-error
utf16n alien>string ;
PRIVATE>

View File

@ -1402,7 +1402,8 @@ ALIAS: GetSystemWindowsDirectory GetSystemWindowsDirectoryW
! FUNCTION: GetTempFileNameA
! FUNCTION: GetTempFileNameW
! FUNCTION: GetTempPathA
! FUNCTION: GetTempPathW
FUNCTION: DWORD GetTempPathW ( DWORD nBufferLength, LPWSTR lpBuffer ) ;
ALIAS: GetTempPath GetTempPathW
! FUNCTION: GetThreadContext
! FUNCTION: GetThreadIOPendingFlag
! FUNCTION: GetThreadLocale