Source code of Windows XP (NT5)
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.

147 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. sid.cxx
  5. Abstract:
  6. Routines implementing the SID pseudo-object.
  7. Author:
  8. Cliff Van Dyke (cliffv) 8-May-2001
  9. --*/
  10. #include "pch.hxx"
  11. DWORD
  12. AzpSidInit(
  13. IN PGENERIC_OBJECT ParentGenericObject,
  14. IN PGENERIC_OBJECT ChildGenericObject
  15. )
  16. /*++
  17. Routine Description:
  18. This routine is a worker routine for AzSidCreate. It does any object specific
  19. initialization that needs to be done.
  20. On entry, AzGlResource must be locked exclusively.
  21. Arguments:
  22. ParentGenericObject - Specifies the parent object to add the child object onto.
  23. The reference count has been incremented on this object.
  24. ChildGenericObject - Specifies the newly allocated child object.
  25. The reference count has been incremented on this object.
  26. Return Value:
  27. NO_ERROR - The operation was successful
  28. ERROR_NOT_ENOUGH_MEMORY - not enough memory
  29. Other exception status codes
  30. --*/
  31. {
  32. PAZP_SID AzpSid = (PAZP_SID) ChildGenericObject;
  33. //
  34. // Initialization
  35. //
  36. ASSERT( AzpIsLockedExclusive( &AzGlResource ) );
  37. //
  38. // Behave differently depending on the object type of the parent object
  39. //
  40. ASSERT( ParentGenericObject->ObjectType == OBJECT_TYPE_ADMIN_MANAGER ||
  41. ParentGenericObject->ObjectType == OBJECT_TYPE_APPLICATION ||
  42. ParentGenericObject->ObjectType == OBJECT_TYPE_SCOPE );
  43. //
  44. // Sids are referenced by groups and roles.
  45. //
  46. // Let the generic object manager know all of the lists we support
  47. //
  48. ChildGenericObject->GenericObjectLists = &AzpSid->backGroupMembers,
  49. // Sids are referenced by groups
  50. ObInitObjectList( &AzpSid->backGroupMembers,
  51. &AzpSid->backGroupNonMembers,
  52. TRUE, // backward link
  53. AZP_LINKPAIR_SID_MEMBERS,
  54. NULL,
  55. NULL,
  56. NULL );
  57. ObInitObjectList( &AzpSid->backGroupNonMembers,
  58. &AzpSid->backRoles,
  59. TRUE, // backward link
  60. AZP_LINKPAIR_SID_NON_MEMBERS,
  61. NULL,
  62. NULL,
  63. NULL );
  64. // Sids are referenced by "Roles"
  65. ObInitObjectList( &AzpSid->backRoles,
  66. NULL,
  67. TRUE, // Backward link
  68. 0, // No link pair id
  69. NULL,
  70. NULL,
  71. NULL );
  72. return NO_ERROR;
  73. }
  74. VOID
  75. AzpSidFree(
  76. IN PGENERIC_OBJECT GenericObject
  77. )
  78. /*++
  79. Routine Description:
  80. This routine is a worker routine for Sid object free. It does any object specific
  81. cleanup that needs to be done.
  82. On entry, AzGlResource must be locked exclusively.
  83. Arguments:
  84. GenericObject - Specifies a pointer to the object to be deleted.
  85. Return Value:
  86. None
  87. --*/
  88. {
  89. // PAZP_SID AzpSid = (PAZP_SID) GenericObject;
  90. UNREFERENCED_PARAMETER( GenericObject );
  91. //
  92. // Initialization
  93. //
  94. ASSERT( AzpIsLockedExclusive( &AzGlResource ) );
  95. //
  96. // Free any local strings
  97. //
  98. }