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.

245 lines
9.3 KiB

  1. /*****************************************************************************\
  2. * *
  3. * moniker.h - moniker and related interfaces and APIs *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) 1993-1994, Microsoft Corp. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #if !defined( _MONIKER_H_ )
  11. #define _MONIKER_H_
  12. #define MK_E_CONNECTMANUALLY MK_E_FIRST
  13. #define MK_E_EXCEEDEDDEADLINE (MK_E_FIRST + 1)
  14. #define MK_E_NEEDGENERIC (MK_E_FIRST + 2)
  15. #define MK_E_UNAVAILABLE (MK_E_FIRST + 3)
  16. #define MK_E_SYNTAX (MK_E_FIRST + 4)
  17. #define MK_E_NOOBJECT (MK_E_FIRST + 5)
  18. #define MK_E_INVALIDEXTENSION (MK_E_FIRST + 6)
  19. #define MK_E_INTERMEDIATEINTERFACENOTSUPPORTED (MK_E_FIRST + 7)
  20. #define MK_E_NOTBINDABLE (MK_E_FIRST + 8)
  21. #define MK_E_NOTBOUND (MK_E_FIRST + 9)
  22. // called IBindCtx->RevokeObjectBound for an
  23. // object which was not bound
  24. #define MK_E_CANTOPENFILE (MK_E_FIRST + 10)
  25. #define MK_E_MUSTBOTHERUSER (MK_E_FIRST + 11)
  26. #define MK_E_NOINVERSE (MK_E_FIRST + 12)
  27. #define MK_E_NOSTORAGE (MK_E_FIRST + 13)
  28. #define MK_E_NOPREFIX (MK_E_FIRST + 14)
  29. // reserved MK_S_FIRST
  30. // reserved (MK_S_FIRST + 1)
  31. #define MK_S_REDUCED_TO_SELF (MK_S_FIRST + 2)
  32. // reserved (MK_S_FIRST + 3)
  33. #define MK_S_ME (MK_S_FIRST + 4)
  34. #define MK_S_HIM (MK_S_FIRST + 5)
  35. #define MK_S_US (MK_S_FIRST + 6)
  36. #define MK_S_MONIKERALREADYREGISTERED (MK_S_FIRST + 7)
  37. // bind options; variable sized
  38. typedef struct FARSTRUCT tagBIND_OPTS
  39. {
  40. DWORD cbStruct; // sizeof(BIND_OPTS)
  41. DWORD grfFlags;
  42. DWORD grfMode;
  43. DWORD dwTickCountDeadline;
  44. } BIND_OPTS, FAR* LPBIND_OPTS;
  45. // bind flags; controls binding; stored in bind options above
  46. typedef enum
  47. {
  48. BIND_MAYBOTHERUSER = 1,
  49. BIND_JUSTTESTEXISTENCE = 2
  50. } BIND_FLAGS;
  51. // system moniker types; returned from IsSystemMoniker.
  52. typedef enum tagMKSYS
  53. {
  54. MKSYS_NONE = 0,
  55. MKSYS_GENERICCOMPOSITE = 1,
  56. MKSYS_FILEMONIKER = 2,
  57. MKSYS_ANTIMONIKER = 3,
  58. MKSYS_ITEMMONIKER = 4,
  59. MKSYS_POINTERMONIKER = 5
  60. }MKSYS;
  61. // bit wise enum to control how much reduction takes place.
  62. typedef enum tagMKREDUCE
  63. {
  64. MKRREDUCE_ONE = 3<<16,
  65. MKRREDUCE_TOUSER = 2<<16,
  66. MKRREDUCE_THROUGHUSER = 1<<16,
  67. MKRREDUCE_ALL = 0
  68. } MKRREDUCE;
  69. #if defined(__cplusplus)
  70. interface IEnumMoniker;
  71. interface IRunningObjectTable;
  72. #else
  73. typedef interface IEnumMoniker IEnumMoniker;
  74. typedef interface IRunningObjectTable IRunningObjectTable;
  75. #endif
  76. typedef IEnumMoniker FAR* LPENUMMONIKER;
  77. typedef IRunningObjectTable FAR* LPRUNNINGOBJECTTABLE;
  78. #undef INTERFACE
  79. #define INTERFACE IBindCtx
  80. DECLARE_INTERFACE_(IBindCtx, IUnknown)
  81. {
  82. // *** IUnknown methods ***
  83. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  84. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  85. STDMETHOD_(ULONG,Release) (THIS) PURE;
  86. // *** IBindCtx methods ***
  87. STDMETHOD(RegisterObjectBound) (THIS_ LPUNKNOWN punk) PURE;
  88. STDMETHOD(RevokeObjectBound) (THIS_ LPUNKNOWN punk) PURE;
  89. STDMETHOD(ReleaseBoundObjects) (THIS) PURE;
  90. STDMETHOD(SetBindOptions) (THIS_ LPBIND_OPTS pbindopts) PURE;
  91. STDMETHOD(GetBindOptions) (THIS_ LPBIND_OPTS pbindopts) PURE;
  92. STDMETHOD(GetRunningObjectTable) (THIS_ LPRUNNINGOBJECTTABLE FAR*
  93. pprot) PURE;
  94. STDMETHOD(RegisterObjectParam) (THIS_ LPSTR lpszKey, LPUNKNOWN punk) PURE;
  95. STDMETHOD(GetObjectParam) (THIS_ LPSTR lpszKey, LPUNKNOWN FAR* ppunk) PURE;
  96. STDMETHOD(EnumObjectParam) (THIS_ LPENUMSTRING FAR* ppenum) PURE;
  97. STDMETHOD(RevokeObjectParam) (THIS_ LPSTR lpszKey) PURE;
  98. };
  99. typedef IBindCtx FAR* LPBC;
  100. typedef IBindCtx FAR* LPBINDCTX;
  101. #undef INTERFACE
  102. #define INTERFACE IMoniker
  103. DECLARE_INTERFACE_(IMoniker, IPersistStream)
  104. {
  105. // *** IUnknown methods ***
  106. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  107. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  108. STDMETHOD_(ULONG,Release) (THIS) PURE;
  109. // *** IPersist methods ***
  110. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  111. // *** IPersistStream methods ***
  112. STDMETHOD(IsDirty) (THIS) PURE;
  113. STDMETHOD(Load) (THIS_ LPSTREAM pStm) PURE;
  114. STDMETHOD(Save) (THIS_ LPSTREAM pStm,
  115. BOOL fClearDirty) PURE;
  116. STDMETHOD(GetSizeMax) (THIS_ ULARGE_INTEGER FAR * pcbSize) PURE;
  117. // *** IMoniker methods ***
  118. STDMETHOD(BindToObject) (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  119. REFIID riidResult, LPVOID FAR* ppvResult) PURE;
  120. STDMETHOD(BindToStorage) (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  121. REFIID riid, LPVOID FAR* ppvObj) PURE;
  122. STDMETHOD(Reduce) (THIS_ LPBC pbc, DWORD dwReduceHowFar, LPMONIKER FAR*
  123. ppmkToLeft, LPMONIKER FAR * ppmkReduced) PURE;
  124. STDMETHOD(ComposeWith) (THIS_ LPMONIKER pmkRight, BOOL fOnlyIfNotGeneric,
  125. LPMONIKER FAR* ppmkComposite) PURE;
  126. STDMETHOD(Enum) (THIS_ BOOL fForward, LPENUMMONIKER FAR* ppenumMoniker)
  127. PURE;
  128. STDMETHOD(IsEqual) (THIS_ LPMONIKER pmkOtherMoniker) PURE;
  129. STDMETHOD(Hash) (THIS_ LPDWORD pdwHash) PURE;
  130. STDMETHOD(IsRunning) (THIS_ LPBC pbc, LPMONIKER pmkToLeft, LPMONIKER
  131. pmkNewlyRunning) PURE;
  132. STDMETHOD(GetTimeOfLastChange) (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  133. FILETIME FAR* pfiletime) PURE;
  134. STDMETHOD(Inverse) (THIS_ LPMONIKER FAR* ppmk) PURE;
  135. STDMETHOD(CommonPrefixWith) (THIS_ LPMONIKER pmkOther, LPMONIKER FAR*
  136. ppmkPrefix) PURE;
  137. STDMETHOD(RelativePathTo) (THIS_ LPMONIKER pmkOther, LPMONIKER FAR*
  138. ppmkRelPath) PURE;
  139. STDMETHOD(GetDisplayName) (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  140. LPSTR FAR* lplpszDisplayName) PURE;
  141. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  142. LPSTR lpszDisplayName, ULONG FAR* pchEaten,
  143. LPMONIKER FAR* ppmkOut) PURE;
  144. STDMETHOD(IsSystemMoniker) (THIS_ LPDWORD pdwMksys) PURE;
  145. };
  146. typedef IMoniker FAR* LPMONIKER;
  147. #undef INTERFACE
  148. #define INTERFACE IRunningObjectTable
  149. DECLARE_INTERFACE_(IRunningObjectTable, IUnknown)
  150. {
  151. // *** IUnknown methods ***
  152. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  153. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  154. STDMETHOD_(ULONG,Release) (THIS) PURE;
  155. // *** IRunningObjectTable methods ***
  156. STDMETHOD(Register) (THIS_ DWORD grfFlags, LPUNKNOWN punkObject,
  157. LPMONIKER pmkObjectName, DWORD FAR * pdwRegister) PURE;
  158. STDMETHOD(Revoke) (THIS_ DWORD dwRegister) PURE;
  159. STDMETHOD(IsRunning) (THIS_ LPMONIKER pmkObjectName) PURE;
  160. STDMETHOD(GetObject) (THIS_ LPMONIKER pmkObjectName,
  161. LPUNKNOWN FAR* ppunkObject) PURE;
  162. STDMETHOD(NoteChangeTime) (THIS_ DWORD dwRegister, FILETIME FAR * pfiletime) PURE;
  163. STDMETHOD(GetTimeOfLastChange) (THIS_ LPMONIKER pmkObjectName, FILETIME FAR * pfiletime) PURE;
  164. STDMETHOD(EnumRunning) (THIS_ LPENUMMONIKER FAR * ppenumMoniker ) PURE;
  165. };
  166. typedef IRunningObjectTable FAR* LPRUNNINGOBJECTTABLE;
  167. #undef INTERFACE
  168. #define INTERFACE IEnumMoniker
  169. DECLARE_INTERFACE_(IEnumMoniker, IUnknown)
  170. {
  171. // *** IUnknown methods ***
  172. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  173. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  174. STDMETHOD_(ULONG,Release) (THIS) PURE;
  175. // *** IEnumOleDataObject methods ***
  176. STDMETHOD(Next) (THIS_ ULONG celt, LPMONIKER FAR* rgelt, ULONG FAR* pceltFetched) PURE;
  177. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  178. STDMETHOD(Reset) (THIS) PURE;
  179. STDMETHOD(Clone) (THIS_ IEnumMoniker FAR* FAR* ppenm) PURE;
  180. };
  181. typedef IEnumMoniker FAR* LPENUMMONIKER;
  182. STDAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID FAR* ppvResult);
  183. STDAPI MkParseDisplayName(LPBC pbc, LPSTR szUserName,
  184. ULONG FAR * pchEaten, LPMONIKER FAR * ppmk);
  185. STDAPI MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONIKER
  186. FAR* ppmkRelPath, BOOL fCalledFromMethod);
  187. STDAPI MonikerCommonPrefixWith(LPMONIKER pmkThis, LPMONIKER pmkOther,
  188. LPMONIKER FAR* ppmkCommon);
  189. STDAPI CreateBindCtx(DWORD reserved, LPBC FAR* ppbc);
  190. STDAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest,
  191. LPMONIKER FAR* ppmkComposite);
  192. STDAPI GetClassFile (LPCSTR szFilename, CLSID FAR* pclsid);
  193. STDAPI CreateFileMoniker(LPSTR lpszPathName, LPMONIKER FAR* ppmk);
  194. STDAPI CreateItemMoniker(LPSTR lpszDelim, LPSTR lpszItem,
  195. LPMONIKER FAR* ppmk);
  196. STDAPI CreateAntiMoniker(LPMONIKER FAR* ppmk);
  197. STDAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER FAR* ppmk);
  198. STDAPI GetRunningObjectTable( DWORD reserved, LPRUNNINGOBJECTTABLE FAR* pprot);
  199. #endif // _MONIKER_H_