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.

221 lines
9.8 KiB

  1. //=--------------------------------------------------------------------------=
  2. // InProcServer.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // global header file that contains all the windows stuff, etc ... should
  13. // be pre-compiled to speed things up a little bit.
  14. //
  15. #ifndef _INPROCSERVER_H_
  16. #define INC_OLE2
  17. #include <windows.h>
  18. #include <stddef.h> // for offsetof()
  19. #include <olectl.h>
  20. #ifdef VC4_BUILD
  21. typedef BOOL bool;
  22. #define false FALSE
  23. #define true TRUE
  24. #endif
  25. // things that -everybody- wants [read: is going to get]
  26. //
  27. #include "Debug.H"
  28. //=--------------------------------------------------------------------------=
  29. // we don't want to use the CRTs, and would like some memory tracking in the
  30. // debug case, so we'll override these guys
  31. //=--------------------------------------------------------------------------=
  32. //
  33. void * _cdecl operator new(size_t size);
  34. void _cdecl operator delete(void *ptr);
  35. //=--------------------------------------------------------------------------=
  36. // Useful macros
  37. //=--------------------------------------------------------------------------=
  38. //
  39. // handy error macros, randing from cleaning up, to returning to clearing
  40. // rich error information as well.
  41. //
  42. #define RETURN_ON_FAILURE(hr) if (FAILED(hr)) return hr
  43. #define RETURN_ON_NULLALLOC(ptr) if (!(ptr)) return E_OUTOFMEMORY
  44. #define CLEANUP_ON_FAILURE(hr) if (FAILED(hr)) goto CleanUp
  45. #define CLEARERRORINFORET(hr) { SetErrorInfo(0, NULL); return hr; }
  46. #define CLEARERRORINFORET_ON_FAILURE(hr) if (FAILED(hr)) { SetErrorInfo(0, NULL); return hr; }
  47. #define CLEANUP_ON_ERROR(l) if (l != ERROR_SUCCESS) goto CleanUp
  48. // conversions
  49. //
  50. #define BOOL_TO_VARIANTBOOL(f) (f) ? VARIANT_TRUE : VARIANT_FALSE
  51. // Reference counting help.
  52. //
  53. #define RELEASE_OBJECT(ptr) if (ptr) { IUnknown *__pUnk = (ptr); (ptr) = NULL; __pUnk->Release(); }
  54. #define QUICK_RELEASE(ptr) if (ptr) ((IUnknown *)ptr)->Release();
  55. #define ADDREF_OBJECT(ptr) if (ptr) (ptr)->AddRef()
  56. //=--------------------------------------------------------------------------=
  57. // QueryInterface Optimizations
  58. //=--------------------------------------------------------------------------=
  59. // for optimizing QI's
  60. //
  61. #define DO_GUIDS_MATCH(riid1, riid2) ((riid1.Data1 == riid2.Data1) && (riid1 == riid2))
  62. // Data1_*
  63. //
  64. // the first dword of GUIDs for most of the interesting interfaces. these are
  65. // used by speed critical versions of QueryInterface
  66. //
  67. #define Data1_IActiveDesigner 0x51AAE3E0
  68. #define Data1_IAdviseSink 0x0000010f
  69. #define Data1_IAdviseSink2 0x00000125
  70. #define Data1_IAdviseSinkEx 0x3af24290
  71. #define Data1_IBindCtx 0x0000000e
  72. #define Data1_ICDataDoc 0xF413E4C0
  73. #define Data1_IClassFactory 0x00000001
  74. #define Data1_IClassFactory2 0xb196b28f
  75. #define Data1_IConnectionPoint 0xb196b286
  76. #define Data1_IConnectionPointContainer 0xb196b284
  77. #define Data1_IControl_95 0x9a4bbfb5
  78. #define Data1_IControl 0xa7fddba0
  79. #define Data1_ICreateErrorInfo 0x22f03340
  80. #define Data1_ICreateTypeInfo 0x00020405
  81. #define Data1_ICreateTypeLib 0x00020406
  82. #define Data1_IDataAdviseHolder 0x00000110
  83. #define Data1_IDataFrame 0x97F254E0
  84. #define Data1_IDataFrameExpert 0x73687490
  85. #define Data1_IDataObject 0x0000010e
  86. #define Data1_IDispatch 0x00020400
  87. #define Data1_IDropSource 0x00000121
  88. #define Data1_IDropTarget 0x00000122
  89. #define Data1_IEnumCallback 0x00000108
  90. #define Data1_IEnumConnectionPoints 0xb196b285
  91. #define Data1_IEnumConnections 0xb196b287
  92. #define Data1_IEnumFORMATETC 0x00000103
  93. #define Data1_IEnumGeneric 0x00000106
  94. #define Data1_IEnumHolder 0x00000107
  95. #define Data1_IEnumMoniker 0x00000102
  96. #define Data1_IEnumOLEVERB 0x00000104
  97. #define Data1_IEnumSTATDATA 0x00000105
  98. #define Data1_IEnumSTATSTG 0x0000000d
  99. #define Data1_IEnumString 0x00000101
  100. #define Data1_IEnumOleUndoActions 0xb3e7c340
  101. #define Data1_IEnumUnknown 0x00000100
  102. #define Data1_IEnumVARIANT 0x00020404
  103. #define Data1_IErrorInfo 0x1cf2b120
  104. #define Data1_IExternalConnection 0x00000019
  105. #define Data1_IFont 0xbef6e002
  106. #define Data1_IFontDisp 0xbef6e003
  107. #define Data1_IFormExpert 0x5aac7f70
  108. #define Data1_IGangConnectWithDefault 0x6d5140c0
  109. #define Data1_IInternalMoniker 0x00000011
  110. #define Data1_ILockBytes 0x0000000a
  111. #define Data1_IMalloc 0x00000002
  112. #define Data1_IMarshal 0x00000003
  113. #define Data1_IMessageFilter 0x00000016
  114. #define Data1_IMoniker 0x0000000f
  115. #define Data1_IMsoCommandTarget 0xb722bccb
  116. #define Data1_IMsoDocument 0xb722bcc5
  117. #define Data1_IOleInPlaceComponent 0x5efc7970
  118. #define Data1_IMsoView 0xb722bcc6
  119. #define Data1_IOleAdviseHolder 0x00000111
  120. #define Data1_IOleCache 0x0000011e
  121. #define Data1_IOleCache2 0x00000128
  122. #define Data1_IOleCacheControl 0x00000129
  123. #define Data1_IOleClientSite 0x00000118
  124. #define Data1_IOleCompoundUndoAction 0xa1faf330
  125. #define Data1_IOleContainer 0x0000011b
  126. #define Data1_IOleControl 0xb196b288
  127. #define Data1_IOleControlSite 0xb196b289
  128. #define Data1_IOleInPlaceActiveObject 0x00000117
  129. #define Data1_IOleInPlaceFrame 0x00000116
  130. #define Data1_IOleInPlaceObject 0x00000113
  131. #define Data1_IOleInPlaceObjectWindowless 0x1c2056cc
  132. #define Data1_IOleInPlaceSite 0x00000119
  133. #define Data1_IOleInPlaceSiteEx 0x9c2cad80
  134. #define Data1_IOleInPlaceSiteWindowless 0x922eada0
  135. #define Data1_IOleInPlaceUIWindow 0x00000115
  136. #define Data1_IOleItemContainer 0x0000011c
  137. #define Data1_IOleLink 0x0000011d
  138. #define Data1_IOleManager 0x0000011f
  139. #define Data1_IOleObject 0x00000112
  140. #define Data1_IOlePresObj 0x00000120
  141. #define Data1_IOlePropertyFrame 0xb83bb801
  142. #define Data1_IOleStandardTool 0xd97877c4
  143. #define Data1_IOleUndoAction 0x894ad3b0
  144. #define Data1_IOleUndoActionManager 0xd001f200
  145. #define Data1_IOleWindow 0x00000114
  146. #define Data1_IPSFactory 0x00000009
  147. #define Data1_IPSFactoryBuffer 0xd5f569d0
  148. #define Data1_IParseDisplayName 0x0000011a
  149. #define Data1_IPerPropertyBrowsing 0x376bd3aa
  150. #define Data1_IPersist 0x0000010c
  151. #define Data1_IPersistFile 0x0000010b
  152. #define Data1_IPersistPropertyBag 0x37D84F60
  153. #define Data1_IPersistStorage 0x0000010a
  154. #define Data1_IPersistStream 0x00000109
  155. #define Data1_IPersistStreamInit 0x7fd52380
  156. #define Data1_IPicture 0x7bf80980
  157. #define Data1_IPictureDisp 0x7bf80981
  158. #define Data1_IPointerInactive 0x55980ba0
  159. #define Data1_IPropertyNotifySink 0x9bfbbc02
  160. #define Data1_IPropertyPage 0xb196b28d
  161. #define Data1_IPropertyPage2 0x01e44665
  162. #define Data1_IPropertyPage3 0xb83bb803
  163. #define Data1_IPropertyPageInPlace 0xb83bb802
  164. #define Data1_IPropertyPageSite 0xb196b28c
  165. #define Data1_IPropertyPageSite2 0xb83bb804
  166. #define Data1_IProvideClassInfo 0xb196b283
  167. #define Data1_IProvideDynamicClassInfo 0x468cfb80
  168. #define Data1_IQuickActivate 0xcf51ed10
  169. #define Data1_IRequireClasses 0x6d5140d0
  170. #define Data1_IRootStorage 0x00000012
  171. #define Data1_IRunnableObject 0x00000126
  172. #define Data1_IRunningObjectTable 0x00000010
  173. #define Data1_ISelectionContainer 0x6d5140c6
  174. #define Data1_IServiceProvider 0x6d5140c1
  175. #define Data1_ISimpleFrameSite 0x742b0e01
  176. #define Data1_ISpecifyPropertyPages 0xb196b28b
  177. #define Data1_IStdMarshalInfo 0x00000018
  178. #define Data1_IStorage 0x0000000b
  179. #define Data1_IStream 0x0000000c
  180. #define Data1_ISupportErrorInfo 0xdf0b3d60
  181. #define Data1_ITypeComp 0x00020403
  182. #define Data1_ITypeInfo 0x00020401
  183. #define Data1_ITypeLib 0x00020402
  184. #define Data1_IUnknown 0x00000000
  185. #define Data1_IViewObject 0x0000010d
  186. #define Data1_IViewObject2 0x00000127
  187. #define Data1_IViewObjectEx 0x3af24292
  188. #define Data1_IWeakRef 0x0000001a
  189. #define Data1_ICategorizeProperties 0x4d07fc10
  190. #define Data1_IObjectSafety 0xcb5bdc81
  191. #define QI_INHERITS(pObj, itf) \
  192. case Data1_##itf: \
  193. if(DO_GUIDS_MATCH(riid, IID_##itf)) \
  194. { \
  195. itf *pITF = pObj; \
  196. *ppvObjOut = (void *)(itf *)pObj; \
  197. } \
  198. break;
  199. #define SAFE_CAST(varDest, varSrc, type) \
  200. { type var = varSrc; varDest = (type)varSrc; }
  201. #define _INPROCSERVER_H_
  202. #endif // _INPROCSERVER_H_