From e63e96d7e14e3059a2514036b8bf7443d55264ed Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 5 Dec 2007 01:04:23 -0600 Subject: [PATCH] Add word to get windows directory --- extra/hardware-info/windows/windows.factor | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/extra/hardware-info/windows/windows.factor b/extra/hardware-info/windows/windows.factor index bbae541ab4..88e9a8cfb5 100644 --- a/extra/hardware-info/windows/windows.factor +++ b/extra/hardware-info/windows/windows.factor @@ -1,5 +1,6 @@ USING: alien alien.c-types kernel libc math namespaces -windows windows.kernel32 windows.advapi32 hardware-info ; +windows windows.kernel32 windows.advapi32 hardware-info +words ; IN: hardware-info.windows TUPLE: wince ; @@ -53,6 +54,22 @@ M: windows cpus ( -- n ) : sse3? ( -- ? ) PF_SSE3_INSTRUCTIONS_AVAILABLE feature-present? ; +: ( n -- obj ) + "ushort" ; + +: get-directory ( word -- str ) + >r MAX_UNICODE_PATH [ ] keep dupd r> + execute win32-error=0/f alien>u16-string ; inline + +: windows-directory ( -- str ) + \ GetWindowsDirectory get-directory ; + +: system-directory ( -- str ) + \ GetSystemDirectory get-directory ; + +: system-windows-directory ( -- str ) + \ GetSystemWindowsDirectory get-directory ; + USE-IF: wince? hardware-info.windows.ce USE-IF: winnt? hardware-info.windows.nt