advapi32/tests: Remove superfluous pointer casts.
This commit is contained in:
parent
7eb3abc1c1
commit
2fc7b81009
|
@ -461,8 +461,8 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam
|
|||
RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
(*pcbProvName)++;
|
||||
|
||||
if (!(*pszProvName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbProvName))))
|
||||
|
||||
if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName)))
|
||||
return FALSE;
|
||||
|
||||
RegEnumKeyEx(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL);
|
||||
|
@ -518,7 +518,7 @@ static void test_enum_providers(void)
|
|||
/* alloc provider to half the size required
|
||||
* cbName holds the size required */
|
||||
providerLen = cbName / 2;
|
||||
if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen))))
|
||||
if (!(provider = LocalAlloc(LMEM_ZEROINIT, providerLen)))
|
||||
return;
|
||||
|
||||
result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, provider, &providerLen);
|
||||
|
@ -546,7 +546,7 @@ static void test_enum_providers(void)
|
|||
/* check expected versus actual values returned */
|
||||
result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, NULL, &providerLen);
|
||||
ok(result && providerLen==cbName, "expected %i, got %i\n", (int)cbName, (int)providerLen);
|
||||
if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen))))
|
||||
if (!(provider = LocalAlloc(LMEM_ZEROINIT, providerLen)))
|
||||
return;
|
||||
|
||||
providerLen = 0xdeadbeef;
|
||||
|
@ -670,7 +670,7 @@ static void test_enum_provider_types(void)
|
|||
/* alloc provider type to half the size required
|
||||
* cbTypeName holds the size required */
|
||||
typeNameSize = cbTypeName / 2;
|
||||
if (!(typeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, typeNameSize))))
|
||||
if (!(typeName = LocalAlloc(LMEM_ZEROINIT, typeNameSize)))
|
||||
goto cleanup;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
|
@ -700,7 +700,7 @@ static void test_enum_provider_types(void)
|
|||
/* check expected versus actual values returned */
|
||||
result = pCryptEnumProviderTypesA(index, NULL, 0, &provType, NULL, &typeNameSize);
|
||||
ok(result && typeNameSize==cbTypeName, "expected %d, got %d\n", cbTypeName, typeNameSize);
|
||||
if (!(typeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, typeNameSize))))
|
||||
if (!(typeName = LocalAlloc(LMEM_ZEROINIT, typeNameSize)))
|
||||
goto cleanup;
|
||||
|
||||
typeNameSize = 0xdeadbeef;
|
||||
|
|
|
@ -259,7 +259,7 @@ static void test_SystemFunction004(void)
|
|||
key.Length = 0x100;
|
||||
key.MaximumLength = 0x100;
|
||||
|
||||
r = pSystemFunction004(&in, &key, (struct ustring *)&out);
|
||||
r = pSystemFunction004(&in, &key, &out);
|
||||
ok(r == STATUS_BUFFER_TOO_SMALL, "function failed\n");
|
||||
|
||||
in.Buffer = inbuf;
|
||||
|
|
|
@ -49,7 +49,7 @@ fnSystemFunction007 pSystemFunction007;
|
|||
md4hashfunc pSystemFunction010;
|
||||
md4hashfunc pSystemFunction011;
|
||||
|
||||
#define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD4_CTX, in ) )
|
||||
#define ctxcmp( a, b ) memcmp( a, b, FIELD_OFFSET( MD4_CTX, in ) )
|
||||
|
||||
static void test_md4_ctx(void)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ fnMD5Init pMD5Init;
|
|||
fnMD5Update pMD5Update;
|
||||
fnMD5Final pMD5Final;
|
||||
|
||||
#define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD5_CTX, in ) )
|
||||
#define ctxcmp( a, b ) memcmp( a, b, FIELD_OFFSET( MD5_CTX, in ) )
|
||||
|
||||
static void test_md5_ctx(void)
|
||||
{
|
||||
|
|
|
@ -240,7 +240,7 @@ static void test_sid(void)
|
|||
GetLastError() );
|
||||
|
||||
ok(pConvertStringSidToSidA("S-1-5-21-93476-23408-4576", &psid), "ConvertStringSidToSidA failed\n");
|
||||
pisid = (SID *)psid;
|
||||
pisid = psid;
|
||||
ok(pisid->SubAuthorityCount == 4, "Invalid sub authority count - expected 4, got %d\n", pisid->SubAuthorityCount);
|
||||
ok(pisid->SubAuthority[0] == 21, "Invalid subauthority 0 - expceted 21, got %d\n", pisid->SubAuthority[0]);
|
||||
ok(pisid->SubAuthority[3] == 4576, "Invalid subauthority 0 - expceted 4576, got %d\n", pisid->SubAuthority[3]);
|
||||
|
@ -266,7 +266,7 @@ static void test_sid(void)
|
|||
|
||||
r = pConvertStringSidToSidA( refs[i].refStr, &psid );
|
||||
ok( r, "failed to parse sid string\n" );
|
||||
pisid = (PISID)psid;
|
||||
pisid = psid;
|
||||
ok( pisid &&
|
||||
!memcmp( pisid->IdentifierAuthority.Value, refs[i].auth.Value,
|
||||
sizeof(refs[i].auth) ),
|
||||
|
@ -373,7 +373,7 @@ static void test_trustee(void)
|
|||
"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" );
|
||||
ok( trustee.ptstrName == psid, "ptstrName wrong\n" );
|
||||
|
||||
/* test BuildTrusteeWithObjectsAndSidA (test 1) */
|
||||
memset( &trustee, 0xff, sizeof trustee );
|
||||
|
@ -2215,7 +2215,7 @@ static void test_SetEntriesInAcl(void)
|
|||
ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
|
||||
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID;
|
||||
ExplicitAccess.Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
|
||||
ExplicitAccess.Trustee.ptstrName = (LPWSTR)EveryoneSid;
|
||||
ExplicitAccess.Trustee.ptstrName = EveryoneSid;
|
||||
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
|
||||
ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res);
|
||||
ok(NewAcl != NULL, "returned acl was NULL\n");
|
||||
|
@ -2263,7 +2263,7 @@ static void test_SetEntriesInAcl(void)
|
|||
|
||||
ExplicitAccess.grfAccessMode = REVOKE_ACCESS;
|
||||
ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID;
|
||||
ExplicitAccess.Trustee.ptstrName = (LPWSTR)UsersSid;
|
||||
ExplicitAccess.Trustee.ptstrName = UsersSid;
|
||||
res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl);
|
||||
ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res);
|
||||
ok(NewAcl != NULL, "returned acl was NULL\n");
|
||||
|
@ -2508,17 +2508,17 @@ static void test_ConvertSecurityDescriptorToString()
|
|||
|
||||
size = 4096;
|
||||
pCreateWellKnownSid(WinLocalSid, NULL, sid_buf, &size);
|
||||
SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, FALSE);
|
||||
SetSecurityDescriptorOwner(&desc, sid_buf, FALSE);
|
||||
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
||||
CHECK_RESULT_AND_FREE("O:S-1-2-0");
|
||||
|
||||
SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE);
|
||||
SetSecurityDescriptorOwner(&desc, sid_buf, TRUE);
|
||||
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
||||
CHECK_RESULT_AND_FREE("O:S-1-2-0");
|
||||
|
||||
size = sizeof(sid_buf);
|
||||
pCreateWellKnownSid(WinLocalSystemSid, NULL, sid_buf, &size);
|
||||
SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE);
|
||||
SetSecurityDescriptorOwner(&desc, sid_buf, TRUE);
|
||||
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
|
||||
CHECK_RESULT_AND_FREE("O:SY");
|
||||
|
||||
|
|
Loading…
Reference in New Issue