SafeArrayDestroy() returns success when called with a NULL

pointer. Added to the test cases.
This commit is contained in:
Rein Klazes 2005-01-31 11:31:50 +00:00 committed by Alexandre Julliard
parent e495e7e34c
commit 26771be4da
2 changed files with 4 additions and 1 deletions

View File

@ -1337,7 +1337,7 @@ HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
TRACE("(%p)\n", psa);
if(!psa)
return E_INVALIDARG;
return S_OK;
if(psa->cLocks > 0)
return DISP_E_ARRAYISLOCKED;

View File

@ -258,6 +258,9 @@ static void test_safearray(void)
LONG l;
unsigned char *ptr1, *ptr2;
hres = SafeArrayDestroy( NULL);
ok( hres == S_OK, "SafeArrayDestroy( NULL) returned 0x%lx\n", hres);
bound.cElements = 1;
bound.lLbound = 0;
a = SafeArrayCreate(-1, 1, &bound);