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.

225 lines
10 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. // we don't want to use the CRTs, and would like some memory tracking in the
  37. // debug case, so we'll override these guys
  38. //=--------------------------------------------------------------------------=
  39. //
  40. //void * _cdecl operator new(size_t size);
  41. //void _cdecl operator delete(void *ptr);
  42. //=--------------------------------------------------------------------------=
  43. // Useful macros
  44. //=--------------------------------------------------------------------------=
  45. //
  46. // handy error macros, randing from cleaning up, to returning to clearing
  47. // rich error information as well.
  48. //
  49. #define RETURN_ON_FAILURE(hr) if (FAILED(hr)) return hr
  50. #define RETURN_ON_NULLALLOC(ptr) if (!(ptr)) return E_OUTOFMEMORY
  51. #define CLEANUP_ON_FAILURE(hr) if (FAILED(hr)) goto CleanUp
  52. #define CLEARERRORINFORET(hr) { SetErrorInfo(0, NULL); return hr; }
  53. #define CLEARERRORINFORET_ON_FAILURE(hr) if (FAILED(hr)) { SetErrorInfo(0, NULL); return hr; }
  54. #define CLEANUP_ON_ERROR(l) if (l != ERROR_SUCCESS) goto CleanUp
  55. // conversions
  56. //
  57. #define BOOL_TO_VARIANTBOOL(f) (f) ? VARIANT_TRUE : VARIANT_FALSE
  58. // Reference counting help.
  59. //
  60. #define RELEASE_OBJECT(ptr) if (ptr) { IUnknown *pUnk = (ptr); (ptr) = NULL; pUnk->Release(); }
  61. #define QUICK_RELEASE(ptr) if (ptr) ((IUnknown *)ptr)->Release();
  62. #define ADDREF_OBJECT(ptr) if (ptr) (ptr)->AddRef()
  63. //=--------------------------------------------------------------------------=
  64. // QueryInterface Optimizations
  65. //=--------------------------------------------------------------------------=
  66. // for optimizing QI's
  67. //
  68. #define DO_GUIDS_MATCH(riid1, riid2) ((riid1.Data1 == riid2.Data1) && (riid1 == riid2))
  69. // Data1_*
  70. //
  71. // the first dword of GUIDs for most of the interesting interfaces. these are
  72. // used by speed critical versions of QueryInterface
  73. //
  74. #define Data1_IAdviseSink 0x0000010f
  75. #define Data1_IAdviseSink2 0x00000125
  76. #define Data1_IAdviseSinkEx 0x3af24290
  77. #define Data1_IBindCtx 0x0000000e
  78. #define Data1_ICDataDoc 0xF413E4C0
  79. #define Data1_IClassFactory 0x00000001
  80. #define Data1_IClassFactory2 0xb196b28f
  81. #define Data1_IConnectionPoint 0xb196b286
  82. #define Data1_IConnectionPointContainer 0xb196b284
  83. #define Data1_IControl_95 0x9a4bbfb5
  84. #define Data1_IControl 0xa7fddba0
  85. #define Data1_ICreateErrorInfo 0x22f03340
  86. #define Data1_ICreateTypeInfo 0x00020405
  87. #define Data1_ICreateTypeLib 0x00020406
  88. #define Data1_IDataAdviseHolder 0x00000110
  89. #define Data1_IDataFrame 0x97F254E0
  90. #define Data1_IDataFrameExpert 0x73687490
  91. #define Data1_IDataObject 0x0000010e
  92. #define Data1_IDispatch 0x00020400
  93. #define Data1_IDropSource 0x00000121
  94. #define Data1_IDropTarget 0x00000122
  95. #define Data1_IEnumCallback 0x00000108
  96. #define Data1_IEnumConnectionPoints 0xb196b285
  97. #define Data1_IEnumConnections 0xb196b287
  98. #define Data1_IEnumFORMATETC 0x00000103
  99. #define Data1_IEnumGeneric 0x00000106
  100. #define Data1_IEnumHolder 0x00000107
  101. #define Data1_IEnumMoniker 0x00000102
  102. #define Data1_IEnumOLEVERB 0x00000104
  103. #define Data1_IEnumSTATDATA 0x00000105
  104. #define Data1_IEnumSTATSTG 0x0000000d
  105. #define Data1_IEnumString 0x00000101
  106. #define Data1_IEnumOleUndoActions 0xb3e7c340
  107. #define Data1_IEnumUnknown 0x00000100
  108. #define Data1_IEnumVARIANT 0x00020404
  109. #define Data1_IErrorInfo 0x1cf2b120
  110. #define Data1_IExternalConnection 0x00000019
  111. #define Data1_IFont 0xbef6e002
  112. #define Data1_IFontDisp 0xbef6e003
  113. #define Data1_IFormExpert 0x5aac7f70
  114. #define Data1_IGangConnectWithDefault 0x6d5140c0
  115. #define Data1_IInternalMoniker 0x00000011
  116. #define Data1_ILockBytes 0x0000000a
  117. #define Data1_IMalloc 0x00000002
  118. #define Data1_IMarshal 0x00000003
  119. #define Data1_IMessageFilter 0x00000016
  120. #define Data1_IMoniker 0x0000000f
  121. #define Data1_IMsoCommandTarget 0xb722bccb
  122. #define Data1_IMsoDocument 0xb722bcc5
  123. #define Data1_IOleInPlaceComponent 0x5efc7970
  124. #define Data1_IMsoView 0xb722bcc6
  125. #define Data1_IOleAdviseHolder 0x00000111
  126. #define Data1_IOleCache 0x0000011e
  127. #define Data1_IOleCache2 0x00000128
  128. #define Data1_IOleCacheControl 0x00000129
  129. #define Data1_IOleClientSite 0x00000118
  130. #define Data1_IOleCompoundUndoAction 0xa1faf330
  131. #define Data1_IOleContainer 0x0000011b
  132. #define Data1_IOleControl 0xb196b288
  133. #define Data1_IOleControlSite 0xb196b289
  134. #define Data1_IOleInPlaceActiveObject 0x00000117
  135. #define Data1_IOleInPlaceFrame 0x00000116
  136. #define Data1_IOleInPlaceObject 0x00000113
  137. #define Data1_IOleInPlaceObjectWindowless 0x1c2056cc
  138. #define Data1_IOleInPlaceSite 0x00000119
  139. #define Data1_IOleInPlaceSiteEx 0x9c2cad80
  140. #define Data1_IOleInPlaceSiteWindowless 0x922eada0
  141. #define Data1_IOleInPlaceUIWindow 0x00000115
  142. #define Data1_IOleItemContainer 0x0000011c
  143. #define Data1_IOleLink 0x0000011d
  144. #define Data1_IOleManager 0x0000011f
  145. #define Data1_IOleObject 0x00000112
  146. #define Data1_IOlePresObj 0x00000120
  147. #define Data1_IOlePropertyFrame 0xb83bb801
  148. #define Data1_IOleStandardTool 0xd97877c4
  149. #define Data1_IOleUndoAction 0x894ad3b0
  150. #define Data1_IOleUndoActionManager 0xd001f200
  151. #define Data1_IOleWindow 0x00000114
  152. #define Data1_IPSFactory 0x00000009
  153. #define Data1_IPSFactoryBuffer 0xd5f569d0
  154. #define Data1_IParseDisplayName 0x0000011a
  155. #define Data1_IPerPropertyBrowsing 0x376bd3aa
  156. #define Data1_IPersist 0x0000010c
  157. #define Data1_IPersistFile 0x0000010b
  158. #define Data1_IPersistPropertyBag 0x37D84F60
  159. #define Data1_IPersistStorage 0x0000010a
  160. #define Data1_IPersistStream 0x00000109
  161. #define Data1_IPersistStreamInit 0x7fd52380
  162. #define Data1_IPicture 0x7bf80980
  163. #define Data1_IPictureDisp 0x7bf80981
  164. #define Data1_IPointerInactive 0x55980ba0
  165. #define Data1_IPropertyNotifySink 0x9bfbbc02
  166. #define Data1_IPropertyPage 0xb196b28d
  167. #define Data1_IPropertyPage2 0x01e44665
  168. #define Data1_IPropertyPage3 0xb83bb803
  169. #define Data1_IPropertyPageInPlace 0xb83bb802
  170. #define Data1_IPropertyPageSite 0xb196b28c
  171. #define Data1_IPropertyPageSite2 0xb83bb804
  172. #define Data1_IProvideClassInfo 0xb196b283
  173. #define Data1_IProvideDynamicClassInfo 0x6d5140d1
  174. #define Data1_IQuickActivate 0xcf51ed10
  175. #define Data1_IRequireClasses 0x6d5140d0
  176. #define Data1_IRootStorage 0x00000012
  177. #define Data1_IRunnableObject 0x00000126
  178. #define Data1_IRunningObjectTable 0x00000010
  179. #define Data1_ISelectionContainer 0x6d5140c6
  180. #define Data1_IServiceProvider 0x6d5140c1
  181. #define Data1_ISimpleFrameSite 0x742b0e01
  182. #define Data1_ISpecifyPropertyPages 0xb196b28b
  183. #define Data1_IStdMarshalInfo 0x00000018
  184. #define Data1_IStorage 0x0000000b
  185. #define Data1_IStream 0x0000000c
  186. #define Data1_ISupportErrorInfo 0xdf0b3d60
  187. #define Data1_ITypeComp 0x00020403
  188. #define Data1_ITypeInfo 0x00020401
  189. #define Data1_ITypeLib 0x00020402
  190. #define Data1_IUnknown 0x00000000
  191. #define Data1_IViewObject 0x0000010d
  192. #define Data1_IViewObject2 0x00000127
  193. #define Data1_IViewObjectEx 0x3af24292
  194. #define Data1_IWeakRef 0x0000001a
  195. #define Data1_ICategorizeProperties 0x4d07fc10
  196. #define QI_INHERITS(pObj, itf) \
  197. case Data1_##itf: \
  198. if(DO_GUIDS_MATCH(riid, IID_##itf)) \
  199. { \
  200. *ppvObjOut = (void *)(itf *)pObj; \
  201. } \
  202. break;
  203. #include "extobj.h"
  204. #define _IPSERVER_H_
  205. #endif // _IPSERVER_H_