ADVAPI32: declaration, implemention and test for BuildTrusteeWithSid

Mike McCormack mike at codeweavers.com
Sun Aug 15 05:31:23 CDT 2004


ChangeLog:
* declaration, implemention and test for BuildTrusteeWithSid
-------------- next part --------------
Index: include/aclapi.h
===================================================================
RCS file: /home/wine/wine/include/aclapi.h,v
retrieving revision 1.2
diff -u -r1.2 aclapi.h
--- include/aclapi.h	6 Jul 2004 18:44:18 -0000	1.2
+++ include/aclapi.h	15 Aug 2004 09:07:00 -0000
@@ -72,6 +72,10 @@
     POBJECTS_AND_SID, GUID*, GUID*, PSID );
 #define     BuildTrusteeWithObjectsAndSid WINELIB_NAME_AW(BuildTrusteeWithObjectsAndSid)
 
+VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid);
+VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid);
+#define     BuildTrusteeWithSid WINELIB_NAME_AW(BuildTrusteeWithSid)
+
 #ifdef __cplusplus
 }
 #endif
Index: dlls/advapi32/security.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/security.c,v
retrieving revision 1.75
diff -u -r1.75 security.c
--- dlls/advapi32/security.c	13 Aug 2004 23:55:43 -0000	1.75
+++ dlls/advapi32/security.c	15 Aug 2004 09:07:01 -0000
@@ -1505,7 +1486,14 @@
  */
 VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid)
 {
-    FIXME("%p %p\n", pTrustee, pSid);
+    TRACE("%p %p\n", pTrustee, pSid);
+
+    pTrustee->pMultipleTrustee = NULL;
+    pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+    pTrustee->TrusteeForm = NO_MULTIPLE_TRUSTEE;
+    pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+    pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+    pTrustee->ptstrName = (LPSTR) pSid;
 }
 
 /******************************************************************************
@@ -1513,7 +1501,14 @@
  */
 VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid)
 {
-    FIXME("%p %p\n", pTrustee, pSid);
+    TRACE("%p %p\n", pTrustee, pSid);
+
+    pTrustee->pMultipleTrustee = NULL;
+    pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+    pTrustee->TrusteeForm = NO_MULTIPLE_TRUSTEE;
+    pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+    pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+    pTrustee->ptstrName = (LPWSTR) pSid;
 }
 
 /******************************************************************************
Index: dlls/advapi32/tests/security.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/tests/security.c,v
retrieving revision 1.1
diff -u -r1.1 security.c
--- dlls/advapi32/tests/security.c	9 Aug 2004 18:47:22 -0000	1.1
+++ dlls/advapi32/tests/security.c	15 Aug 2004 09:07:01 -0000
@@ -24,6 +24,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
+#include "aclapi.h"
 
 typedef BOOL (WINAPI *fnConvertSidToStringSidA)( PSID pSid, LPSTR *str );
 typedef BOOL (WINAPI *fnConvertSidToStringSidW)( PSID pSid, LPWSTR *str );
@@ -53,9 +54,34 @@
     ok( r, "failed to convert sid\n" );
     ok( !lstrcmpW( str, refstr ), "incorrect sid\n" );
     LocalFree( str );
+    FreeSid( psid );
+}
+
+void test_trustee()
+{
+    TRUSTEE trustee;
+    PSID psid;
+    DWORD r;
+
+    SID_IDENTIFIER_AUTHORITY auth = { {0x11,0x22,0,0,0, 0} };
+
+    r = AllocateAndInitializeSid( &auth, 1, 42, 0,0,0,0,0,0,0,&psid );
+    ok( r, "failed to init SID\n" );
+
+    memset( &trustee, 0xff, sizeof trustee );
+    BuildTrusteeWithSidA( &trustee, psid );
+
+    ok( trustee.pMultipleTrustee == NULL, "pMultipleTrustee wrong\n");
+    ok( trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE, 
+        "MultipleTrusteeOperation wrong\n");
+    ok( trustee.TrusteeForm == TRUSTEE_IS_SID, "TrusteeForm wrong\n");
+    ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
+    ok( trustee.ptstrName == (LPSTR) psid, "ptstrName wrong\n" );
+    FreeSid( psid );
 }
 
 START_TEST(security)
 {
     test_sid();
+    test_trustee();
 }


More information about the wine-patches mailing list