Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. RumbaOffice.cpp
  5. Abstract:
  6. Ingnore the first call to NdrProxySendReceive if the ProcNum is 0x8013.
  7. This prevents the RPC call from raising an exception because it's being
  8. called from an ASYNC callback. The error it would normally return would be
  9. RPC_E_CANTCALLOUT_INASYNCCALL. If it raises an exception, the app dies.
  10. No idea why this works on 9X.
  11. Notes:
  12. This is an app specific shim.
  13. History:
  14. 01/08/2001 linstev Created
  15. --*/
  16. #include "precomp.h"
  17. IMPLEMENT_SHIM_BEGIN(RumbaOffice)
  18. #include "ShimHookMacro.h"
  19. APIHOOK_ENUM_BEGIN
  20. APIHOOK_ENUM_ENTRY(NdrProxySendReceive)
  21. APIHOOK_ENUM_END
  22. BOOL g_bFirst = TRUE;
  23. typedef HRESULT (WINAPI *_pfn_NdrProxySendReceive)(void *pThis, MIDL_STUB_MESSAGE * pStubMsg);
  24. /*++
  25. Ignore the first call to NdrProxySendReceive.
  26. --*/
  27. HRESULT
  28. APIHOOK(NdrProxySendReceive)(
  29. void *pThis,
  30. MIDL_STUB_MESSAGE * pStubMsg
  31. )
  32. {
  33. HRESULT hr;
  34. if (g_bFirst && (pStubMsg->RpcMsg->ProcNum == 0x8013))
  35. {
  36. g_bFirst = FALSE;
  37. DPFN( eDbgLevelError, "Ignoring call to NdrProxySendReceive");
  38. hr = 0;
  39. }
  40. else
  41. {
  42. hr = ORIGINAL_API(NdrProxySendReceive)(pThis, pStubMsg);
  43. }
  44. return hr;
  45. }
  46. /*++
  47. Register hooked functions
  48. --*/
  49. HOOK_BEGIN
  50. APIHOOK_ENTRY(RPCRT4.DLL, NdrProxySendReceive)
  51. HOOK_END
  52. IMPLEMENT_SHIM_END