From b7eff85fe09be0e0cd6255b65fc467f0d1162776 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 19 Sep 2009 10:01:12 -0500 Subject: [PATCH] fix windows test failures --- .../backend/windows/nt/privileges/privileges.factor | 13 ++++++------- basis/windows/types/types.factor | 9 ++++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/basis/io/backend/windows/nt/privileges/privileges.factor b/basis/io/backend/windows/nt/privileges/privileges.factor index bb075233bd..6022e91efd 100755 --- a/basis/io/backend/windows/nt/privileges/privileges.factor +++ b/basis/io/backend/windows/nt/privileges/privileges.factor @@ -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 [ LookupPrivilegeValue win32-error=0/f ] keep ; -: make-token-privileges ( name ? -- obj ) +:: make-token-privileges ( name enabled? -- obj ) TOKEN_PRIVILEGES 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 ; diff --git a/basis/windows/types/types.factor b/basis/windows/types/types.factor index fa043b8033..bac9ebf372 100755 --- a/basis/windows/types/types.factor +++ b/basis/windows/types/types.factor @@ -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 -- 2.34.1