propsys: Use E_NOT_SUFFICIENT_BUFFER definition.
This commit is contained in:
parent
8f971bfee6
commit
a7b848f32e
|
@ -293,12 +293,12 @@ HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch
|
||||||
|
|
||||||
/* GUIDSTRING_MAX accounts for null terminator, +1 for space character. */
|
/* GUIDSTRING_MAX accounts for null terminator, +1 for space character. */
|
||||||
if (cch <= GUIDSTRING_MAX + 1)
|
if (cch <= GUIDSTRING_MAX + 1)
|
||||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
return E_NOT_SUFFICIENT_BUFFER;
|
||||||
|
|
||||||
if (!pkey)
|
if (!pkey)
|
||||||
{
|
{
|
||||||
psz[0] = '\0';
|
psz[0] = '\0';
|
||||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
return E_NOT_SUFFICIENT_BUFFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintfW(psz, guid_fmtW, pkey->fmtid.Data1, pkey->fmtid.Data2,
|
sprintfW(psz, guid_fmtW, pkey->fmtid.Data1, pkey->fmtid.Data2,
|
||||||
|
@ -336,7 +336,7 @@ HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch
|
||||||
*p++ = *ptr--;
|
*p++ = *ptr--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
return E_NOT_SUFFICIENT_BUFFER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,19 +108,19 @@ static void test_PSStringFromPropertyKey(void)
|
||||||
{NULL, NULL, 0, E_POINTER},
|
{NULL, NULL, 0, E_POINTER},
|
||||||
{&prop, NULL, 0, E_POINTER},
|
{&prop, NULL, 0, E_POINTER},
|
||||||
{&prop, NULL, PKEYSTR_MAX, E_POINTER},
|
{&prop, NULL, PKEYSTR_MAX, E_POINTER},
|
||||||
{NULL, out, 0, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW},
|
{NULL, out, 0, E_NOT_SUFFICIENT_BUFFER, fillerW},
|
||||||
{NULL, out, PKEYSTR_MAX, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_fillerW, FALSE, 0, TRUE, fillerW},
|
{NULL, out, PKEYSTR_MAX, E_NOT_SUFFICIENT_BUFFER, zero_fillerW, FALSE, 0, TRUE, fillerW},
|
||||||
{&prop, out, 0, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW},
|
{&prop, out, 0, E_NOT_SUFFICIENT_BUFFER, fillerW},
|
||||||
{&prop, out, GUIDSTRING_MAX, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW},
|
{&prop, out, GUIDSTRING_MAX, E_NOT_SUFFICIENT_BUFFER, fillerW},
|
||||||
{&prop, out, GUIDSTRING_MAX + 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW},
|
{&prop, out, GUIDSTRING_MAX + 1, E_NOT_SUFFICIENT_BUFFER, fillerW},
|
||||||
{&prop, out, GUIDSTRING_MAX + 2, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncatedW, TRUE, S_OK, TRUE, truncatedW},
|
{&prop, out, GUIDSTRING_MAX + 2, E_NOT_SUFFICIENT_BUFFER, zero_truncatedW, TRUE, S_OK, TRUE, truncatedW},
|
||||||
{&prop, out, PKEYSTR_MAX - 2, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncated2W, TRUE, S_OK, TRUE, truncated2W},
|
{&prop, out, PKEYSTR_MAX - 2, E_NOT_SUFFICIENT_BUFFER, zero_truncated2W, TRUE, S_OK, TRUE, truncated2W},
|
||||||
{&prop, out, PKEYSTR_MAX - 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncated3W, TRUE, S_OK, TRUE, truncated3W},
|
{&prop, out, PKEYSTR_MAX - 1, E_NOT_SUFFICIENT_BUFFER, zero_truncated3W, TRUE, S_OK, TRUE, truncated3W},
|
||||||
{&prop, out, PKEYSTR_MAX, S_OK, expectedW},
|
{&prop, out, PKEYSTR_MAX, S_OK, expectedW},
|
||||||
{&prop2, out, GUIDSTRING_MAX + 2, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncated4W, TRUE, S_OK, TRUE, truncated4W},
|
{&prop2, out, GUIDSTRING_MAX + 2, E_NOT_SUFFICIENT_BUFFER, zero_truncated4W, TRUE, S_OK, TRUE, truncated4W},
|
||||||
{&prop2, out, GUIDSTRING_MAX + 6, S_OK, expected2W},
|
{&prop2, out, GUIDSTRING_MAX + 6, S_OK, expected2W},
|
||||||
{&prop2, out, PKEYSTR_MAX, S_OK, expected2W},
|
{&prop2, out, PKEYSTR_MAX, S_OK, expected2W},
|
||||||
{&prop3, out, GUIDSTRING_MAX + 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW},
|
{&prop3, out, GUIDSTRING_MAX + 1, E_NOT_SUFFICIENT_BUFFER, fillerW},
|
||||||
{&prop3, out, GUIDSTRING_MAX + 2, S_OK, expected3W},
|
{&prop3, out, GUIDSTRING_MAX + 2, S_OK, expected3W},
|
||||||
{&prop3, out, PKEYSTR_MAX, S_OK, expected3W},
|
{&prop3, out, PKEYSTR_MAX, S_OK, expected3W},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue