Commit ae0bddeb authored by Nicolas Le Cam's avatar Nicolas Le Cam Committed by Alexandre Julliard

advapi32/tests: Run a test on more platforms.

parent f714cf4b
...@@ -560,7 +560,7 @@ static void test_enum_providers(void) ...@@ -560,7 +560,7 @@ static void test_enum_providers(void)
LocalFree(provider); LocalFree(provider);
} }
static BOOL FindProvTypesRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszTypeName, static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *pszTypeName,
DWORD *pcbTypeName, DWORD *pdwTypeCount) DWORD *pcbTypeName, DWORD *pdwTypeCount)
{ {
HKEY hKey; HKEY hKey;
...@@ -581,33 +581,43 @@ static BOOL FindProvTypesRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszTy ...@@ -581,33 +581,43 @@ static BOOL FindProvTypesRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszTy
if (!(szName = LocalAlloc(LMEM_ZEROINIT, cbName))) if (!(szName = LocalAlloc(LMEM_ZEROINIT, cbName)))
goto cleanup; goto cleanup;
if (RegEnumKeyEx(hKey, dwIndex, szName, &cbName, NULL, NULL, NULL, NULL)) while (!RegEnumKeyEx(hKey, *pdwIndex, szName, &cbName, NULL, NULL, NULL, NULL))
goto cleanup; {
cbName++; cbName++;
ch = szName + strlen(szName); ch = szName + strlen(szName);
/* Convert "Type 000" to 0, etc/ */ /* Convert "Type 000" to 0, etc/ */
*pdwProvType = *(--ch) - '0'; *pdwProvType = *(--ch) - '0';
*pdwProvType += (*(--ch) - '0') * 10; *pdwProvType += (*(--ch) - '0') * 10;
*pdwProvType += (*(--ch) - '0') * 100; *pdwProvType += (*(--ch) - '0') * 100;
if (RegOpenKey(hKey, szName, &hSubKey)) if (RegOpenKey(hKey, szName, &hSubKey))
goto cleanup; break;
if (RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName)) if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName))
goto cleanup; {
if (!(*pszTypeName = LocalAlloc(LMEM_ZEROINIT, *pcbTypeName)))
break;
if (!(*pszTypeName = LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))) if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, (LPBYTE)*pszTypeName, pcbTypeName))
goto cleanup; {
ret = TRUE;
break;
}
if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, (LPBYTE)*pszTypeName, pcbTypeName)) LocalFree(*pszTypeName);
ret = TRUE; }
RegCloseKey(hSubKey);
(*pdwIndex)++;
}
cleanup:
if (!ret) if (!ret)
LocalFree(*pszTypeName); LocalFree(*pszTypeName);
RegCloseKey(hSubKey);
LocalFree(szName); LocalFree(szName);
RegCloseKey(hSubKey); cleanup:
RegCloseKey(hKey); RegCloseKey(hKey);
return ret; return ret;
...@@ -616,7 +626,7 @@ cleanup: ...@@ -616,7 +626,7 @@ cleanup:
static void test_enum_provider_types(void) static void test_enum_provider_types(void)
{ {
/* expected values */ /* expected values */
DWORD dwProvType; DWORD dwProvType = 0;
LPSTR pszTypeName = NULL; LPSTR pszTypeName = NULL;
DWORD cbTypeName; DWORD cbTypeName;
DWORD dwTypeCount; DWORD dwTypeCount;
...@@ -637,7 +647,7 @@ static void test_enum_provider_types(void) ...@@ -637,7 +647,7 @@ static void test_enum_provider_types(void)
return; return;
} }
if (!FindProvTypesRegVals(index, &dwProvType, &pszTypeName, &cbTypeName, &dwTypeCount)) if (!FindProvTypesRegVals(&index, &dwProvType, &pszTypeName, &cbTypeName, &dwTypeCount))
{ {
skip("Could not find provider types in registry\n"); skip("Could not find provider types in registry\n");
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment