Source code of Windows XP (NT5)
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.

142 lines
4.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: thunkapi.hxx
  7. //
  8. // Contents: Defines interfaces and methods for use by the WOW thunking
  9. // system. This is intended as a private interface between
  10. // OLE32 and the WOW thunking layer.
  11. //
  12. // Classes: OleThunkWOW
  13. //
  14. // Functions:
  15. //
  16. // History: 3-15-94 kevinro Created
  17. //
  18. //----------------------------------------------------------------------------
  19. #ifndef __thunkapi_hxx__
  20. #define __thunkapi_hxx__
  21. //
  22. // ThunkManager interface
  23. //
  24. interface IThunkManager : public IUnknown
  25. {
  26. // *** IUnknown methods ***
  27. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  28. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  29. STDMETHOD_(ULONG,Release) (THIS) PURE;
  30. // *** IThunkManager methods ***
  31. STDMETHOD_(BOOL, IsIIDRequested) (THIS_ REFIID rrid) PURE;
  32. STDMETHOD_(BOOL, IsCustom3216Proxy) (THIS_ IUnknown *punk,
  33. REFIID riid) PURE;
  34. };
  35. //
  36. // The following sets up an interface between OLE32
  37. // and the WOW thunking system. This interface is intended to be private
  38. // between OLE32 and the WOW thunk layer.
  39. //
  40. class OleThunkWOW
  41. {
  42. public:
  43. STDMETHOD(LoadProcDll)( LPCWSTR pszDllName,
  44. LPDWORD lpvpfnGetClassObject,
  45. LPDWORD lpvpfnCanUnloadNow,
  46. LPDWORD lpvhmodule );
  47. STDMETHOD(UnloadProcDll)( HMODULE vhmodule );
  48. STDMETHOD(CallGetClassObject)( ULONG_PTR vpfnGetClassObject,
  49. REFCLSID rclsid,
  50. REFIID riid,
  51. LPVOID FAR *ppv );
  52. STDMETHOD(CallCanUnloadNow)( ULONG_PTR vpfnCanUnloadNow );
  53. STDMETHOD(GetThunkManager)( IThunkManager **pThkMgr);
  54. // Used to launch OLE 1.0 servers when we're in Wow
  55. STDMETHOD(WinExec16)(LPCOLESTR pszCommandLine, USHORT usShow);
  56. //
  57. // Called by the DDE code to convert incoming HWND's from
  58. // 16 bit HWND's into 32-bit HWND's.
  59. //
  60. STDMETHOD_(HWND,ConvertHwndToFullHwnd)(HWND hwnd);
  61. //
  62. // Called by the DDE code to delete a metafile
  63. //
  64. STDMETHOD_(BOOL,FreeMetaFile)(HANDLE hmf);
  65. // Called by Call Control to guarantee that a Yield happens
  66. // when running in Wow.
  67. STDMETHOD(YieldTask16)(void);
  68. // Call Control Directed Yeild
  69. STDMETHOD(DirectedYield)(DWORD dwCalleeTID);
  70. // Called by OLE32 when it is shutting down (done on a per thread basis)
  71. STDMETHOD_(void,PrepareForCleanup)(void);
  72. STDMETHOD_(DWORD,GetAppCompatibilityFlags)(void);
  73. };
  74. typedef OleThunkWOW *LPOLETHUNKWOW,OLETHUNKWOW;
  75. //
  76. // OLE Thunk Application Compatability flags
  77. //
  78. #define OACF_CLIENTSITE_REF 0x80000000 // IOleObject::GetClientSite not ref'd
  79. // Bug in Excel 5.0a
  80. #define OACF_RESETMENU 0x40000000 // IOleInPlaceFrame::RemoveMenu didn't
  81. // do a OleSetMenuDescriptor(NULL).
  82. #define OACF_USEGDI 0x20000000 // Word 6 thinks bitmaps and palette
  83. // objects are HGLOBALs, but they
  84. // are really GDI objects. We'll patch
  85. // this up for them.
  86. //
  87. // The following flag is set in olethunk\h\interop.hxx because it is used by
  88. // 16-bit binaries.
  89. // OACF_CORELTRASHMEM 0x10000000 // CorelDraw relies on the fact that
  90. // // OLE16 trashed memory during paste-
  91. // // link. Therefore, we'll go ahead
  92. // // and trash it for them if this
  93. // // flag is on.
  94. //
  95. // The original OLE32 version of the stdid table didn't clean up properly. Some apps cannot
  96. // handle the stdid calling after CoUninitialize. This flag prevents the stdid from doing so.
  97. // Word 6.0c is an example of this.
  98. //
  99. #define OACF_NO_UNINIT_CLEANUP 0x02000000 // Do not cleanup interfaces on CoUninitialize
  100. #define OACF_IVIEWOBJECT2 0x01000000 // use IViewObject2 instead IViewObject
  101. //
  102. // The following three routines are exported from OLE32.DLL, and
  103. // are called only by the WOW thunk layer.
  104. //
  105. STDAPI CoInitializeWOW( LPMALLOC vlpmalloc, LPOLETHUNKWOW lpthk );
  106. STDAPI CoUnloadingWOW(BOOL fProcessDetach);
  107. STDAPI OleInitializeWOW( LPMALLOC vlpmalloc, LPOLETHUNKWOW lpthk );
  108. STDAPI DllGetClassObjectWOW( REFCLSID rclsid, REFIID riid, LPVOID *ppv );
  109. extern void SetOleThunkWowPtr(LPOLETHUNKWOW lpthk);
  110. #endif //