msi: Handle remote calls to MsiGetTargetPath.
This commit is contained in:
parent
99714f12cb
commit
b7479be1bb
|
@ -200,14 +200,58 @@ static UINT WINAPI MSI_GetTargetPath( MSIHANDLE hInstall, LPCWSTR szFolder,
|
|||
{
|
||||
MSIPACKAGE *package;
|
||||
LPWSTR path;
|
||||
UINT r;
|
||||
UINT r = ERROR_FUNCTION_FAILED;
|
||||
|
||||
if (!szFolder)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
|
||||
if (!package)
|
||||
return ERROR_INVALID_HANDLE;
|
||||
{
|
||||
HRESULT hr;
|
||||
IWineMsiRemotePackage *remote_package;
|
||||
LPWSTR value = NULL;
|
||||
DWORD len;
|
||||
|
||||
remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
|
||||
if (!remote_package)
|
||||
return ERROR_INVALID_HANDLE;
|
||||
|
||||
len = 0;
|
||||
hr = IWineMsiRemotePackage_GetTargetPath( remote_package, (BSTR *)szFolder,
|
||||
NULL, &len );
|
||||
if (FAILED(hr))
|
||||
goto done;
|
||||
|
||||
len++;
|
||||
value = msi_alloc(len * sizeof(WCHAR));
|
||||
if (!value)
|
||||
{
|
||||
r = ERROR_OUTOFMEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
hr = IWineMsiRemotePackage_GetTargetPath( remote_package, (BSTR *)szFolder,
|
||||
(BSTR *)value, &len);
|
||||
if (FAILED(hr))
|
||||
goto done;
|
||||
|
||||
r = msi_strcpy_to_awstring( value, szPathBuf, pcchPathBuf );
|
||||
|
||||
done:
|
||||
IWineMsiRemotePackage_Release( remote_package );
|
||||
msi_free( value );
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
|
||||
return HRESULT_CODE(hr);
|
||||
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
path = resolve_folder( package, szFolder, FALSE, FALSE, TRUE, NULL );
|
||||
msiobj_release( &package->hdr );
|
||||
|
|
|
@ -42,6 +42,7 @@ interface IWineMsiRemotePackage : IUnknown
|
|||
HRESULT ProcessMessage( [in] INSTALLMESSAGE message, [in] MSIHANDLE record );
|
||||
HRESULT DoAction( [in] BSTR *action );
|
||||
HRESULT Sequence( [in] BSTR *table, [in] int sequence );
|
||||
HRESULT GetTargetPath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size );
|
||||
}
|
||||
|
||||
[
|
||||
|
|
|
@ -1590,6 +1590,13 @@ HRESULT WINAPI mrp_Sequence( IWineMsiRemotePackage *iface, BSTR *table, int sequ
|
|||
return HRESULT_FROM_WIN32(r);
|
||||
}
|
||||
|
||||
HRESULT WINAPI mrp_GetTargetPath( IWineMsiRemotePackage *iface, BSTR *folder, BSTR *value, DWORD *size )
|
||||
{
|
||||
msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
|
||||
UINT r = MsiGetTargetPathW(This->package, (LPWSTR)folder, (LPWSTR)value, size);
|
||||
return HRESULT_FROM_WIN32(r);
|
||||
}
|
||||
|
||||
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
|
||||
{
|
||||
mrp_QueryInterface,
|
||||
|
@ -1602,6 +1609,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
|
|||
mrp_ProcessMessage,
|
||||
mrp_DoAction,
|
||||
mrp_Sequence,
|
||||
mrp_GetTargetPath,
|
||||
};
|
||||
|
||||
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )
|
||||
|
|
Loading…
Reference in New Issue