mirror of
https://github.com/reactos/wine.git
synced 2025-02-07 04:29:02 +00:00
advapi32/tests: Don't test function directly when reporting GetLastError().
This commit is contained in:
parent
145031b8d4
commit
92f9cb6c5d
@ -156,10 +156,10 @@ static void test_CredReadDomainCredentialsA(void)
|
|||||||
* does not check for NULL output pointers and try to zero them out early */
|
* does not check for NULL output pointers and try to zero them out early */
|
||||||
if(0)
|
if(0)
|
||||||
{
|
{
|
||||||
ok(!pCredReadDomainCredentialsA(&info, 0, NULL, &creds) &&
|
ret = pCredReadDomainCredentialsA(&info, 0, NULL, &creds);
|
||||||
GetLastError() == ERROR_INVALID_PARAMETER, "!\n");
|
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "!\n");
|
||||||
ok(!pCredReadDomainCredentialsA(&info, 0, &count, NULL) &&
|
ret = pCredReadDomainCredentialsA(&info, 0, &count, NULL);
|
||||||
GetLastError() == ERROR_INVALID_PARAMETER, "!\n");
|
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
|
@ -2293,8 +2293,8 @@ static void test_process_security(void)
|
|||||||
psa.bInheritHandle = TRUE;
|
psa.bInheritHandle = TRUE;
|
||||||
|
|
||||||
/* Doesn't matter what ACL say we should get full access for ourselves */
|
/* Doesn't matter what ACL say we should get full access for ourselves */
|
||||||
ok(CreateProcessA( NULL, buffer, &psa, NULL, FALSE, 0, NULL, NULL, &startup, &info ),
|
res = CreateProcessA( NULL, buffer, &psa, NULL, FALSE, 0, NULL, NULL, &startup, &info );
|
||||||
"CreateProcess with err:%d\n", GetLastError());
|
ok(res, "CreateProcess with err:%d\n", GetLastError());
|
||||||
TEST_GRANTED_ACCESS2( info.hProcess, PROCESS_ALL_ACCESS,
|
TEST_GRANTED_ACCESS2( info.hProcess, PROCESS_ALL_ACCESS,
|
||||||
STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL );
|
STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL );
|
||||||
winetest_wait_child_process( info.hProcess );
|
winetest_wait_child_process( info.hProcess );
|
||||||
@ -3008,6 +3008,7 @@ static void test_PrivateObjectSecurity(void)
|
|||||||
LPSTR string;
|
LPSTR string;
|
||||||
ULONG len;
|
ULONG len;
|
||||||
PSECURITY_DESCRIPTOR buf;
|
PSECURITY_DESCRIPTOR buf;
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
if (!pConvertStringSecurityDescriptorToSecurityDescriptorA)
|
if (!pConvertStringSecurityDescriptorToSecurityDescriptorA)
|
||||||
{
|
{
|
||||||
@ -3046,25 +3047,26 @@ static void test_PrivateObjectSecurity(void)
|
|||||||
GetSecurityDescriptorControl(sec, &ctrl, &dwRevision);
|
GetSecurityDescriptorControl(sec, &ctrl, &dwRevision);
|
||||||
expect_eq(ctrl, 0x9014, int, "%x");
|
expect_eq(ctrl, 0x9014, int, "%x");
|
||||||
|
|
||||||
ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION, buf, dwDescSize, &retSize),
|
ret = GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION, buf, dwDescSize, &retSize);
|
||||||
"GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
|
ok(ret, "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
|
||||||
ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
|
ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
|
||||||
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
||||||
CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576");
|
CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576");
|
||||||
GetSecurityDescriptorControl(buf, &ctrl, &dwRevision);
|
GetSecurityDescriptorControl(buf, &ctrl, &dwRevision);
|
||||||
expect_eq(ctrl, 0x8000, int, "%x");
|
expect_eq(ctrl, 0x8000, int, "%x");
|
||||||
|
|
||||||
ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, buf, dwDescSize, &retSize),
|
ret = GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, buf, dwDescSize, &retSize);
|
||||||
"GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
|
ok(ret, "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
|
||||||
ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
|
ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
|
||||||
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed err=%u\n", GetLastError());
|
ret = pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len);
|
||||||
|
ok(ret, "Conversion failed err=%u\n", GetLastError());
|
||||||
CHECK_ONE_OF_AND_FREE("G:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)",
|
CHECK_ONE_OF_AND_FREE("G:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)",
|
||||||
"G:S-1-5-21-93476-23408-4576D:P(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"); /* Win7 */
|
"G:S-1-5-21-93476-23408-4576D:P(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"); /* Win7 */
|
||||||
GetSecurityDescriptorControl(buf, &ctrl, &dwRevision);
|
GetSecurityDescriptorControl(buf, &ctrl, &dwRevision);
|
||||||
expect_eq(ctrl & (~ SE_DACL_PROTECTED), 0x8004, int, "%x");
|
expect_eq(ctrl & (~ SE_DACL_PROTECTED), 0x8004, int, "%x");
|
||||||
|
|
||||||
ok(GetPrivateObjectSecurity(sec, sec_info, buf, dwDescSize, &retSize),
|
ret = GetPrivateObjectSecurity(sec, sec_info, buf, dwDescSize, &retSize);
|
||||||
"GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
|
ok(ret, "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
|
||||||
ok(retSize == dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
|
ok(retSize == dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
|
||||||
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
||||||
CHECK_ONE_OF_AND_FREE("O:SY"
|
CHECK_ONE_OF_AND_FREE("O:SY"
|
||||||
|
@ -1840,9 +1840,10 @@ static void test_sequence(void)
|
|||||||
}
|
}
|
||||||
ok(!strcmp(config->lpServiceStartName, localsystem), "Expected 'LocalSystem', got '%s'\n", config->lpServiceStartName);
|
ok(!strcmp(config->lpServiceStartName, localsystem), "Expected 'LocalSystem', got '%s'\n", config->lpServiceStartName);
|
||||||
ok(!strcmp(config->lpDisplayName, displayname), "Expected '%s', got '%s'\n", displayname, config->lpDisplayName);
|
ok(!strcmp(config->lpDisplayName, displayname), "Expected '%s', got '%s'\n", displayname, config->lpDisplayName);
|
||||||
|
|
||||||
ok(ChangeServiceConfigA(svc_handle, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE, SERVICE_ERROR_NORMAL, NULL, "TestGroup2", NULL, NULL, NULL, NULL, displayname2),
|
ret = ChangeServiceConfigA(svc_handle, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE, SERVICE_ERROR_NORMAL, NULL, "TestGroup2",
|
||||||
"ChangeServiceConfig failed (err=%d)\n", GetLastError());
|
NULL, NULL, NULL, NULL, displayname2);
|
||||||
|
ok(ret, "ChangeServiceConfig failed (err=%d)\n", GetLastError());
|
||||||
|
|
||||||
QueryServiceConfigA(svc_handle, NULL, 0, &needed);
|
QueryServiceConfigA(svc_handle, NULL, 0, &needed);
|
||||||
config = HeapReAlloc(GetProcessHeap(), 0, config, needed);
|
config = HeapReAlloc(GetProcessHeap(), 0, config, needed);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user