diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c index 45acc14eda6..1a8413cf095 100644 --- a/dlls/advapi32/advapi.c +++ b/dlls/advapi32/advapi.c @@ -266,9 +266,24 @@ BOOL WINAPI LogonUserW( LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPa return TRUE; } -DWORD WINAPI CommandLineFromMsiDescriptor(WCHAR *Descriptor, WCHAR *CommandLine, - DWORD *CommandLineLength) +typedef UINT (WINAPI *fnMsiProvideComponentFromDescriptor)(LPCWSTR,LPWSTR,DWORD*,DWORD*); + +DWORD WINAPI CommandLineFromMsiDescriptor( WCHAR *szDescriptor, + WCHAR *szCommandLine, DWORD *pcchCommandLine ) { - FIXME("stub (%s)\n", debugstr_w(Descriptor)); - return ERROR_CALL_NOT_IMPLEMENTED; + static const WCHAR szMsi[] = { 'm','s','i',0 }; + fnMsiProvideComponentFromDescriptor mpcfd; + HMODULE hmsi; + UINT r = ERROR_CALL_NOT_IMPLEMENTED; + + TRACE("%s %p %p\n", debugstr_w(szDescriptor), szCommandLine, pcchCommandLine); + + hmsi = LoadLibraryW( szMsi ); + if (!hmsi) + return r; + mpcfd = (void*) GetProcAddress( hmsi, "MsiProvideComponentFromDescriptorW" ); + if (mpcfd) + r = mpcfd( szDescriptor, szCommandLine, pcchCommandLine, NULL ); + FreeLibrary( hmsi ); + return r; } diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 4ba39563c62..8b07ab97c5d 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -62,7 +62,7 @@ @ stdcall CloseEventLog (long) @ stdcall CloseServiceHandle(long) # @ stub CloseTrace -@ stdcall CommandLineFromMsiDescriptor(wstr wstr ptr) +@ stdcall CommandLineFromMsiDescriptor(wstr ptr ptr) # @ stub ComputeAccessTokenFromCodeAuthzLevel @ stdcall ControlService(long long ptr) # @ stub ControlTraceA