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.

234 lines
9.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: lclor.idl
  7. //
  8. // Synopsis: This is the local interface to the object exporter.
  9. //
  10. // Clients can
  11. // Register object ids to be pinged.
  12. // Deregister object ids that no longer need to be pinged.
  13. // Lookup an OXID and register an object id for that OXID.
  14. //
  15. // Servers can
  16. // Register their OXID.
  17. // Register an object id so they receive a death notification.
  18. //
  19. //--------------------------------------------------------------------------
  20. [
  21. uuid(e60c73e6-88f9-11cf-9af1-0020af6e72f4),
  22. version(2.0)
  23. ]
  24. interface ILocalObjectExporter
  25. {
  26. import "obase.idl";
  27. typedef [context_handle] void *PHPROCESS;
  28. //////////////////////////////////////////////////
  29. ////////// Shared client and server APIs
  30. // Client and Server both call this to establish a context handle
  31. // in the local oxid resolver/ping process.
  32. // Security provider list
  33. typedef struct
  34. {
  35. [string,unique] WCHAR* pName;
  36. USHORT wId;
  37. } SECPKG;
  38. const unsigned long MAX_IDS = 0x20000; // 131072
  39. const unsigned long MAX_OIDS = 0x100000; // 1048576
  40. // Flags for use in Connect.
  41. const unsigned long CONNECT_DISABLEDCOM = 0x1;
  42. const unsigned long CONNECT_MUTUALAUTH = 0x2;
  43. const unsigned long CONNECT_SECUREREF = 0x4;
  44. const unsigned long CONNECT_CATCH_SERVER_EXCEPTIONS = 0x8;
  45. const unsigned long CONNECT_BREAK_ON_SILENCED_SERVER_EXCEPTIONS = 0x10;
  46. error_status_t Connect
  47. (
  48. [in] handle_t hServer,
  49. [in,string,unique]
  50. WCHAR *pwszWinstaDesktop,
  51. [out] PHPROCESS *pProcess,
  52. [out] ULONG *pdwTimeoutInSeconds,
  53. [out] DUALSTRINGARRAY **ppdsaOrBindings,
  54. [out] MID *pLocalMid,
  55. [in,range(0,MAX_IDS)] ULONG cIdsToReserve,
  56. [out,size_is(cIdsToReserve)] ID aIdsReserved[],
  57. [out] ULONG *pcIdsReserved,
  58. [out] DWORD *pfConnectFlags,
  59. [out,string] WCHAR **pLegacySecurity,
  60. [out] DWORD *pAuthnLevel,
  61. [out] DWORD *pImpLevel,
  62. [out] DWORD *pcServerSvc,
  63. [out, size_is(,*pcServerSvc)] USHORT** aServerSvc,
  64. [out] DWORD *pcClientSvc,
  65. [out, size_is(,*pcClientSvc)] SECPKG** aClientSvc,
  66. [out] LONG *pcChannelHook,
  67. [out, size_is(,*pcChannelHook)] GUID **aChannelHook,
  68. [out] DWORD * pProcessID,
  69. [out] DWORD * pScmProcessID,
  70. [out] ULONG64 * pSignature,
  71. [out] GUID* pguidRPCSSProcessIdentifier
  72. );
  73. // Called by local clients to reserve a range of IDs which will
  74. // not conflict with any other local IDs.
  75. error_status_t AllocateReservedIds
  76. (
  77. [in] handle_t hServer,
  78. [in] PHPROCESS phProcess,
  79. [in,range(0,MAX_IDS)] unsigned long cIdsToAlloc,
  80. [out, size_is(cIdsToAlloc)] ID aIdsAllocated[],
  81. [out] unsigned long *pcIdsAllocated
  82. );
  83. // Clients and server of call this to update the state of OID
  84. // they are using.
  85. // Clients may add OIDs to the set of OID in use by their process
  86. // Clients may remove OIDs from those in use by their process
  87. // Servers may free OIDs they allocated but are no longer using.
  88. // Clients may free OXIDs they are no longer using.
  89. typedef struct
  90. {
  91. MID mid;
  92. OXID oxid;
  93. unsigned long refs;
  94. } OXID_REF;
  95. typedef struct
  96. {
  97. MID mid;
  98. OID oid;
  99. } OID_MID_PAIR;
  100. typedef struct
  101. {
  102. MID mid;
  103. OXID oxid;
  104. OID oid;
  105. } OXID_OID_PAIR;
  106. // Returned if at least one OID was not successful added/removed.
  107. const long OR_PARTIAL_UPDATE = 1003L;
  108. error_status_t
  109. BulkUpdateOIDs
  110. (
  111. [in] handle_t hServer,
  112. [in] PHPROCESS phProcess,
  113. [in,range(0,MAX_OIDS)] unsigned long cOidsToBeAdded, // can be zero
  114. [in, size_is(cOidsToBeAdded)] OXID_OID_PAIR aOidsToBeAdded[],
  115. [out, size_is(cOidsToBeAdded)] long aStatusOfAdds[],
  116. [in,range(0,MAX_OIDS)] unsigned long cOidsToBeRemoved, // can be zero
  117. [in, size_is(cOidsToBeRemoved)] OID_MID_PAIR aOidsToBeRemoved[],
  118. [in,range(0,MAX_OIDS)] unsigned long cServerOidsToFree, // can be zero
  119. [in, size_is(cServerOidsToFree)] OID aServerOids[],
  120. [in,range(0,MAX_OIDS)] unsigned long cServerOidsToUnPin, // can be zero
  121. [in, size_is(cServerOidsToUnPin)] OID aServerOidsToUnPin[],
  122. [in,range(0,MAX_OIDS)] unsigned long cOxidsToFree, // can be zero
  123. [in, size_is(cOxidsToFree)] OXID_REF aOxidsToFree[]
  124. );
  125. //////////////////////////////////////////////////
  126. ////////// Client specific APIs
  127. // Clients to remote OXIDs call this to lookup the OXID_INFO for an oxid.
  128. // psaRemoteOrBindings - compressed string bindings from the long
  129. // form of the marshalled interface (if any).
  130. // pwstrBindingToServer - expanded string binding to the client which
  131. // passed the IN interface pointer to the server.
  132. error_status_t
  133. ClientResolveOXID
  134. (
  135. [in] handle_t hServer,
  136. [in] PHPROCESS phProcess,
  137. [in, ref] OXID *poxidServer,
  138. [in, unique] DUALSTRINGARRAY *pssaServerObjectResolverBindings,
  139. [in] long fApartment,
  140. [out, ref] OXID_INFO *poxidInfo, // Contains a single expanded stringbinding + security bindings
  141. [out] MID *pLocalMidOfRemote,
  142. [out] unsigned long *pulMarshaledTargetInfoLength,
  143. // contains credman credentials, if any
  144. [out, size_is(,*pulMarshaledTargetInfoLength)] unsigned char **pucMarshaledTargetInfo,
  145. [out] unsigned short* pAuthnSvc // contains the exact authentication svc used to talk to the server
  146. );
  147. //////////////////////////////////////////////////
  148. //////////////// Server specific APIs
  149. // Called to register an OXID and associated information. The server may
  150. // simultaneously register a number of OIDs.
  151. error_status_t
  152. ServerAllocateOXIDAndOIDs
  153. (
  154. [in] handle_t hServer,
  155. [in] PHPROCESS phProcess,
  156. [out, ref] OXID *poxidServer,
  157. [in] long fApartment,
  158. [in,range(0,MAX_OIDS)]unsigned long cOids,
  159. [out, size_is(cOids)] OID aOid[],
  160. [out] unsigned long *pcOidsAllocated,
  161. [in, ref] OXID_INFO *poxidInfo, // no strings
  162. [in, unique] DUALSTRINGARRAY *pdsaStringBindings, // Expanded, NULL if not changed
  163. [in, unique] DUALSTRINGARRAY *pdsaSecurityBindings, // Compressed, NULL if not first OXID for process.
  164. [out] DWORD64 *pdwOrBindingsID, // id of ppdsaOrBindings
  165. [out] DUALSTRINGARRAY **ppdsaOrBindings // if non-NULL, contains up-to-date or bindings
  166. );
  167. // Server calls this to register additional OIDs with the ping server.
  168. error_status_t
  169. ServerAllocateOIDs
  170. (
  171. [in] handle_t hServer,
  172. [in] PHPROCESS phProcess,
  173. [in, ref] OXID *poxidServer,
  174. [in,range(0,MAX_OIDS)]unsigned long cOidsReturn,
  175. [in, size_is(cOidsReturn)] OID aOidsReturn[],
  176. [in,range(0,MAX_OIDS)]unsigned long cOidsAlloc,
  177. [out, size_is(cOidsAlloc)] OID aOidsAlloc[],
  178. [out] unsigned long *pcOidsAllocated
  179. );
  180. // Called when a particular OXID is being removed. This is only
  181. // necessary if the server may continue running but is destroying
  182. // a thead (apartment model) or is unloading com.
  183. // The unused oids are used as a hint for cleaning up object resolver
  184. // faster.
  185. error_status_t
  186. ServerFreeOXIDAndOIDs
  187. (
  188. [in] handle_t hServer,
  189. [in] PHPROCESS phProcess,
  190. [in] OXID oxidServer,
  191. [in,range(0,MAX_OIDS)]unsigned long cOids,
  192. [in, size_is(cOids)] OID aOids[]
  193. );
  194. // Called when a particular process is completely uninitializing
  195. // COM.
  196. error_status_t
  197. Disconnect(
  198. [in] handle_t hClient,
  199. [in,out] PHPROCESS* pphProcess
  200. );
  201. }