Robert Shearman : ole: Report and clean up after PostMessage failures.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 10 14:14:17 CST 2006


Module: wine
Branch: refs/heads/master
Commit: d175f154ba855b40e5265b5dae7203490aa2c6f2
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=d175f154ba855b40e5265b5dae7203490aa2c6f2

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Jan 10 20:08:22 2006 +0100

ole: Report and clean up after PostMessage failures.

---

 dlls/ole32/rpc.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index f2647c1..1fa88f6 100644
--- a/dlls/ole32/rpc.c
+++ b/dlls/ole32/rpc.c
@@ -254,7 +254,11 @@ static HRESULT WINAPI RpcChannelBuffer_S
 
         TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
 
-        PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params);
+        if (!PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params))
+        {
+            ERR("PostMessage failed with error %ld\n", GetLastError());
+            hr = HRESULT_FROM_WIN32(GetLastError());
+        }
     }
     else
     {
@@ -505,8 +509,14 @@ static void __RPC_STUB dispatch_rpc(RPC_
 
         TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
 
-        PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params);
-        WaitForSingleObject(params->handle, INFINITE);
+        if (PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params))
+            WaitForSingleObject(params->handle, INFINITE);
+        else
+        {
+            ERR("PostMessage failed with error %ld\n", GetLastError());
+            IRpcChannelBuffer_Release(params->chan);
+            IRpcStubBuffer_Release(params->stub);
+        }
         CloseHandle(params->handle);
     }
     else




More information about the wine-cvs mailing list