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.

167 lines
2.8 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. DWORD ObjectType,
  67. ACCESS_MASK DesiredAccess,
  68. LPVOID ObjectHandle,
  69. PACCESS_MASK pGrantedAccess,
  70. PINISPOOLER pIniSpooler
  71. );
  72. BOOL
  73. AccessGranted(
  74. DWORD ObjectType,
  75. ACCESS_MASK DesiredAccess,
  76. PSPOOL pSpool
  77. );
  78. VOID MapGenericToSpecificAccess(
  79. DWORD ObjectType,
  80. DWORD GenericAccess,
  81. PDWORD pSpecificAccess
  82. );
  83. BOOL
  84. GetTokenHandle(
  85. PHANDLE TokenHandle
  86. );
  87. BOOL
  88. GetSecurityInformation(
  89. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  90. PSECURITY_INFORMATION pSecurityInformation
  91. );
  92. ACCESS_MASK
  93. GetPrivilegeRequired(
  94. SECURITY_INFORMATION SecurityInformation
  95. );
  96. BOOL
  97. BuildPartialSecurityDescriptor(
  98. ACCESS_MASK AccessGranted,
  99. PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
  100. PSECURITY_DESCRIPTOR *ppPartialSecurityDescriptor,
  101. PDWORD pPartialSecurityDescriptorLength
  102. );
  103. PSECURITY_DESCRIPTOR
  104. CreateDriversShareSecurityDescriptor(
  105. VOID
  106. );
  107. PSECURITY_DESCRIPTOR
  108. CreatePrintShareSecurityDescriptor(
  109. VOID
  110. );
  111. BOOL
  112. InitializeSecurityStructures(
  113. VOID
  114. );
  115. DWORD
  116. PrincipalIsRemoteGuest(
  117. IN HANDLE hToken,
  118. OUT BOOL *pbRemoteGuest
  119. );
  120. DWORD
  121. CheckPrivilegePresent(
  122. IN HANDLE hToken,
  123. IN PLUID pLuid,
  124. IN OUT LPBOOL pbPresent,
  125. IN OUT LPDWORD pAttributes OPTIONAL
  126. );
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif