Commit a3dd2967 authored by Alexandre Julliard's avatar Alexandre Julliard

shlwapi/tests: SHLWAPI.23 apparently returns an HRESULT on Vista.

parent 0e894c34
......@@ -107,6 +107,7 @@ static void test_ClassIDs(void)
DWORD dwLen;
BOOL bRet;
int i = 0;
int is_vista = 0;
if (!pSHLWAPI_269 || !pSHLWAPI_23)
return;
......@@ -114,7 +115,8 @@ static void test_ClassIDs(void)
while (*guids)
{
dwLen = pSHLWAPI_23(*guids, szBuff, 256);
ok(dwLen == 39, "wrong size for id %d\n", i);
if (!i && dwLen == S_OK) is_vista = 1; /* seems to return an HRESULT on vista */
ok(dwLen == (is_vista ? S_OK : 39), "wrong size %u for id %d\n", dwLen, i);
bRet = pSHLWAPI_269(szBuff, &guid);
ok(bRet != FALSE, "created invalid string '%s'\n", szBuff);
......@@ -128,7 +130,7 @@ static void test_ClassIDs(void)
/* Test endianess */
dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 256);
ok(dwLen == 39, "wrong size for IID_Endianess\n");
ok(dwLen == (is_vista ? S_OK : 39), "wrong size %u for IID_Endianess\n", dwLen);
ok(!strcmp(szBuff, "{01020304-0506-0708-090A-0B0C0D0E0F0A}"),
"Endianess Broken, got '%s'\n", szBuff);
......@@ -136,17 +138,17 @@ static void test_ClassIDs(void)
/* test lengths */
szBuff[0] = ':';
dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 0);
ok(dwLen == 0, "accepted bad length\n");
ok(dwLen == (is_vista ? E_FAIL : 0), "accepted bad length\n");
ok(szBuff[0] == ':', "wrote to buffer with no length\n");
szBuff[0] = ':';
dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 38);
ok(dwLen == 0, "accepted bad length\n");
ok(dwLen == (is_vista ? E_FAIL : 0), "accepted bad length\n");
ok(szBuff[0] == ':', "wrote to buffer with no length\n");
szBuff[0] = ':';
dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 39);
ok(dwLen == 39, "rejected ok length\n");
ok(dwLen == (is_vista ? S_OK : 39), "rejected ok length\n");
ok(szBuff[0] == '{', "Didn't write to buffer with ok length\n");
/* Test string */
......@@ -155,7 +157,7 @@ static void test_ClassIDs(void)
ok(bRet == FALSE, "accepted invalid string\n");
dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 39);
ok(dwLen == 39, "rejected ok length\n");
ok(dwLen == (is_vista ? S_OK : 39), "rejected ok length\n");
ok(szBuff[0] == '{', "Didn't write to buffer with ok length\n");
}
......
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