]> gitweb.factorcode.org Git - factor.git/commitdiff
fix windows test failures
authorJoe Groff <arcata@gmail.com>
Sat, 19 Sep 2009 15:01:12 +0000 (10:01 -0500)
committerJoe Groff <arcata@gmail.com>
Sat, 19 Sep 2009 15:01:12 +0000 (10:01 -0500)
basis/io/backend/windows/nt/privileges/privileges.factor
basis/windows/types/types.factor

index bb075233bd462f3ff8cfdf3492d053a8ad005769..6022e91efdcbf4c4e3280c659390d642bc646bee 100755 (executable)
@@ -1,6 +1,6 @@
 USING: alien alien.c-types alien.data alien.syntax arrays continuations
 destructors generic io.mmap io.ports io.backend.windows io.files.windows
-kernel libc math math.bitwise namespaces quotations sequences windows
+kernel libc locals math math.bitwise namespaces quotations sequences windows
 windows.advapi32 windows.kernel32 windows.types io.backend system accessors
 io.backend.windows.privileges classes.struct windows.errors ;
 IN: io.backend.windows.nt.privileges
@@ -28,17 +28,16 @@ TYPEDEF: TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES
     [ f ] dip LUID <struct>
     [ LookupPrivilegeValue win32-error=0/f ] keep ;
 
-: make-token-privileges ( name ? -- obj )
+:: make-token-privileges ( name enabled? -- obj )
     TOKEN_PRIVILEGES <struct>
         1 >>PrivilegeCount
         LUID_AND_ATTRIBUTES malloc-struct &free
-            swap [ SE_PRIVILEGE_ENABLED >>Attributes ] when
-        >>Privileges
-    [ lookup-privilege ] dip
-    [ Privileges>> (>>Luid) ] keep ;
+            enabled? [ SE_PRIVILEGE_ENABLED >>Attributes ] when
+            name lookup-privilege >>Luid
+        >>Privileges ;
 
 M: winnt set-privilege ( name ? -- )
     [
         -rot 0 -rot make-token-privileges
-        dup length f f AdjustTokenPrivileges win32-error=0/f
+        dup byte-length f f AdjustTokenPrivileges win32-error=0/f
     ] with-process-token ;
index fa043b8033ba4952f1e2d54adb7651b7af583759..bac9ebf3725c4f3c8999e6a706ea3413125cd825 100755 (executable)
@@ -11,6 +11,12 @@ TYPEDEF: uchar               UCHAR
 TYPEDEF: uchar               BYTE
 
 TYPEDEF: ushort              wchar_t
+SYMBOL: wchar_t*
+<<
+{ char* utf16n } \ wchar_t* typedef
+wchar_t wchar_t* "pointer-c-type" set-word-prop
+>>
+
 TYPEDEF: wchar_t             WCHAR
 
 TYPEDEF: short               SHORT
@@ -70,9 +76,6 @@ TYPEDEF: ulonglong   ULARGE_INTEGER
 TYPEDEF: LARGE_INTEGER* PLARGE_INTEGER
 TYPEDEF: ULARGE_INTEGER* PULARGE_INTEGER
 
-SYMBOL: wchar_t*
-<< { char* utf16n } \ wchar_t* typedef >>
-
 TYPEDEF: wchar_t*  LPCSTR
 TYPEDEF: wchar_t*  LPWSTR
 TYPEDEF: WCHAR       TCHAR