msi: Make MsiGetLanguage() RPC-compatible.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-04-24 22:27:37 -05:00 committed by Alexandre Julliard
parent c65df521a4
commit 5f45959adc
4 changed files with 10 additions and 14 deletions

View File

@ -1379,18 +1379,11 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
if (!package) if (!package)
{ {
MSIHANDLE remote; MSIHANDLE remote;
HRESULT hr;
LANGID lang;
if (!(remote = msi_get_remote(hInstall))) if (!(remote = msi_get_remote(hInstall)))
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
hr = remote_GetLanguage(remote, &lang); return remote_GetLanguage(remote);
if (SUCCEEDED(hr))
return lang;
return 0;
} }
langid = msi_get_property_int( package->db, szProductLanguage, 0 ); langid = msi_get_property_int( package->db, szProductLanguage, 0 );

View File

@ -2545,10 +2545,9 @@ UINT __cdecl remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTAL
return MsiSetComponentStateW(hinst, component, state); return MsiSetComponentStateW(hinst, component, state);
} }
HRESULT __cdecl remote_GetLanguage(MSIHANDLE hinst, LANGID *language) LANGID __cdecl remote_GetLanguage(MSIHANDLE hinst)
{ {
*language = MsiGetLanguage(hinst); return MsiGetLanguage(hinst);
return S_OK;
} }
HRESULT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) HRESULT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level)

View File

@ -642,12 +642,16 @@ static void test_targetpath(MSIHANDLE hinst)
ok(hinst, sz == srcsz, "got size %u\n", sz); ok(hinst, sz == srcsz, "got size %u\n", sz);
} }
static void test_mode(MSIHANDLE hinst) static void test_misc(MSIHANDLE hinst)
{ {
LANGID lang;
UINT r; UINT r;
r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE); r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE);
ok(hinst, !r, "got %u\n", r); ok(hinst, !r, "got %u\n", r);
lang = MsiGetLanguage(hinst);
ok(hinst, lang == 1033, "got %u\n", lang);
} }
static void test_feature_states(MSIHANDLE hinst) static void test_feature_states(MSIHANDLE hinst)
@ -767,7 +771,7 @@ UINT WINAPI main_test(MSIHANDLE hinst)
test_db(hinst); test_db(hinst);
test_doaction(hinst); test_doaction(hinst);
test_targetpath(hinst); test_targetpath(hinst);
test_mode(hinst); test_misc(hinst);
test_feature_states(hinst); test_feature_states(hinst);
return ERROR_SUCCESS; return ERROR_SUCCESS;

View File

@ -85,7 +85,7 @@ interface IWineMsiRemote
UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state );
UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state );
HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); LANGID remote_GetLanguage( [in] MSIHANDLE hinst );
HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level );
HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value );
HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition ); HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition );