Commit 481bccc8 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Add an implementation for MsiGetShortcutTargetA/W.

parent a2fb7c16
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#include "wincrypt.h" #include "wincrypt.h"
#include "winver.h" #include "winver.h"
#include "winuser.h" #include "winuser.h"
#include "shlobj.h"
#include "shobjidl.h"
#include "objidl.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "action.h" #include "action.h"
...@@ -1720,6 +1723,9 @@ UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved) ...@@ -1720,6 +1723,9 @@ UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved)
return 0; return 0;
} }
/***********************************************************************
* MsiGetShortcutTargetA [MSI.@]
*/
UINT WINAPI MsiGetShortcutTargetA( LPCSTR szShortcutTarget, UINT WINAPI MsiGetShortcutTargetA( LPCSTR szShortcutTarget,
LPSTR szProductCode, LPSTR szFeatureId, LPSTR szProductCode, LPSTR szFeatureId,
LPSTR szComponentCode ) LPSTR szComponentCode )
...@@ -1746,12 +1752,61 @@ UINT WINAPI MsiGetShortcutTargetA( LPCSTR szShortcutTarget, ...@@ -1746,12 +1752,61 @@ UINT WINAPI MsiGetShortcutTargetA( LPCSTR szShortcutTarget,
return r; return r;
} }
/***********************************************************************
* MsiGetShortcutTargetW [MSI.@]
*/
UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget, UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget,
LPWSTR szProductCode, LPWSTR szFeatureId, LPWSTR szProductCode, LPWSTR szFeatureId,
LPWSTR szComponentCode ) LPWSTR szComponentCode )
{ {
FIXME("%s\n", debugstr_w(szShortcutTarget)); IShellLinkDataList *dl = NULL;
return ERROR_CALL_NOT_IMPLEMENTED; IPersistFile *pf = NULL;
LPEXP_DARWIN_LINK darwin = NULL;
HRESULT r;
TRACE("%s %p %p %p\n", debugstr_w(szShortcutTarget),
szProductCode, szFeatureId, szComponentCode );
r = CoInitialize(NULL);
if( FAILED( r ) )
return ERROR_FUNCTION_FAILED;
r = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
&IID_IPersistFile, (LPVOID*) &pf );
if( SUCCEEDED( r ) )
{
r = IPersistFile_Load( pf, szShortcutTarget,
STGM_READ | STGM_SHARE_DENY_WRITE );
if( SUCCEEDED( r ) )
{
r = IPersistFile_QueryInterface( pf, &IID_IShellLinkDataList,
(LPVOID*) dl );
if( SUCCEEDED( r ) )
{
IShellLinkDataList_CopyDataBlock( dl, EXP_DARWIN_ID_SIG,
(LPVOID) &darwin );
IShellLinkDataList_Release( dl );
}
}
IPersistFile_Release( pf );
}
CoUninitialize();
TRACE("darwin = %p\n", darwin);
if (darwin)
{
DWORD sz;
UINT ret;
ret = MsiDecomposeDescriptorW( darwin->szwDarwinID,
szProductCode, szFeatureId, szComponentCode, &sz );
LocalFree( darwin );
return ret;
}
return ERROR_FUNCTION_FAILED;
} }
UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature,
......
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