msi: Handle remote calls to MsiGetSourcePath.
This commit is contained in:
parent
b7479be1bb
commit
582be6a73a
@ -314,16 +314,60 @@ static UINT MSI_GetSourcePath( MSIHANDLE hInstall, LPCWSTR szFolder,
|
||||
{
|
||||
MSIPACKAGE *package;
|
||||
LPWSTR path;
|
||||
UINT r;
|
||||
UINT r = ERROR_FUNCTION_FAILED;
|
||||
|
||||
TRACE("%s %p %p\n", debugstr_w(szFolder), szPathBuf, pcchPathBuf );
|
||||
|
||||
if (!szFolder)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
|
||||
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_GetSourcePath( 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_GetSourcePath( 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;
|
||||
}
|
||||
|
||||
if (szPathBuf->str.w && !pcchPathBuf )
|
||||
{
|
||||
|
@ -43,6 +43,7 @@ interface IWineMsiRemotePackage : IUnknown
|
||||
HRESULT DoAction( [in] BSTR *action );
|
||||
HRESULT Sequence( [in] BSTR *table, [in] int sequence );
|
||||
HRESULT GetTargetPath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size );
|
||||
HRESULT GetSourcePath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size );
|
||||
}
|
||||
|
||||
[
|
||||
|
@ -1597,6 +1597,13 @@ HRESULT WINAPI mrp_GetTargetPath( IWineMsiRemotePackage *iface, BSTR *folder, BS
|
||||
return HRESULT_FROM_WIN32(r);
|
||||
}
|
||||
|
||||
HRESULT WINAPI mrp_GetSourcePath( IWineMsiRemotePackage *iface, BSTR *folder, BSTR *value, DWORD *size )
|
||||
{
|
||||
msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
|
||||
UINT r = MsiGetSourcePathW(This->package, (LPWSTR)folder, (LPWSTR)value, size);
|
||||
return HRESULT_FROM_WIN32(r);
|
||||
}
|
||||
|
||||
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
|
||||
{
|
||||
mrp_QueryInterface,
|
||||
@ -1610,6 +1617,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
|
||||
mrp_DoAction,
|
||||
mrp_Sequence,
|
||||
mrp_GetTargetPath,
|
||||
mrp_GetSourcePath,
|
||||
};
|
||||
|
||||
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )
|
||||
|
Loading…
x
Reference in New Issue
Block a user