[PATCH] msi: Use __stdcall instead of the default __cdecl in IWineMsiRemote.

Gerald Pfeifer gerald at pfeifer.com
Sat Aug 3 14:17:29 CDT 2019


Building with clang 7 or new versions of GCC I get the loads of the
following under dlls/msi:

  winemsi_s.c:4014:5: warning: cast between incompatible calling 
      conventions 'cdecl' and 'stdcall'; calls through this pointer 
      may abort at runtime
      [-Wcast-calling-convention]
    (SERVER_ROUTINE)s_remote_ViewClose,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ./winemsi.h:69:14: note: consider defining 's_remote_ViewClose' 
      with the 'stdcall' calling convention
  UINT __cdecl s_remote_ViewClose(
               ^
               __attribute__((stdcall)) 

Does the approach below look proper?  If not, how would you address 
this?

Gerald

---
 dlls/msi/msiquery.c  | 12 ++++++------
 dlls/msi/winemsi.idl | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index cf8b2b2b4d..ccdb114226 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -1209,12 +1209,12 @@ MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(
     return r;
 }
 
-UINT __cdecl s_remote_ViewClose(MSIHANDLE view)
+UINT __RPC_API s_remote_ViewClose(MSIHANDLE view)
 {
     return MsiViewClose(view);
 }
 
-UINT __cdecl s_remote_ViewExecute(MSIHANDLE view, struct wire_record *remote_rec)
+UINT __RPC_API s_remote_ViewExecute(MSIHANDLE view, struct wire_record *remote_rec)
 {
     MSIHANDLE rec = 0;
     UINT r;
@@ -1228,7 +1228,7 @@ UINT __cdecl s_remote_ViewExecute(MSIHANDLE view, struct wire_record *remote_rec
     return r;
 }
 
-UINT __cdecl s_remote_ViewFetch(MSIHANDLE view, struct wire_record **rec)
+UINT __RPC_API s_remote_ViewFetch(MSIHANDLE view, struct wire_record **rec)
 {
     MSIHANDLE handle;
     UINT r = MsiViewFetch(view, &handle);
@@ -1239,7 +1239,7 @@ UINT __cdecl s_remote_ViewFetch(MSIHANDLE view, struct wire_record **rec)
     return r;
 }
 
-UINT __cdecl s_remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct wire_record **rec)
+UINT __RPC_API s_remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct wire_record **rec)
 {
     MSIHANDLE handle;
     UINT r = MsiViewGetColumnInfo(view, info, &handle);
@@ -1250,7 +1250,7 @@ UINT __cdecl s_remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct
     return r;
 }
 
-MSIDBERROR __cdecl s_remote_ViewGetError(MSIHANDLE view, LPWSTR *column)
+MSIDBERROR __RPC_API s_remote_ViewGetError(MSIHANDLE view, LPWSTR *column)
 {
     WCHAR empty[1];
     DWORD size = 1;
@@ -1266,7 +1266,7 @@ MSIDBERROR __cdecl s_remote_ViewGetError(MSIHANDLE view, LPWSTR *column)
     return r;
 }
 
-UINT __cdecl s_remote_ViewModify(MSIHANDLE view, MSIMODIFY mode,
+UINT __RPC_API s_remote_ViewModify(MSIHANDLE view, MSIMODIFY mode,
     struct wire_record *remote_rec, struct wire_record **remote_refreshed)
 {
     MSIHANDLE handle = 0;
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl
index 7888b0ceb4..33a58894ce 100644
--- a/dlls/msi/winemsi.idl
+++ b/dlls/msi/winemsi.idl
@@ -65,12 +65,12 @@ struct wire_record {
 ]
 interface IWineMsiRemote
 {
-    UINT remote_ViewClose( [in] MSIHANDLE view );
-    UINT remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record );
-    UINT remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record );
-    UINT remote_ViewGetColumnInfo( [in] MSIHANDLE view, [in] MSICOLINFO info, [out] struct wire_record **record );
-    MSIDBERROR remote_ViewGetError( [in] MSIHANDLE view, [out, string] LPWSTR *column );
-    UINT remote_ViewModify( [in] MSIHANDLE view, [in] MSIMODIFY mode,
+    UINT __stdcall remote_ViewClose( [in] MSIHANDLE view );
+    UINT __stdcall remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record );
+    UINT __stdcall remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record );
+    UINT __stdcall remote_ViewGetColumnInfo( [in] MSIHANDLE view, [in] MSICOLINFO info, [out] struct wire_record **record );
+    MSIDBERROR __stdcall remote_ViewGetError( [in] MSIHANDLE view, [out, string] LPWSTR *column );
+    UINT __stdcall remote_ViewModify( [in] MSIHANDLE view, [in] MSIMODIFY mode,
         [in] struct wire_record *record, [out] struct wire_record **refreshed );
 
     MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table );
-- 
2.22.0



More information about the wine-devel mailing list