Fix BuildTrusteeWithSid, implement and test BuildTrusteeWithName.

This commit is contained in:
Mike McCormack 2004-08-19 19:01:12 +00:00 committed by Alexandre Julliard
parent cc3af24375
commit e27ae38f01
3 changed files with 45 additions and 7 deletions

View File

@ -20,8 +20,8 @@
@ stdcall BackupEventLogW (long wstr)
@ stub BuildExplicitAccessWithNameA
@ stub BuildExplicitAccessWithNameW
@ stub BuildTrusteeWithNameA # (ptr str)
@ stub BuildTrusteeWithNameW # (ptr wstr)
@ stdcall BuildTrusteeWithNameA(ptr str)
@ stdcall BuildTrusteeWithNameW(ptr wstr)
@ stub BuildTrusteeWithObjectsAndNameA # (ptr ptr long str str str)
@ stub BuildTrusteeWithObjectsAndNameW # (ptr ptr long wstr wstr wstr)
@ stub BuildTrusteeWithObjectsAndSidA # (ptr ptr ptr ptr ptr)

View File

@ -1519,8 +1519,7 @@ VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid)
pTrustee->pMultipleTrustee = NULL;
pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
pTrustee->TrusteeForm = NO_MULTIPLE_TRUSTEE;
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->TrusteeForm = TRUSTEE_IS_SID;
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->ptstrName = (LPSTR) pSid;
}
@ -1534,12 +1533,39 @@ VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid)
pTrustee->pMultipleTrustee = NULL;
pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
pTrustee->TrusteeForm = NO_MULTIPLE_TRUSTEE;
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->TrusteeForm = TRUSTEE_IS_SID;
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->ptstrName = (LPWSTR) pSid;
}
/******************************************************************************
* BuildTrusteeWithNameA [ADVAPI32.@]
*/
VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR name)
{
TRACE("%p %s\n", pTrustee, debugstr_a(name) );
pTrustee->pMultipleTrustee = NULL;
pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->ptstrName = name;
}
/******************************************************************************
* BuildTrusteeWithNameW [ADVAPI32.@]
*/
VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR name)
{
TRACE("%p %s\n", pTrustee, debugstr_w(name) );
pTrustee->pMultipleTrustee = NULL;
pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->ptstrName = name;
}
/******************************************************************************
* SetEntriesInAclA [ADVAPI32.@]
*/

View File

@ -62,6 +62,7 @@ void test_trustee()
TRUSTEE trustee;
PSID psid;
DWORD r;
LPSTR str = "2jjj";
SID_IDENTIFIER_AUTHORITY auth = { {0x11,0x22,0,0,0, 0} };
@ -78,8 +79,19 @@ void test_trustee()
ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
ok( trustee.ptstrName == (LPSTR) psid, "ptstrName wrong\n" );
FreeSid( psid );
}
/* test BuildTrusteeWithNameA */
memset( &trustee, 0xff, sizeof trustee );
BuildTrusteeWithNameA( &trustee, str );
ok( trustee.pMultipleTrustee == NULL, "pMultipleTrustee wrong\n");
ok( trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE,
"MultipleTrusteeOperation wrong\n");
ok( trustee.TrusteeForm == TRUSTEE_IS_NAME, "TrusteeForm wrong\n");
ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n");
ok( trustee.ptstrName == str, "ptstrName wrong\n" );
}
START_TEST(security)
{
test_sid();