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.

799 lines
18 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Globals.h
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _CommonGlobals_H
  9. #define _CommonGlobals_H
  10. #include <pssException.h>
  11. #include <HelperFuncs.h>
  12. #include <Allocator.h>
  13. #include <BasicTree.h>
  14. #include <Queue.h>
  15. #include <Cache.h>
  16. #include <locks.h>
  17. /******************************************************************************
  18. *
  19. * Name:
  20. *
  21. *
  22. * Description:
  23. *
  24. *
  25. *****************************************************************************/
  26. #define SYNCPROV_BATCH_TRANSMIT_SIZE 0x40000
  27. /******************************************************************************
  28. *
  29. * Name:
  30. *
  31. *
  32. * Description:
  33. *
  34. *
  35. *****************************************************************************/
  36. typedef WmiContainerController <void *> CWbemGlobal_VoidPointerController ;
  37. typedef CWbemGlobal_VoidPointerController :: Container CWbemGlobal_VoidPointerController_Container ;
  38. typedef CWbemGlobal_VoidPointerController :: Container_Iterator CWbemGlobal_VoidPointerController_Container_Iterator ;
  39. typedef CWbemGlobal_VoidPointerController :: WmiContainerElement VoidPointerContainerElement ;
  40. /******************************************************************************
  41. *
  42. * Name:
  43. *
  44. *
  45. * Description:
  46. *
  47. *
  48. *****************************************************************************/
  49. #define CWbemGlobal_IWmiObjectSinkController CWbemGlobal_VoidPointerController
  50. #define CWbemGlobal_IWmiObjectSinkController_Container CWbemGlobal_VoidPointerController_Container
  51. #define CWbemGlobal_IWmiObjectSinkController_Container_Iterator CWbemGlobal_VoidPointerController_Container_Iterator
  52. #define ObjectSinkContainerElement VoidPointerContainerElement
  53. /******************************************************************************
  54. *
  55. * Name:
  56. *
  57. *
  58. * Description:
  59. *
  60. *
  61. *****************************************************************************/
  62. #define MASK_PROVIDER_BINDING_BIND 1
  63. /******************************************************************************
  64. *
  65. * Name:
  66. *
  67. *
  68. * Description:
  69. *
  70. *
  71. *****************************************************************************/
  72. extern void DumpThreadTokenSecurityDescriptor () ;
  73. /******************************************************************************
  74. *
  75. * Name:
  76. *
  77. *
  78. * Description:
  79. *
  80. *
  81. *****************************************************************************/
  82. #define HRESULT_ERROR_MASK (0x0000FFFF)
  83. #define HRESULT_ERROR_FUNC(X) (X&HRESULT_ERROR_MASK)
  84. #define HRESULT_FACILITY_MASK (0x0FFF0000)
  85. #define HRESULT_FACILITY_FUNC(X) ((X&HRESULT_FACILITY_MASK)>>16)
  86. #define HRESULT_SEVERITY_MASK (0xC0000000)
  87. #define HRESULT_SEVERITY_FUNC(X) ((X&HRESULT_SEVERITY_MASK)>>30)
  88. #define HRESULT_ERROR_SERVER_UNAVAILABLE 1722L
  89. #define HRESULT_ERROR_CALL_FAILED_DNE 1727L
  90. /******************************************************************************
  91. *
  92. * Name:
  93. *
  94. *
  95. * Description:
  96. *
  97. *
  98. *****************************************************************************/
  99. #define MAX_PROXIES 512
  100. class ProxyContainer
  101. {
  102. private:
  103. WmiAllocator &m_Allocator ;
  104. #if 1
  105. WmiStack <IUnknown *,8> **m_ContainerArray ;
  106. #else
  107. WmiQueue <IUnknown *,8> **m_ContainerArray ;
  108. #endif
  109. CriticalSection m_CriticalSection ;
  110. ULONG m_TopSize ;
  111. ULONG m_CurrentSize ;
  112. ULONG m_ProxyCount ;
  113. BOOL m_Initialized ;
  114. public:
  115. ProxyContainer (
  116. WmiAllocator &a_Allocator ,
  117. ULONG a_ProxyCount ,
  118. ULONG a_TopSize
  119. ) : m_Allocator ( a_Allocator ) ,
  120. m_ContainerArray ( NULL ) ,
  121. m_TopSize ( a_TopSize ) ,
  122. m_CurrentSize ( 0 ) ,
  123. m_ProxyCount ( a_ProxyCount ) ,
  124. m_Initialized ( FALSE ) ,
  125. m_CriticalSection(NOTHROW_LOCK)
  126. {
  127. }
  128. ~ProxyContainer ()
  129. {
  130. UnInitialize () ;
  131. }
  132. WmiStatusCode Initialize ()
  133. {
  134. WmiStatusCode t_StatusCode = e_StatusCode_Success ;
  135. #if 1
  136. m_ContainerArray = new WmiStack <IUnknown *,8> * [ m_ProxyCount ] ;
  137. #else
  138. m_ContainerArray = new WmiQueue <IUnknown *,8> * [ m_ProxyCount ] ;
  139. #endif
  140. if ( m_ContainerArray )
  141. {
  142. t_StatusCode = WmiHelper :: InitializeCriticalSection ( & m_CriticalSection ) ;
  143. if ( t_StatusCode == e_StatusCode_Success )
  144. {
  145. m_Initialized = TRUE ;
  146. for ( ULONG t_Index = 0 ; t_Index < m_ProxyCount ; t_Index ++ )
  147. {
  148. m_ContainerArray [ t_Index ] = NULL ;
  149. }
  150. for ( t_Index = 0 ; t_Index < m_ProxyCount ; t_Index ++ )
  151. {
  152. #if 1
  153. WmiStack <IUnknown *,8> *t_Container = m_ContainerArray [ t_Index ] = new WmiStack <IUnknown *,8> ( m_Allocator ) ;
  154. #else
  155. WmiQueue <IUnknown *,8> *t_Container = m_ContainerArray [ t_Index ] = new WmiQueue <IUnknown *,8> ( m_Allocator ) ;
  156. #endif
  157. if ( t_Container )
  158. {
  159. t_StatusCode = t_Container->Initialize () ;
  160. if ( t_StatusCode != e_StatusCode_Success )
  161. {
  162. break ;
  163. }
  164. }
  165. else
  166. {
  167. t_StatusCode = e_StatusCode_OutOfMemory ;
  168. break ;
  169. }
  170. }
  171. }
  172. }
  173. else
  174. {
  175. t_StatusCode = e_StatusCode_OutOfMemory ;
  176. }
  177. return t_StatusCode ;
  178. }
  179. WmiStatusCode UnInitialize ()
  180. {
  181. WmiStatusCode t_StatusCode = e_StatusCode_Success ;
  182. if ( m_ContainerArray )
  183. {
  184. for ( ULONG t_Index = 0 ; t_Index < m_ProxyCount ; t_Index ++ )
  185. {
  186. #if 1
  187. WmiStack <IUnknown *,8> *t_Container = m_ContainerArray [ t_Index ] ;
  188. #else
  189. WmiQueue <IUnknown *,8> *t_Container = m_ContainerArray [ t_Index ] ;
  190. #endif
  191. if ( t_Container )
  192. {
  193. IUnknown *t_Top = NULL ;
  194. WmiStatusCode t_StatusCode ;
  195. while ( ( t_StatusCode = t_Container->Top ( t_Top ) ) == e_StatusCode_Success )
  196. {
  197. t_Top->Release () ;
  198. #if 1
  199. t_StatusCode = t_Container->Pop () ;
  200. #else
  201. t_StatusCode = t_Container->DeQueue () ;
  202. #endif
  203. }
  204. t_StatusCode = t_Container->UnInitialize () ;
  205. delete t_Container ;
  206. }
  207. }
  208. delete [] m_ContainerArray ;
  209. m_ContainerArray = NULL ;
  210. }
  211. if ( m_Initialized )
  212. {
  213. WmiHelper :: DeleteCriticalSection ( & m_CriticalSection ) ;
  214. m_Initialized = FALSE ;
  215. }
  216. return t_StatusCode ;
  217. }
  218. WmiStatusCode Return (
  219. IUnknown *a_Element ,
  220. ULONG a_Index
  221. )
  222. {
  223. #if 1
  224. WmiStack <IUnknown *,8> *t_Container = m_ContainerArray [ a_Index ] ;
  225. return t_Container->Push ( a_Element ) ;
  226. #else
  227. WmiQueue <IUnknown *,8> *t_Container = m_ContainerArray [ a_Index ] ;
  228. return t_Container->EnQueue ( a_Element ) ;
  229. #endif
  230. }
  231. WmiStatusCode Top (
  232. IUnknown *&a_Element ,
  233. ULONG a_Index
  234. )
  235. {
  236. #if 1
  237. WmiStack <IUnknown *,8> *t_Container = m_ContainerArray [ a_Index ] ;
  238. return t_Container->Top ( a_Element ) ;
  239. #else
  240. WmiQueue <IUnknown *,8> *t_Container = m_ContainerArray [ a_Index ] ;
  241. return t_Container->Top ( a_Element ) ;
  242. #endif
  243. }
  244. WmiStatusCode Reserve ( ULONG a_Index )
  245. {
  246. #if 1
  247. WmiStack <IUnknown *,8> *t_Container = m_ContainerArray [ a_Index ] ;
  248. return t_Container->Pop () ;
  249. #else
  250. WmiQueue <IUnknown *,8> *t_Container = m_ContainerArray [ a_Index ] ;
  251. return t_Container->DeQueue () ;
  252. #endif
  253. }
  254. ULONG GetTopSize () { return m_TopSize ; } ;
  255. ULONG GetCurrentSize () { return m_CurrentSize ; } ;
  256. BOOL GetInitialized () { return m_Initialized ; }
  257. void SetCurrentSize ( ULONG a_CurrentSize ) { m_CurrentSize = a_CurrentSize ; }
  258. CriticalSection &GetCriticalSection () { return m_CriticalSection ; }
  259. } ;
  260. /******************************************************************************
  261. *
  262. * Name:
  263. *
  264. *
  265. * Description:
  266. *
  267. *
  268. *****************************************************************************/
  269. class CServerObject_ProviderRegistrationV1;
  270. class ProviderSubSystem_Common_Globals
  271. {
  272. public:
  273. static LPCWSTR s_Wql ;
  274. static LPCWSTR s_Provider ;
  275. static WORD s_System_ACESize ;
  276. static WORD s_LocalService_ACESize ;
  277. static WORD s_NetworkService_ACESize ;
  278. static WORD s_LocalAdmins_ACESize ;
  279. static ACCESS_ALLOWED_ACE *s_Provider_System_ACE ;
  280. static ACCESS_ALLOWED_ACE *s_Provider_LocalService_ACE ;
  281. static ACCESS_ALLOWED_ACE *s_Provider_NetworkService_ACE ;
  282. static ACCESS_ALLOWED_ACE *s_Provider_LocalAdmins_ACE ;
  283. static ACCESS_ALLOWED_ACE *s_Token_All_Access_System_ACE ;
  284. static ACCESS_ALLOWED_ACE *s_Token_All_Access_LocalService_ACE ;
  285. static ACCESS_ALLOWED_ACE *s_Token_All_Access_NetworkService_ACE ;
  286. static ACCESS_ALLOWED_ACE *s_Token_All_Access_LocalAdmins_ACE ;
  287. static SECURITY_DESCRIPTOR *s_MethodSecurityDescriptor ;
  288. static ULONG s_TransmitBufferSize ;
  289. static ULONG s_DefaultStackSize ;
  290. public:
  291. static HRESULT CreateInstance (
  292. const CLSID &a_ReferenceClsid ,
  293. LPUNKNOWN a_OuterUnknown ,
  294. const DWORD &a_ClassContext ,
  295. const UUID &a_ReferenceInterfaceId ,
  296. void **a_ObjectInterface
  297. ) ;
  298. static HRESULT CreateRemoteInstance (
  299. LPCWSTR a_Server ,
  300. const CLSID &a_ReferenceClsid ,
  301. LPUNKNOWN a_OuterUnknown ,
  302. const DWORD &a_ClassContext ,
  303. const UUID &a_ReferenceInterfaceId ,
  304. void **a_ObjectInterface
  305. ) ;
  306. static HRESULT GetNamespaceServerPath (
  307. IWbemPath *a_Namespace ,
  308. wchar_t *&a_ServerNamespacePath
  309. ) ;
  310. static HRESULT GetNamespacePath (
  311. IWbemPath *a_Namespace ,
  312. wchar_t *&a_NamespacePath
  313. ) ;
  314. static HRESULT GetPathText (
  315. IWbemPath *a_Path ,
  316. wchar_t *&a_ObjectPath
  317. ) ;
  318. static HRESULT BeginCallbackImpersonation (
  319. IUnknown *&a_OldContext ,
  320. IServerSecurity *&a_OldSecurity ,
  321. BOOL &a_Impersonating
  322. ) ;
  323. static HRESULT BeginImpersonation (
  324. IUnknown *&a_OldContext ,
  325. IServerSecurity *&a_OldSecurity ,
  326. BOOL &a_Impersonating ,
  327. DWORD *a_AuthenticationLevel = NULL
  328. ) ;
  329. static HRESULT EndImpersonation (
  330. IUnknown *a_OldContext ,
  331. IServerSecurity *a_OldSecurity ,
  332. BOOL a_Impersonating
  333. ) ;
  334. static HRESULT GetProxy (
  335. REFIID a_InterfaceId ,
  336. IUnknown *a_Interface ,
  337. IUnknown *&a_Proxy
  338. ) ;
  339. static HRESULT GetProxy (
  340. ProxyContainer &a_Container ,
  341. ULONG a_ProxyIndex ,
  342. REFIID a_InterfaceId ,
  343. IUnknown *a_Interface ,
  344. IUnknown *&a_Proxy
  345. ) ;
  346. static HRESULT SetCloaking (
  347. IUnknown *a_Unknown
  348. ) ;
  349. static HRESULT SetCloaking (
  350. IUnknown *a_Unknown ,
  351. DWORD a_AuthenticationLevel ,
  352. DWORD a_ImpersonationLevel
  353. ) ;
  354. static BOOL IsProxy ( IUnknown *a_Unknown ) ;
  355. static DWORD GetCurrentImpersonationLevel () ;
  356. static HRESULT EnableAllPrivileges () ;
  357. static HRESULT EnableAllPrivileges ( HANDLE a_Token ) ;
  358. static HRESULT SetAnonymous ( IUnknown *a_Proxy ) ;
  359. static HRESULT SetCallState (
  360. IUnknown *a_Interface ,
  361. BOOL &a_Revert
  362. ) ;
  363. static HRESULT RevertCallState (
  364. BOOL a_Revert
  365. ) ;
  366. static HRESULT SetProxyState (
  367. ProxyContainer &a_Container ,
  368. ULONG a_ProxyIndex ,
  369. REFIID a_InterfaceId ,
  370. IUnknown *a_Interface ,
  371. IUnknown *&a_Proxy ,
  372. BOOL &a_Revert
  373. ) ;
  374. static HRESULT RevertProxyState (
  375. ProxyContainer &a_Container ,
  376. ULONG a_ProxyIndex ,
  377. IUnknown *a_Proxy ,
  378. BOOL a_Revert
  379. ) ;
  380. static HRESULT SetProxyState_SvcHost (
  381. ProxyContainer &a_Container ,
  382. ULONG a_ProxyIndex ,
  383. REFIID a_InterfaceId ,
  384. IUnknown *a_Interface ,
  385. IUnknown *&a_Proxy ,
  386. BOOL &a_Revert ,
  387. DWORD a_ProcessIdentifier ,
  388. HANDLE &a_IdentifyToken ,
  389. ACCESS_ALLOWED_ACE *a_Ace ,
  390. WORD a_AceSize
  391. ) ;
  392. static HRESULT RevertProxyState_SvcHost (
  393. ProxyContainer &a_Container ,
  394. ULONG a_ProxyIndex ,
  395. IUnknown *a_Proxy ,
  396. BOOL a_Revert ,
  397. DWORD a_ProcessIdentifier ,
  398. HANDLE a_IdentifyToken
  399. ) ;
  400. static HRESULT SetProxyState_PrvHost (
  401. ProxyContainer &a_Container ,
  402. ULONG a_ProxyIndex ,
  403. REFIID a_InterfaceId ,
  404. IUnknown *a_Interface ,
  405. IUnknown *&a_Proxy ,
  406. BOOL &a_Revert ,
  407. DWORD a_ProcessIdentifier ,
  408. HANDLE &a_IdentifyToken
  409. ) ;
  410. static HRESULT RevertProxyState_PrvHost (
  411. ProxyContainer &a_Container ,
  412. ULONG a_ProxyIndex ,
  413. IUnknown *a_Proxy ,
  414. BOOL a_Revert ,
  415. DWORD a_ProcessIdentifier ,
  416. HANDLE a_IdentifyToken
  417. ) ;
  418. static HRESULT SetProxyState_SvcHost (
  419. REFIID a_InterfaceId ,
  420. IUnknown *a_Interface ,
  421. IUnknown *&a_Proxy ,
  422. BOOL &a_Revert ,
  423. DWORD a_ProcessIdentifier ,
  424. HANDLE &a_IdentifyToken ,
  425. ACCESS_ALLOWED_ACE *a_Ace ,
  426. WORD a_AceSize,
  427. SECURITY_IMPERSONATION_LEVEL impersonationLevel
  428. ) ;
  429. static HRESULT RevertProxyState_SvcHost (
  430. IUnknown *a_Proxy ,
  431. BOOL a_Revert ,
  432. DWORD a_ProcessIdentifier ,
  433. HANDLE a_IdentifyToken
  434. ) ;
  435. static HRESULT SetProxyState_PrvHost (
  436. REFIID a_InterfaceId ,
  437. IUnknown *a_Interface ,
  438. IUnknown *&a_Proxy ,
  439. BOOL &a_Revert ,
  440. DWORD a_ProcessIdentifier ,
  441. HANDLE &a_IdentifyToken
  442. ) ;
  443. static HRESULT RevertProxyState_PrvHost (
  444. IUnknown *a_Proxy ,
  445. BOOL a_Revert ,
  446. DWORD a_ProcessIdentifier ,
  447. HANDLE a_IdentifyToken
  448. ) ;
  449. static HRESULT SetProxyState (
  450. REFIID a_InterfaceId ,
  451. IUnknown *a_Interface ,
  452. IUnknown *&a_Proxy ,
  453. BOOL &a_Revert
  454. ) ;
  455. static HRESULT RevertProxyState (
  456. IUnknown *a_Proxy ,
  457. BOOL a_Revert
  458. ) ;
  459. static HRESULT Load_DWORD ( HKEY a_Key , LPCWSTR a_Name , DWORD &a_Value ) ;
  460. static HRESULT Load_String ( HKEY a_Key , LPCWSTR a_Name , BSTR &a_Value ) ;
  461. static HRESULT Load_ByteArray ( HKEY a_Key , LPCWSTR a_Name , BYTE *&a_Value , DWORD &a_ValueLength ) ;
  462. static HRESULT Save_DWORD ( HKEY a_Key , LPCWSTR a_Name , DWORD a_Value ) ;
  463. static HRESULT Save_String ( HKEY a_Key , LPCWSTR a_Name , BSTR a_Value ) ;
  464. static HRESULT Save_ByteArray ( HKEY a_Key , LPCWSTR a_Name , BYTE *a_Value , DWORD a_ValueLength ) ;
  465. static HRESULT UnMarshalRegistration (
  466. IUnknown **a_Unknown ,
  467. BYTE *a_MarshaledProxy ,
  468. DWORD a_MarshaledProxyLength
  469. ) ;
  470. static HRESULT MarshalRegistration (
  471. IUnknown *a_Unknown ,
  472. BYTE *&a_MarshaledProxy ,
  473. DWORD &a_MarshaledProxyLength
  474. ) ;
  475. static HRESULT ReleaseRegistration (
  476. BYTE *a_MarshaledProxy ,
  477. DWORD a_MarshaledProxyLength
  478. ) ;
  479. static HRESULT IsDependantCall ( IWbemContext *a_Parent , IWbemContext *a_ChildContext , BOOL &a_DependantCall ) ;
  480. static HRESULT Set_Uint64 (
  481. _IWmiObject *a_Instance ,
  482. wchar_t *a_Name ,
  483. const UINT64 &a_Uint64
  484. ) ;
  485. static HRESULT Set_Uint32 (
  486. _IWmiObject *a_Instance ,
  487. wchar_t *a_Name ,
  488. const DWORD &a_Uint32
  489. ) ;
  490. static HRESULT Set_Uint16 (
  491. _IWmiObject *a_Instance ,
  492. wchar_t *a_Name ,
  493. const WORD &a_Uint16
  494. ) ;
  495. static HRESULT Set_Bool (
  496. _IWmiObject *a_Instance ,
  497. wchar_t *a_Name ,
  498. const BOOL &a_Bool
  499. ) ;
  500. static HRESULT Set_String (
  501. IWbemClassObject *a_Instance ,
  502. wchar_t *a_Name ,
  503. wchar_t *a_String
  504. ) ;
  505. static HRESULT Set_DateTime (
  506. IWbemClassObject *a_Instance ,
  507. wchar_t *a_Name ,
  508. FILETIME a_Time
  509. ) ;
  510. static HRESULT Set_Byte_Array (
  511. IWbemClassObject *a_Instance ,
  512. wchar_t *a_Name ,
  513. BYTE *a_Bytes ,
  514. WORD a_BytesCount
  515. ) ;
  516. static HRESULT Get_Uint64 (
  517. _IWmiObject *a_Instance ,
  518. wchar_t *a_Name ,
  519. UINT64 &a_Uint64 ,
  520. BOOL &a_Null
  521. ) ;
  522. static HRESULT Get_Uint32 (
  523. _IWmiObject *a_Instance ,
  524. wchar_t *a_Name ,
  525. DWORD &a_Uint32 ,
  526. BOOL &a_Null
  527. ) ;
  528. static HRESULT Get_Uint16 (
  529. _IWmiObject *a_Instance ,
  530. wchar_t *a_Name ,
  531. WORD &a_Uint16 ,
  532. BOOL &a_Null
  533. ) ;
  534. static HRESULT Get_Bool (
  535. _IWmiObject *a_Instance ,
  536. wchar_t *a_Name ,
  537. BOOL &a_Bool ,
  538. BOOL &a_Null
  539. ) ;
  540. static HRESULT Get_String (
  541. IWbemClassObject *a_Instance ,
  542. wchar_t *a_Name ,
  543. wchar_t *&a_String ,
  544. BOOL &a_Null
  545. ) ;
  546. static HRESULT Get_DateTime (
  547. IWbemClassObject *a_Instance ,
  548. wchar_t *a_Name ,
  549. FILETIME &a_Time ,
  550. BOOL &a_Null
  551. ) ;
  552. static HRESULT Check_SecurityDescriptor_CallIdentity (
  553. SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
  554. DWORD a_Access ,
  555. GENERIC_MAPPING *a_Mapping
  556. ) ;
  557. static HRESULT AdjustSecurityDescriptorWithSid (
  558. SID *a_OwnerSid ,
  559. SID *a_GroupSid ,
  560. DWORD a_Access ,
  561. SECURITY_DESCRIPTOR *&a_SecurityDescriptor ,
  562. SECURITY_DESCRIPTOR *&a_AlteredSecurityDescriptor
  563. ) ;
  564. static HRESULT CreateSystemAces () ;
  565. static HRESULT DeleteSystemAces () ;
  566. static HRESULT ConstructIdentifyToken_SvcHost (
  567. BOOL &a_Revert ,
  568. DWORD a_ProcessIdentifier ,
  569. HANDLE &a_IdentifyToken ,
  570. ACCESS_ALLOWED_ACE *a_Ace ,
  571. WORD a_AceSize,
  572. SECURITY_IMPERSONATION_LEVEL impersonationLevel
  573. ) ;
  574. static HRESULT ConstructIdentifyToken_PrvHost (
  575. BOOL &a_Revert ,
  576. DWORD a_ProcessIdentifier ,
  577. HANDLE &a_IdentifyToken ,
  578. ACCESS_ALLOWED_ACE *a_Ace ,
  579. WORD a_AceSize
  580. ) ;
  581. static HRESULT CheckAccess (
  582. SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
  583. DWORD a_Access ,
  584. GENERIC_MAPPING *a_Mapping
  585. ) ;
  586. static HRESULT GetUserSid (
  587. HANDLE a_Token ,
  588. ULONG *a_Size ,
  589. PSID &a_Sid
  590. ) ;
  591. static HRESULT GetGroupSid (
  592. HANDLE a_Token ,
  593. ULONG *a_Size ,
  594. PSID &a_Sid
  595. ) ;
  596. static HRESULT GetAceWithProcessTokenUser (
  597. DWORD a_ProcessIdentifier ,
  598. WORD &a_AceSize ,
  599. ACCESS_ALLOWED_ACE *&a_Ace
  600. ) ;
  601. static HRESULT SinkAccessInitialize (
  602. SECURITY_DESCRIPTOR *a_RegistrationSecurityDescriptor ,
  603. SECURITY_DESCRIPTOR *&a_SinkSecurityDescriptor
  604. ) ;
  605. static HRESULT CreateMethodSecurityDescriptor () ;
  606. static HRESULT DeleteMethodSecurityDescriptor () ;
  607. static SECURITY_DESCRIPTOR *GetMethodSecurityDescriptor ()
  608. {
  609. return s_MethodSecurityDescriptor ;
  610. }
  611. static DWORD InitializeTransmitSize () ;
  612. static DWORD GetTransmitSize () { return s_TransmitBufferSize ; }
  613. static DWORD InitializeDefaultStackSize () ;
  614. static DWORD GetDefaultStackSize () { return s_DefaultStackSize ; }
  615. static HRESULT ValidateClientSecurity (CServerObject_ProviderRegistrationV1& ) ;
  616. } ;
  617. #endif // _CommonGlobals_H