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.

201 lines
6.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995.
  5. //
  6. // File:
  7. // objexif.cxx
  8. //
  9. // Contents:
  10. // Entry point for remote activation call to SCM/OR.
  11. //
  12. // Functions:
  13. // RemoteGetClassObject
  14. // RemoteCreateInstance
  15. //
  16. // History:
  17. //
  18. //--------------------------------------------------------------------------
  19. #include "act.hxx"
  20. //-------------------------------------------------------------------------
  21. //
  22. // Function: _RemoteGetClassObject
  23. //
  24. // Synopsis: Entry point for 5.6 get class object activations. Forwards to
  25. // PerformScmStage.
  26. //
  27. //-------------------------------------------------------------------------
  28. HRESULT _RemoteGetClassObject(
  29. handle_t hRpc,
  30. ORPCTHIS *ORPCthis,
  31. ORPCTHAT *ORPCthat,
  32. IN MInterfacePointer * pInActProperties,
  33. OUT MInterfacePointer ** ppOutActProperties
  34. )
  35. {
  36. RPC_STATUS sc;
  37. LOCALTHIS Localthis;
  38. HRESULT hr;
  39. if (ORPCthis == NULL || ORPCthat == NULL)
  40. return E_INVALIDARG;
  41. Localthis.dwClientThread = 0;
  42. Localthis.dwFlags = LOCALF_NONE;
  43. ORPCthis->flags |= ORPCF_DYNAMIC_CLOAKING;
  44. ORPCthat->flags = 0;
  45. ORPCthat->extensions = NULL;
  46. if ( ! s_fEnableDCOM )
  47. {
  48. return E_ACCESSDENIED;
  49. }
  50. // Determine what version to use for the returned interface. Fail
  51. // if the client wants a version we don't support.
  52. hr = NegotiateDCOMVersion( &ORPCthis->version );
  53. if (hr != OR_OK)
  54. {
  55. return hr;
  56. }
  57. RegisterAuthInfoIfNecessary();
  58. ACTIVATION_PARAMS ActParams;
  59. memset(&ActParams, 0, sizeof(ActParams));
  60. ActParams.MsgType = GETCLASSOBJECT;
  61. ActParams.hRpc = hRpc;
  62. ActParams.ORPCthis = ORPCthis;
  63. ActParams.Localthis = &Localthis;
  64. ActParams.ORPCthat = ORPCthat;
  65. ActParams.oldActivationCall = FALSE;
  66. ActParams.RemoteActivation = TRUE;
  67. return PerformScmStage(SERVER_MACHINE_STAGE,
  68. &ActParams,
  69. pInActProperties,
  70. ppOutActProperties);
  71. }
  72. //-------------------------------------------------------------------------
  73. //
  74. // Function: _RemoteGetCreateInstance
  75. //
  76. // Synopsis: Entry point for 5.6 create instance activations. Forwards to
  77. // PerformScmStage.
  78. //
  79. //-------------------------------------------------------------------------
  80. HRESULT _RemoteCreateInstance(
  81. handle_t hRpc,
  82. ORPCTHIS *ORPCthis,
  83. ORPCTHAT *ORPCthat,
  84. IN MInterfacePointer * pUnk,
  85. IN MInterfacePointer * pInActProperties,
  86. OUT MInterfacePointer ** ppOutActProperties
  87. )
  88. {
  89. RPC_STATUS sc;
  90. LOCALTHIS Localthis;
  91. HRESULT hr;
  92. if (ORPCthis == NULL || ORPCthat == NULL)
  93. return E_INVALIDARG;
  94. Localthis.dwClientThread = 0;
  95. Localthis.dwFlags = LOCALF_NONE;
  96. ORPCthis->flags |= ORPCF_DYNAMIC_CLOAKING;
  97. ORPCthat->flags = 0;
  98. ORPCthat->extensions = NULL;
  99. if ( ! s_fEnableDCOM )
  100. {
  101. return E_ACCESSDENIED;
  102. }
  103. // Determine what version to use for the returned interface. Fail
  104. // if the client wants a version we don't support.
  105. hr = NegotiateDCOMVersion( &ORPCthis->version );
  106. if (hr != OR_OK)
  107. {
  108. return hr;
  109. }
  110. RegisterAuthInfoIfNecessary();
  111. ACTIVATION_PARAMS ActParams;
  112. memset(&ActParams, 0, sizeof(ActParams));
  113. ActParams.MsgType = CREATEINSTANCE;
  114. ActParams.hRpc = hRpc;
  115. ActParams.ORPCthis = ORPCthis;
  116. ActParams.Localthis = &Localthis;
  117. ActParams.ORPCthat = ORPCthat;
  118. ActParams.oldActivationCall = FALSE;
  119. ActParams.RemoteActivation = TRUE;
  120. return PerformScmStage(SERVER_MACHINE_STAGE,
  121. &ActParams,
  122. pInActProperties,
  123. ppOutActProperties);
  124. }
  125. //-------------------------------------------------------------------------
  126. //
  127. // Function: _DummyQueryInterfaceIRemoteSCMActivator
  128. //
  129. // Synopsis: Unused function required by linker. This function exists
  130. // to make the activation interface wire compatible with a
  131. // COM interface.
  132. //
  133. //-------------------------------------------------------------------------
  134. HRESULT _DummyQueryInterfaceIRemoteSCMActivator(handle_t rpc,
  135. ORPCTHIS *orpcthis,
  136. ORPCTHAT *orpcthat,
  137. DWORD dummy )
  138. {
  139. return E_NOTIMPL;
  140. }
  141. //-------------------------------------------------------------------------
  142. //
  143. // Function: _DummyAddRefIRemoteSCMActivator
  144. //
  145. // Synopsis: Unused function required by linker. This function exists
  146. // to make the activation interface wire compatible with a
  147. // COM interface.
  148. //
  149. //-------------------------------------------------------------------------
  150. HRESULT _DummyAddRefIRemoteSCMActivator(handle_t rpc,
  151. ORPCTHIS *orpcthis,
  152. ORPCTHAT *orpcthat,
  153. DWORD dummy )
  154. {
  155. return E_NOTIMPL;
  156. }
  157. //-------------------------------------------------------------------------
  158. //
  159. // Function: _DummyReleaseIRemoteSCMActivator
  160. //
  161. // Synopsis: Unused function required by linker. This function exists
  162. // to make the activation interface wire compatible with a
  163. // COM interface.
  164. //
  165. //-------------------------------------------------------------------------
  166. HRESULT _DummyReleaseIRemoteSCMActivator(handle_t rpc,
  167. ORPCTHIS *orpcthis,
  168. ORPCTHAT *orpcthat,
  169. DWORD dummy )
  170. {
  171. return E_NOTIMPL;
  172. }