fix windows test failures

Joe Groff 2009-09-19 10:01:12 -05:00
parent d7a77886b8
commit 0e21c2b81e
2 changed files with 12 additions and 10 deletions

View File

@ -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 ;

View File

@ -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