dxdiagn: Fix a return value and avoid validating the input parameter for IDxDiagProviderImpl::GetContainer.

This commit is contained in:
Andrew Nguyen 2009-12-22 04:15:15 -06:00 committed by Alexandre Julliard
parent dddf714f02
commit e1dd6a869d
2 changed files with 1 additions and 6 deletions

View File

@ -110,11 +110,8 @@ static HRESULT WINAPI IDxDiagProviderImpl_GetRootContainer(PDXDIAGPROVIDER iface
IDxDiagProviderImpl *This = (IDxDiagProviderImpl *)iface;
TRACE("(%p,%p)\n", iface, ppInstance);
if (NULL == ppInstance) {
return E_INVALIDARG;
}
if (FALSE == This->init) {
return E_INVALIDARG; /* should be E_CO_UNINITIALIZED */
return CO_E_NOTINITIALIZED;
}
if (NULL == This->pRootContainer) {
hr = DXDiag_CreateDXDiagContainer(&IID_IDxDiagContainer, (void**) &This->pRootContainer);

View File

@ -107,12 +107,10 @@ static void test_GetRootContainer(void)
/* Test calling IDxDiagProvider::GetRootContainer before initialization. */
hr = IDxDiagProvider_GetRootContainer(pddp, NULL);
todo_wine
ok(hr == CO_E_NOTINITIALIZED,
"Expected IDxDiagProvider::GetRootContainer to return CO_E_NOTINITIALIZED, got %x\n", hr);
hr = IDxDiagProvider_GetRootContainer(pddp, &pddc);
todo_wine
ok(hr == CO_E_NOTINITIALIZED,
"Expected IDxDiagProvider::GetRootContainer to return CO_E_NOTINITIALIZED, got %x\n", hr);