https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fdca309017cd52ae020989ae5a9c184a0f0e9408

commit fdca309017cd52ae020989ae5a9c184a0f0e9408
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 15:12:04 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:41 2022 +0100

    [WINESYNC] msi: Make MsiGetLanguage() RPC-compatible.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 5f45959adc55961a9787b54cd7814f18c056ebef by Zebediah Figura 
<[email protected]>
---
 dll/win32/msi/install.c                 | 9 +--------
 dll/win32/msi/package.c                 | 5 ++---
 dll/win32/msi/winemsi.idl               | 2 +-
 modules/rostests/winetests/msi/custom.c | 8 ++++++--
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c
index 63ffbfeaeae..0ec1f241b61 100644
--- a/dll/win32/msi/install.c
+++ b/dll/win32/msi/install.c
@@ -1379,18 +1379,11 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
     if (!package)
     {
         MSIHANDLE remote;
-        HRESULT hr;
-        LANGID lang;
 
         if (!(remote = msi_get_remote(hInstall)))
             return ERROR_INVALID_HANDLE;
 
-        hr = remote_GetLanguage(remote, &lang);
-
-        if (SUCCEEDED(hr))
-            return lang;
-
-        return 0;
+        return remote_GetLanguage(remote);
     }
 
     langid = msi_get_property_int( package->db, szProductLanguage, 0 );
diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c
index 26d999bcbce..98b283df502 100644
--- a/dll/win32/msi/package.c
+++ b/dll/win32/msi/package.c
@@ -2552,10 +2552,9 @@ UINT __cdecl remote_SetComponentState(MSIHANDLE hinst, 
LPCWSTR component, INSTAL
     return MsiSetComponentStateW(hinst, component, state);
 }
 
-HRESULT __cdecl remote_GetLanguage(MSIHANDLE hinst, LANGID *language)
+LANGID __cdecl remote_GetLanguage(MSIHANDLE hinst)
 {
-    *language = MsiGetLanguage(hinst);
-    return S_OK;
+    return MsiGetLanguage(hinst);
 }
 
 HRESULT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level)
diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl
index 132f140d870..b75f32f46b1 100644
--- a/dll/win32/msi/winemsi.idl
+++ b/dll/win32/msi/winemsi.idl
@@ -85,7 +85,7 @@ interface IWineMsiRemote
     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_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_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, 
[out] BSTR *value );
     HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR 
condition );
diff --git a/modules/rostests/winetests/msi/custom.c 
b/modules/rostests/winetests/msi/custom.c
index 2f9ba5d3231..e9561d6a36c 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/custom.c
@@ -642,12 +642,16 @@ static void test_targetpath(MSIHANDLE hinst)
     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;
 
     r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE);
     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)
@@ -767,7 +771,7 @@ UINT WINAPI main_test(MSIHANDLE hinst)
     test_db(hinst);
     test_doaction(hinst);
     test_targetpath(hinst);
-    test_mode(hinst);
+    test_misc(hinst);
     test_feature_states(hinst);
 
     return ERROR_SUCCESS;

Reply via email to