]> gitweb.factorcode.org Git - factor.git/commitdiff
finish fixing the using list for windows.errors, more ffi bindings
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Apr 2009 15:25:59 +0000 (10:25 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Apr 2009 15:25:59 +0000 (10:25 -0500)
basis/io/backend/windows/nt/privileges/privileges.factor
basis/io/mmap/windows/windows.factor
basis/windows/advapi32/advapi32.factor
extra/game-input/dinput/dinput.factor
extra/system-info/windows/nt/nt.factor
extra/system-info/windows/windows.factor

index 64218f75b00d0a90d398b969211cf1f1c305cbbf..33577a9394087069c06c89ad1a4f9f0cd279c6cb 100755 (executable)
@@ -2,7 +2,7 @@ USING: alien alien.c-types alien.syntax arrays continuations
 destructors generic io.mmap io.ports io.backend.windows io.files.windows\r
 kernel libc math math.bitwise namespaces quotations sequences windows\r
 windows.advapi32 windows.kernel32 io.backend system accessors\r
-io.backend.windows.privileges ;\r
+io.backend.windows.privileges windows.errors ;\r
 IN: io.backend.windows.nt.privileges\r
 \r
 TYPEDEF: TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES\r
index ebd8109d14e8c82b90b7f687af385e8a81133551..8fdc7fefd9b89dc7c4ae23809935c2ec052be3ce 100644 (file)
@@ -2,7 +2,7 @@ USING: alien alien.c-types arrays destructors generic io.mmap
 io.ports io.backend.windows io.files.windows io.backend.windows.privileges
 kernel libc math math.bitwise namespaces quotations sequences
 windows windows.advapi32 windows.kernel32 io.backend system
-accessors locals ;
+accessors locals windows.errors ;
 IN: io.mmap.windows
 
 : create-file-mapping ( hFile lpAttributes flProtect dwMaximumSizeHigh dwMaximumSizeLow lpName -- HANDLE )
@@ -12,8 +12,8 @@ IN: io.mmap.windows
     MapViewOfFile [ win32-error=0/f ] keep ;
 
 :: mmap-open ( path length access-mode create-mode protect access -- handle handle address )
-    [let | lo [ length HEX: ffffffff bitand ]
-           hi [ length -32 shift HEX: ffffffff bitand ] |
+    [let | lo [ length 32 bits ]
+           hi [ length -32 shift 32 bits ] |
         { "SeCreateGlobalPrivilege" "SeLockMemoryPrivilege" } [
             path access-mode create-mode 0 open-file |dispose
             dup handle>> f protect hi lo f create-file-mapping |dispose
index f715af378b651dbbcc8d666da96ffc73cb605bd3..fd037cb2a01091380bfb660af49bdd0bff4983e8 100644 (file)
@@ -894,15 +894,52 @@ FUNCTION: LONG RegCreateKeyExW ( HKEY hKey, LPCTSTR lpSubKey, DWORD Reserved, LP
 ! : RegCreateKeyW
 ! : RegDeleteKeyA ;
 ! : RegDeleteKeyW ;
+
+FUNCTION: LONG RegDeleteKeyExW (
+        HKEY hKey,
+        LPCTSTR lpSubKey,
+        DWORD Reserved,
+        LPTSTR lpClass,
+        DWORD dwOptions,
+        REGSAM samDesired,
+        LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+        PHKEY phkResult,
+        LPDWORD lpdwDisposition
+    ) ;
+
+ALIAS: RegDeleteKeyEx RegDeleteKeyExW
+
 ! : RegDeleteValueA ;
 ! : RegDeleteValueW ;
 ! : RegDisablePredefinedCache ;
 ! : RegEnumKeyA ;
 ! : RegEnumKeyExA ;
-! : RegEnumKeyExW ;
+FUNCTION: LONG RegEnumKeyExW (
+        HKEY hKey,
+        DWORD dwIndex,
+        LPTSTR lpName,
+        LPDWORD lpcName,
+        LPDWORD lpReserved,
+        LPTSTR lpClass,
+        LPDWORD lpcClass,
+        PFILETIME lpftLastWriteTime
+    ) ;
 ! : RegEnumKeyW ;
 ! : RegEnumValueA ;
-! : RegEnumValueW ;
+
+FUNCTION: LONG RegEnumValueW (
+        HKEY hKey,
+        DWORD dwIndex,
+        LPTSTR lpValueName,
+        LPDWORD lpcchValueName,
+        LPDWORD lpReserved,
+        LPDWORD lpType,
+        LPBYTE lpData,
+        LPDWORD lpcbData
+    ) ;
+
+ALIAS: RegEnumValue RegEnumValueW
+
 ! : RegFlushKey ;
 ! : RegGetKeySecurity ;
 ! : RegLoadKeyA ;
index a2beaf6d9bb6682ce285ddf2184cff412fec9088..ce87c1223786a2611e1ff4578dde6020cb3a8caa 100755 (executable)
@@ -2,10 +2,10 @@ USING: windows.dinput windows.dinput.constants parser
 alien.c-types windows.ole32 namespaces assocs kernel arrays
 vectors windows.kernel32 windows.com windows.dinput shuffle
 windows.user32 windows.messages sequences combinators locals
-math.rectangles accessors math windows alien
-alien.strings io.encodings.utf16 io.encodings.utf16n
-continuations byte-arrays game-input.dinput.keys-array
-game-input ui.backend.windows ;
+math.rectangles accessors math alien alien.strings
+io.encodings.utf16 io.encodings.utf16n continuations
+byte-arrays game-input.dinput.keys-array game-input
+ui.backend.windows windows.errors ;
 IN: game-input.dinput
 
 SINGLETON: dinput-game-input-backend
index 7f71e08e836b84e60eff6a4ad649766ac070a47a..5be2dc89e2fbbc96f120901d512f5c58e0c9abaa 100755 (executable)
@@ -3,7 +3,7 @@
 USING: alien alien.c-types alien.strings
 kernel libc math namespaces system-info.backend
 system-info.windows windows windows.advapi32
-windows.kernel32 system byte-arrays ;
+windows.kernel32 system byte-arrays windows.errors ;
 IN: system-info.windows.nt
 
 M: winnt cpus ( -- n )
@@ -41,6 +41,6 @@ M: winnt available-virtual-mem ( -- n )
     GetComputerName win32-error=0/f alien>native-string ;
  
 : username ( -- string )
-    UNLEN 1+
+    UNLEN 1 +
     [ <byte-array> dup ] keep <uint>
     GetUserName win32-error=0/f alien>native-string ;
index 66abb59ee9aca43c5a5f179b368d6530c3b29b2c..4d2343013125567d4c873bfc7ba93df57acf77e7 100755 (executable)
@@ -3,7 +3,7 @@
 USING: alien alien.c-types kernel libc math namespaces
 windows windows.kernel32 windows.advapi32
 words combinators vocabs.loader system-info.backend
-system alien.strings ;
+system alien.strings windows.errors ;
 IN: system-info.windows
 
 : system-info ( -- SYSTEM_INFO )