msi: Avoid casts in IWineMsiRemotePackage methods.

This commit is contained in:
Hans Leidekker 2011-05-02 16:02:55 +02:00 committed by Alexandre Julliard
parent cc517f2b38
commit c96cd6efc8
3 changed files with 15 additions and 23 deletions

View File

@ -246,8 +246,7 @@ static UINT MSI_GetTargetPath( MSIHANDLE hInstall, LPCWSTR szFolder,
} }
len = 0; len = 0;
hr = IWineMsiRemotePackage_GetTargetPath( remote_package, folder, hr = IWineMsiRemotePackage_GetTargetPath( remote_package, folder, NULL, &len );
NULL, &len );
if (FAILED(hr)) if (FAILED(hr))
goto done; goto done;
@ -259,8 +258,7 @@ static UINT MSI_GetTargetPath( MSIHANDLE hInstall, LPCWSTR szFolder,
goto done; goto done;
} }
hr = IWineMsiRemotePackage_GetTargetPath( remote_package, folder, hr = IWineMsiRemotePackage_GetTargetPath( remote_package, folder, value, &len );
(BSTR *)value, &len);
if (FAILED(hr)) if (FAILED(hr))
goto done; goto done;
@ -371,8 +369,7 @@ static UINT MSI_GetSourcePath( MSIHANDLE hInstall, LPCWSTR szFolder,
} }
len = 0; len = 0;
hr = IWineMsiRemotePackage_GetSourcePath( remote_package, folder, hr = IWineMsiRemotePackage_GetSourcePath( remote_package, folder, NULL, &len );
NULL, &len );
if (FAILED(hr)) if (FAILED(hr))
goto done; goto done;
@ -384,8 +381,7 @@ static UINT MSI_GetSourcePath( MSIHANDLE hInstall, LPCWSTR szFolder,
goto done; goto done;
} }
hr = IWineMsiRemotePackage_GetSourcePath( remote_package, folder, hr = IWineMsiRemotePackage_GetSourcePath( remote_package, folder, value, &len );
(BSTR *)value, &len);
if (FAILED(hr)) if (FAILED(hr))
goto done; goto done;

View File

@ -54,14 +54,14 @@ interface IWineMsiRemotePackage : IUnknown
{ {
HRESULT SetMsiHandle( [in] MSIHANDLE handle ); HRESULT SetMsiHandle( [in] MSIHANDLE handle );
HRESULT GetActiveDatabase( [out] MSIHANDLE *handle ); HRESULT GetActiveDatabase( [out] MSIHANDLE *handle );
HRESULT GetProperty( [in] BSTR property, [out] BSTR *value, [out] DWORD *size ); HRESULT GetProperty( [in] BSTR property, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
HRESULT SetProperty( [in] BSTR property, [in] BSTR value ); HRESULT SetProperty( [in] BSTR property, [in] BSTR value );
HRESULT ProcessMessage( [in] INSTALLMESSAGE message, [in] MSIHANDLE record ); HRESULT ProcessMessage( [in] INSTALLMESSAGE message, [in] MSIHANDLE record );
HRESULT DoAction( [in] BSTR action ); HRESULT DoAction( [in] BSTR action );
HRESULT Sequence( [in] BSTR table, [in] int sequence ); HRESULT Sequence( [in] BSTR table, [in] int sequence );
HRESULT GetTargetPath( [in] BSTR folder, [out] BSTR *value, [out] DWORD *size ); HRESULT GetTargetPath( [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
HRESULT SetTargetPath( [in] BSTR folder, [in] BSTR value ); HRESULT SetTargetPath( [in] BSTR folder, [in] BSTR value );
HRESULT GetSourcePath( [in] BSTR folder, [out] BSTR *value, [out] DWORD *size ); HRESULT GetSourcePath( [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
HRESULT GetMode( [in] MSIRUNMODE mode, [out] BOOL *ret ); HRESULT GetMode( [in] MSIRUNMODE mode, [out] BOOL *ret );
HRESULT SetMode( [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT SetMode( [in] MSIRUNMODE mode, [in] BOOL state );
HRESULT GetFeatureState( [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT GetFeatureState( [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );

View File

@ -2231,7 +2231,7 @@ static UINT MSI_GetProperty( MSIHANDLE handle, LPCWSTR name,
goto done; goto done;
} }
hr = IWineMsiRemotePackage_GetProperty( remote_package, bname, (BSTR *)value, &len ); hr = IWineMsiRemotePackage_GetProperty( remote_package, bname, value, &len );
if (FAILED(hr)) if (FAILED(hr))
goto done; goto done;
@ -2383,15 +2383,11 @@ static HRESULT WINAPI mrp_GetActiveDatabase( IWineMsiRemotePackage *iface, MSIHA
return S_OK; return S_OK;
} }
static HRESULT WINAPI mrp_GetProperty( IWineMsiRemotePackage *iface, BSTR property, BSTR *value, DWORD *size ) static HRESULT WINAPI mrp_GetProperty( IWineMsiRemotePackage *iface, BSTR property, BSTR value, DWORD *size )
{ {
msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface ); msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface );
UINT r; UINT r = MsiGetPropertyW(This->package, property, value, size);
if (r != ERROR_SUCCESS) return HRESULT_FROM_WIN32(r);
r = MsiGetPropertyW(This->package, (LPWSTR)property, (LPWSTR)value, size);
if (r != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(r);
return S_OK; return S_OK;
} }
@ -2423,10 +2419,10 @@ static HRESULT WINAPI mrp_Sequence( IWineMsiRemotePackage *iface, BSTR table, in
return HRESULT_FROM_WIN32(r); return HRESULT_FROM_WIN32(r);
} }
static HRESULT WINAPI mrp_GetTargetPath( IWineMsiRemotePackage *iface, BSTR folder, BSTR *value, DWORD *size ) static HRESULT WINAPI mrp_GetTargetPath( IWineMsiRemotePackage *iface, BSTR folder, BSTR value, DWORD *size )
{ {
msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface ); msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface );
UINT r = MsiGetTargetPathW(This->package, (LPWSTR)folder, (LPWSTR)value, size); UINT r = MsiGetTargetPathW(This->package, folder, value, size);
return HRESULT_FROM_WIN32(r); return HRESULT_FROM_WIN32(r);
} }
@ -2437,10 +2433,10 @@ static HRESULT WINAPI mrp_SetTargetPath( IWineMsiRemotePackage *iface, BSTR fold
return HRESULT_FROM_WIN32(r); return HRESULT_FROM_WIN32(r);
} }
static HRESULT WINAPI mrp_GetSourcePath( IWineMsiRemotePackage *iface, BSTR folder, BSTR *value, DWORD *size ) static HRESULT WINAPI mrp_GetSourcePath( IWineMsiRemotePackage *iface, BSTR folder, BSTR value, DWORD *size )
{ {
msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface ); msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface );
UINT r = MsiGetSourcePathW(This->package, (LPWSTR)folder, (LPWSTR)value, size); UINT r = MsiGetSourcePathW(This->package, folder, value, size);
return HRESULT_FROM_WIN32(r); return HRESULT_FROM_WIN32(r);
} }