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