From 8b9b8df457d7c8f496b9739767e3629df34e7faf Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 31 Mar 2012 17:11:38 -0700 Subject: [PATCH] io.files.temp.windows: fix up --- basis/io/files/temp/windows/windows.factor | 14 +++++++++----- basis/windows/kernel32/kernel32.factor | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/basis/io/files/temp/windows/windows.factor b/basis/io/files/temp/windows/windows.factor index 95ab4a35c3..66e9e94bf7 100644 --- a/basis/io/files/temp/windows/windows.factor +++ b/basis/io/files/temp/windows/windows.factor @@ -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 [ GetTempPath ] keep - swap win32-error + MAX_PATH 1 + dup WCHAR [ 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 + MAX_PATH 1 + WCHAR [ SHGetFolderPath ] keep - swap win32-error + swap ole32-error utf16n alien>string ; PRIVATE> diff --git a/basis/windows/kernel32/kernel32.factor b/basis/windows/kernel32/kernel32.factor index 8cb41106fc..7cdacabb8b 100644 --- a/basis/windows/kernel32/kernel32.factor +++ b/basis/windows/kernel32/kernel32.factor @@ -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 -- 2.34.1