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.

178 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. spoolsec.h
  5. Abstract:
  6. Header file for print security
  7. Author:
  8. Not known
  9. Revision History:
  10. 06-Apr-2001 AMaxa CheckPrivilegePresent
  11. --*/
  12. #ifndef _SPOOLSEC_H_
  13. #define _SPOOLSEC_H_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. // Object types
  18. //
  19. #define SPOOLER_OBJECT_SERVER 0
  20. #define SPOOLER_OBJECT_PRINTER 1
  21. #define SPOOLER_OBJECT_DOCUMENT 2
  22. #define SPOOLER_OBJECT_COUNT 3
  23. #define SPOOLER_OBJECT_XCV 4
  24. /* These access bits must be different from those exposed in winspool.h,
  25. * so that no auditing takes place when we do an access check against them:
  26. */
  27. #define SERVER_ACCESS_ADMINISTER_PRIVATE 0x00000004
  28. #define PRINTER_ACCESS_ADMINISTER_PRIVATE 0x00000008
  29. #define JOB_ACCESS_ADMINISTER_PRIVATE 0x00000080
  30. enum
  31. {
  32. kGuessTokenPrivileges = 1024
  33. };
  34. PSECURITY_DESCRIPTOR
  35. CreateServerSecurityDescriptor(
  36. VOID
  37. );
  38. PSECURITY_DESCRIPTOR
  39. CreatePrinterSecurityDescriptor(
  40. PSECURITY_DESCRIPTOR pCreatorSecurityDescriptor
  41. );
  42. PSECURITY_DESCRIPTOR
  43. CreateDocumentSecurityDescriptor(
  44. PSECURITY_DESCRIPTOR pPrinterSecurityDescriptor
  45. );
  46. BOOL
  47. SetPrinterSecurityDescriptor(
  48. SECURITY_INFORMATION SecurityInformation,
  49. PSECURITY_DESCRIPTOR pModificationDescriptor,
  50. PSECURITY_DESCRIPTOR *ppObjectsSecurityDescriptor
  51. );
  52. BOOL
  53. DeletePrinterSecurity(
  54. PINIPRINTER pIniPrinter
  55. );
  56. BOOL
  57. DeleteDocumentSecurity(
  58. PINIJOB pIniJob
  59. );
  60. PSECURITY_DESCRIPTOR
  61. CreateEverybodySecurityDescriptor(
  62. VOID
  63. );
  64. BOOL
  65. ValidateObjectAccess(
  66. IN DWORD ObjectType,
  67. IN ACCESS_MASK DesiredAccess,
  68. IN LPVOID ObjectHandle,
  69. OUT PACCESS_MASK pGrantedAccess,
  70. IN PINISPOOLER pIniSpooler
  71. );
  72. BOOL
  73. ValidateObjectAccessWithToken(
  74. IN HANDLE hClientToken,
  75. IN DWORD ObjectType,
  76. IN ACCESS_MASK DesiredAccess,
  77. IN LPVOID ObjectHandle,
  78. OUT PACCESS_MASK pGrantedAccess,
  79. IN PINISPOOLER pIniSpooler
  80. );
  81. BOOL
  82. AccessGranted(
  83. DWORD ObjectType,
  84. ACCESS_MASK DesiredAccess,
  85. PSPOOL pSpool
  86. );
  87. VOID MapGenericToSpecificAccess(
  88. DWORD ObjectType,
  89. DWORD GenericAccess,
  90. PDWORD pSpecificAccess
  91. );
  92. BOOL
  93. GetTokenHandle(
  94. PHANDLE TokenHandle
  95. );
  96. BOOL
  97. GetSecurityInformation(
  98. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  99. PSECURITY_INFORMATION pSecurityInformation
  100. );
  101. ACCESS_MASK
  102. GetPrivilegeRequired(
  103. SECURITY_INFORMATION SecurityInformation
  104. );
  105. BOOL
  106. BuildPartialSecurityDescriptor(
  107. ACCESS_MASK AccessGranted,
  108. PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
  109. PSECURITY_DESCRIPTOR *ppPartialSecurityDescriptor,
  110. PDWORD pPartialSecurityDescriptorLength
  111. );
  112. PSECURITY_DESCRIPTOR
  113. CreateDriversShareSecurityDescriptor(
  114. VOID
  115. );
  116. BOOL
  117. InitializeSecurityStructures(
  118. VOID
  119. );
  120. DWORD
  121. PrincipalIsRemoteGuest(
  122. IN HANDLE hToken,
  123. OUT BOOL *pbRemoteGuest
  124. );
  125. DWORD
  126. CheckPrivilegePresent(
  127. IN HANDLE hToken,
  128. IN PLUID pLuid,
  129. IN OUT LPBOOL pbPresent,
  130. IN OUT LPDWORD pAttributes OPTIONAL
  131. );
  132. BOOL
  133. GrantJobReadPermissionToLocalSystem(
  134. IN OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor
  135. );
  136. #ifdef __cplusplus
  137. }
  138. #endif
  139. #endif