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.

216 lines
9.8 KiB

  1. //=--------------------------------------------------------------------------=
  2. // IPServer.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995-1996 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 _IPSERVER_H_
  16. //#define INC_OLE2
  17. #include <windows.h>
  18. #include <stddef.h> // for offsetof()
  19. #include <olectl.h>
  20. // things that -everybody- wants [read: is going to get]
  21. //
  22. #include "Debug.H"
  23. //=--------------------------------------------------------------------------=
  24. // controls can register for thread notifications in their InitializeLibrary()
  25. //
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif // __cplusplus
  29. typedef void (CALLBACK *THRDNFYPROC)(HANDLE, DWORD, void *);
  30. void SetLibraryThreadProc(THRDNFYPROC pfnThreadNotify);
  31. #ifdef __cplusplus
  32. }
  33. #endif // __cplusplus
  34. //=--------------------------------------------------------------------------=
  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_IAdviseSink 0x0000010f
  68. #define Data1_IAdviseSink2 0x00000125
  69. #define Data1_IAdviseSinkEx 0x3af24290
  70. #define Data1_IBindCtx 0x0000000e
  71. #define Data1_ICDataDoc 0xF413E4C0
  72. #define Data1_IClassFactory 0x00000001
  73. #define Data1_IClassFactory2 0xb196b28f
  74. #define Data1_IConnectionPoint 0xb196b286
  75. #define Data1_IConnectionPointContainer 0xb196b284
  76. #define Data1_IControl_95 0x9a4bbfb5
  77. #define Data1_IControl 0xa7fddba0
  78. #define Data1_ICreateErrorInfo 0x22f03340
  79. #define Data1_ICreateTypeInfo 0x00020405
  80. #define Data1_ICreateTypeLib 0x00020406
  81. #define Data1_IDataAdviseHolder 0x00000110
  82. #define Data1_IDataFrame 0x97F254E0
  83. #define Data1_IDataFrameExpert 0x73687490
  84. #define Data1_IDataObject 0x0000010e
  85. #define Data1_IDispatch 0x00020400
  86. #define Data1_IDropSource 0x00000121
  87. #define Data1_IDropTarget 0x00000122
  88. #define Data1_IEnumCallback 0x00000108
  89. #define Data1_IEnumConnectionPoints 0xb196b285
  90. #define Data1_IEnumConnections 0xb196b287
  91. #define Data1_IEnumFORMATETC 0x00000103
  92. #define Data1_IEnumGeneric 0x00000106
  93. #define Data1_IEnumHolder 0x00000107
  94. #define Data1_IEnumMoniker 0x00000102
  95. #define Data1_IEnumOLEVERB 0x00000104
  96. #define Data1_IEnumSTATDATA 0x00000105
  97. #define Data1_IEnumSTATSTG 0x0000000d
  98. #define Data1_IEnumString 0x00000101
  99. #define Data1_IEnumOleUndoActions 0xb3e7c340
  100. #define Data1_IEnumUnknown 0x00000100
  101. #define Data1_IEnumVARIANT 0x00020404
  102. #define Data1_IErrorInfo 0x1cf2b120
  103. #define Data1_IExternalConnection 0x00000019
  104. #define Data1_IFont 0xbef6e002
  105. #define Data1_IFontDisp 0xbef6e003
  106. #define Data1_IFormExpert 0x5aac7f70
  107. #define Data1_IGangConnectWithDefault 0x6d5140c0
  108. #define Data1_IInternalMoniker 0x00000011
  109. #define Data1_ILockBytes 0x0000000a
  110. #define Data1_IMalloc 0x00000002
  111. #define Data1_IMarshal 0x00000003
  112. #define Data1_IMessageFilter 0x00000016
  113. #define Data1_IMoniker 0x0000000f
  114. #define Data1_IMsoCommandTarget 0xb722bccb
  115. #define Data1_IMsoDocument 0xb722bcc5
  116. #define Data1_IOleInPlaceComponent 0x5efc7970
  117. #define Data1_IMsoView 0xb722bcc6
  118. #define Data1_IOleAdviseHolder 0x00000111
  119. #define Data1_IOleCache 0x0000011e
  120. #define Data1_IOleCache2 0x00000128
  121. #define Data1_IOleCacheControl 0x00000129
  122. #define Data1_IOleClientSite 0x00000118
  123. #define Data1_IOleCompoundUndoAction 0xa1faf330
  124. #define Data1_IOleContainer 0x0000011b
  125. #define Data1_IOleControl 0xb196b288
  126. #define Data1_IOleControlSite 0xb196b289
  127. #define Data1_IOleInPlaceActiveObject 0x00000117
  128. #define Data1_IOleInPlaceFrame 0x00000116
  129. #define Data1_IOleInPlaceObject 0x00000113
  130. #define Data1_IOleInPlaceObjectWindowless 0x1c2056cc
  131. #define Data1_IOleInPlaceSite 0x00000119
  132. #define Data1_IOleInPlaceSiteEx 0x9c2cad80
  133. #define Data1_IOleInPlaceSiteWindowless 0x922eada0
  134. #define Data1_IOleInPlaceUIWindow 0x00000115
  135. #define Data1_IOleItemContainer 0x0000011c
  136. #define Data1_IOleLink 0x0000011d
  137. #define Data1_IOleManager 0x0000011f
  138. #define Data1_IOleObject 0x00000112
  139. #define Data1_IOlePresObj 0x00000120
  140. #define Data1_IOlePropertyFrame 0xb83bb801
  141. #define Data1_IOleStandardTool 0xd97877c4
  142. #define Data1_IOleUndoAction 0x894ad3b0
  143. #define Data1_IOleUndoActionManager 0xd001f200
  144. #define Data1_IOleWindow 0x00000114
  145. #define Data1_IPSFactory 0x00000009
  146. #define Data1_IPSFactoryBuffer 0xd5f569d0
  147. #define Data1_IParseDisplayName 0x0000011a
  148. #define Data1_IPerPropertyBrowsing 0x376bd3aa
  149. #define Data1_IPersist 0x0000010c
  150. #define Data1_IPersistFile 0x0000010b
  151. #define Data1_IPersistPropertyBag 0x37D84F60
  152. #define Data1_IPersistStorage 0x0000010a
  153. #define Data1_IPersistStream 0x00000109
  154. #define Data1_IPersistStreamInit 0x7fd52380
  155. #define Data1_IPicture 0x7bf80980
  156. #define Data1_IPictureDisp 0x7bf80981
  157. #define Data1_IPointerInactive 0x55980ba0
  158. #define Data1_IPropertyNotifySink 0x9bfbbc02
  159. #define Data1_IPropertyPage 0xb196b28d
  160. #define Data1_IPropertyPage2 0x01e44665
  161. #define Data1_IPropertyPage3 0xb83bb803
  162. #define Data1_IPropertyPageInPlace 0xb83bb802
  163. #define Data1_IPropertyPageSite 0xb196b28c
  164. #define Data1_IPropertyPageSite2 0xb83bb804
  165. #define Data1_IProvideClassInfo 0xb196b283
  166. #define Data1_IProvideDynamicClassInfo 0x6d5140d1
  167. #define Data1_IQuickActivate 0xcf51ed10
  168. #define Data1_IRequireClasses 0x6d5140d0
  169. #define Data1_IRootStorage 0x00000012
  170. #define Data1_IRunnableObject 0x00000126
  171. #define Data1_IRunningObjectTable 0x00000010
  172. #define Data1_ISelectionContainer 0x6d5140c6
  173. #define Data1_IServiceProvider 0x6d5140c1
  174. #define Data1_ISimpleFrameSite 0x742b0e01
  175. #define Data1_ISpecifyPropertyPages 0xb196b28b
  176. #define Data1_IStdMarshalInfo 0x00000018
  177. #define Data1_IStorage 0x0000000b
  178. #define Data1_IStream 0x0000000c
  179. #define Data1_ISupportErrorInfo 0xdf0b3d60
  180. #define Data1_ITypeComp 0x00020403
  181. #define Data1_ITypeInfo 0x00020401
  182. #define Data1_ITypeLib 0x00020402
  183. #define Data1_IUnknown 0x00000000
  184. #define Data1_IViewObject 0x0000010d
  185. #define Data1_IViewObject2 0x00000127
  186. #define Data1_IViewObjectEx 0x3af24292
  187. #define Data1_IWeakRef 0x0000001a
  188. #define Data1_ICategorizeProperties 0x4d07fc10
  189. #define QI_INHERITS(pObj, itf) \
  190. case Data1_##itf: \
  191. if(DO_GUIDS_MATCH(riid, IID_##itf)) \
  192. { \
  193. *ppvObjOut = (void *)(itf *)pObj; \
  194. } \
  195. break;
  196. #include "extobj.h"
  197. #define _IPSERVER_H_
  198. #endif // _IPSERVER_H_