Commit 5ebd4e93 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

- make sure msihandle2msiinfo is correctly matched with msiobj_release

- don't do redundant NULL checks
parent cfcc7a72
......@@ -6546,6 +6546,7 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
{
MSIPACKAGE* package;
INT index;
UINT rc = ERROR_SUCCESS;
TRACE(" %s to %i\n",debugstr_w(szFeature), iState);
......@@ -6555,12 +6556,17 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
index = get_loaded_feature(package,szFeature);
if (index < 0)
return ERROR_UNKNOWN_FEATURE;
{
rc = ERROR_UNKNOWN_FEATURE;
goto end;
}
package->features[index].ActionRequest= iState;
ACTION_UpdateComponentStates(package,szFeature);
return ERROR_SUCCESS;
end:
msiobj_release( &package->hdr );
return rc;
}
UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPSTR szFeature,
......
......@@ -538,11 +538,8 @@ UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord,
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if( record )
{
r = MSI_FormatRecordW( package, record, szResult, sz );
msiobj_release( &record->hdr );
}
r = MSI_FormatRecordW( package, record, szResult, sz );
msiobj_release( &record->hdr );
if (package)
msiobj_release( &package->hdr );
return r;
......@@ -572,11 +569,8 @@ UINT WINAPI MsiFormatRecordA( MSIHANDLE hInstall, MSIHANDLE hRecord,
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if( record )
{
r = MSI_FormatRecordA( package, record, szResult, sz );
msiobj_release( &record->hdr );
}
r = MSI_FormatRecordA( package, record, szResult, sz );
msiobj_release( &record->hdr );
if (package)
msiobj_release( &package->hdr );
return r;
......
......@@ -484,6 +484,11 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
goto end;
package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
if (!package)
{
rc = ERROR_INVALID_HANDLE;
goto end;
}
sz = strlenW(szInstalled);
......
......@@ -423,8 +423,7 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
msiobj_unlock( &rec->hdr );
out:
if( query )
msiobj_release( &query->hdr );
msiobj_release( &query->hdr );
if( rec )
msiobj_release( &rec->hdr );
......@@ -481,8 +480,7 @@ UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hR
*hRec = alloc_msihandle( &rec->hdr );
out:
if( query )
msiobj_release( &query->hdr );
msiobj_release( &query->hdr );
if( rec )
msiobj_release( &rec->hdr );
......@@ -520,8 +518,7 @@ UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode,
r = view->ops->modify( view, eModifyMode, rec );
out:
if( query )
msiobj_release( &query->hdr );
msiobj_release( &query->hdr );
if( rec )
msiobj_release( &rec->hdr );
......
......@@ -617,7 +617,7 @@ INT WINAPI MsiProcessMessage( MSIHANDLE hInstall, INSTALLMESSAGE eMessageType,
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if( !package )
goto out;
return ERROR_INVALID_HANDLE;
record = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD );
if( !record )
......@@ -626,8 +626,7 @@ INT WINAPI MsiProcessMessage( MSIHANDLE hInstall, INSTALLMESSAGE eMessageType,
ret = MSI_ProcessMessage( package, eMessageType, record );
out:
if( package )
msiobj_release( &package->hdr );
msiobj_release( &package->hdr );
if( record )
msiobj_release( &record->hdr );
......
......@@ -77,6 +77,7 @@ UINT WINAPI MsiEnableUIPreview( MSIHANDLE hdb, MSIHANDLE* phPreview )
msiobj_release( &preview->hdr );
r = ERROR_SUCCESS;
}
msiobj_release( &db->hdr );
return r;
}
......
......@@ -210,6 +210,7 @@ UINT WINAPI MsiRecordClearData( MSIHANDLE handle )
rec->fields[i].u.iVal = 0;
}
msiobj_unlock( &rec->hdr );
msiobj_release( &rec->hdr );
return ERROR_SUCCESS;
}
......
......@@ -159,6 +159,7 @@ UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, UINT *pCount)
if( !suminfo )
return ERROR_INVALID_HANDLE;
msiobj_release( &suminfo->hdr );
return ERROR_CALL_NOT_IMPLEMENTED;
}
......@@ -170,6 +171,7 @@ UINT WINAPI MsiSummaryInfoGetPropertyA(
HRESULT r;
PROPSPEC spec;
PROPVARIANT var;
UINT rc = ERROR_SUCCESS;
TRACE("%ld %d %p %p %p %p %p\n",
hSummaryInfo, uiProperty, puiDataType, piValue,
......@@ -184,7 +186,10 @@ UINT WINAPI MsiSummaryInfoGetPropertyA(
r = IPropertyStorage_ReadMultiple( suminfo->propstg, 1, &spec, &var);
if( FAILED(r) )
return ERROR_FUNCTION_FAILED;
{
rc = ERROR_FUNCTION_FAILED;
goto end;
}
if( puiDataType )
*puiDataType = var.vt;
......@@ -213,7 +218,9 @@ UINT WINAPI MsiSummaryInfoGetPropertyA(
break;
}
return ERROR_SUCCESS;
end:
msiobj_release( &suminfo->hdr );
return rc;
}
UINT WINAPI MsiSummaryInfoGetPropertyW(
......@@ -224,6 +231,7 @@ UINT WINAPI MsiSummaryInfoGetPropertyW(
HRESULT r;
PROPSPEC spec;
PROPVARIANT var;
UINT rc = ERROR_SUCCESS;
TRACE("%ld %d %p %p %p %p %p\n",
hSummaryInfo, uiProperty, puiDataType, piValue,
......@@ -238,7 +246,10 @@ UINT WINAPI MsiSummaryInfoGetPropertyW(
r = IPropertyStorage_ReadMultiple( suminfo->propstg, 1, &spec, &var);
if( FAILED(r) )
return ERROR_FUNCTION_FAILED;
{
rc = ERROR_FUNCTION_FAILED;
goto end;
}
if( puiDataType )
*puiDataType = var.vt;
......@@ -268,7 +279,9 @@ UINT WINAPI MsiSummaryInfoGetPropertyW(
break;
}
return ERROR_SUCCESS;
end:
msiobj_release( &suminfo->hdr );
return rc;
}
UINT WINAPI MsiSummaryInfoSetPropertyA( MSIHANDLE hSummaryInfo, UINT uiProperty,
......
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