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.

227 lines
5.4 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. adlinterface.h
  5. Abstract:
  6. The interface used to specify a language definition to the ADL parser
  7. Author:
  8. t-eugenz - August 2000
  9. Environment:
  10. User mode only.
  11. Revision History:
  12. Created - August 2000
  13. --*/
  14. #pragma once
  15. //
  16. // YACC-generated tokens
  17. // Language type tokens are in this file
  18. //
  19. #include "tokens.h"
  20. //
  21. // Languages currently supported by the parser
  22. // The ADL_LANGUAGE_* parameter should be used in the ADL_LANGUAGE_SPEC
  23. // structure
  24. //
  25. #define ADL_LANGUAGE_ENGLISH TK_LANG_ENGLISH
  26. #define ADL_LANGUAGE_REVERSE TK_LANG_REVERSE
  27. typedef struct
  28. /*++
  29. Struct: ADL_MASK_STRING
  30. Description:
  31. This is used to specify a mapping between permission strings
  32. and access masks in the ADL_PARSER_CONTROL structure.
  33. A list of these is traversed in order to map an access mask
  34. to a set of strings, or a set of strings to an access mask
  35. --*/
  36. {
  37. ACCESS_MASK mask;
  38. WCHAR *str;
  39. } ADL_MASK_STRING, *PADL_MASK_STRING;
  40. //
  41. // ADL Language Definition, includes grammar type, characters,
  42. // and special token strings
  43. //
  44. typedef struct
  45. /*++
  46. Struct: ADL_LANGUAGE_SPEC
  47. Description:
  48. This is used to define the locale-specific detail about the language
  49. to be used by the ADL parser, such as all specific characters and
  50. string tokens.
  51. Requirement: All CH_* characters must be distinct. If two of the
  52. characters were identical, the lexer behavior would be
  53. undefined.
  54. Requirement: All SZ_ strings must be non-null, NULL terminated,
  55. and distinct. Distinctness is not verified, and is
  56. left to the user.
  57. Requirement: dwLanguageType must be one of the language types supported
  58. by the given version of the parser. Valid languages are
  59. defined above.
  60. --*/
  61. {
  62. //
  63. // Grammar type (see adl.y for supported grammar types)
  64. //
  65. DWORD dwLanguageType;
  66. //
  67. // Whitespace
  68. //
  69. WCHAR CH_NULL;
  70. WCHAR CH_SPACE;
  71. WCHAR CH_TAB;
  72. WCHAR CH_NEWLINE;
  73. WCHAR CH_RETURN;
  74. //
  75. // Separators
  76. //
  77. WCHAR CH_QUOTE;
  78. WCHAR CH_COMMA;
  79. WCHAR CH_SEMICOLON;
  80. WCHAR CH_OPENPAREN;
  81. WCHAR CH_CLOSEPAREN;
  82. //
  83. // Domain / username specifiers
  84. //
  85. WCHAR CH_AT;
  86. WCHAR CH_SLASH;
  87. WCHAR CH_PERIOD;
  88. //
  89. // padding
  90. //
  91. WORD sbz0;
  92. //
  93. // ADL-specific tokens
  94. //
  95. WCHAR * SZ_TK_AND;
  96. WCHAR * SZ_TK_EXCEPT;
  97. WCHAR * SZ_TK_ON;
  98. WCHAR * SZ_TK_ALLOWED;
  99. WCHAR * SZ_TK_AS;
  100. //
  101. // Inheritance specifier tokens
  102. //
  103. WCHAR * SZ_TK_THIS_OBJECT;
  104. WCHAR * SZ_TK_CONTAINERS;
  105. WCHAR * SZ_TK_OBJECTS;
  106. WCHAR * SZ_TK_CONTAINERS_OBJECTS;
  107. WCHAR * SZ_TK_NO_PROPAGATE;
  108. } ADL_LANGUAGE_SPEC, *PADL_LANGUAGE_SPEC;
  109. typedef struct
  110. /*++
  111. Struct: ADL_PARSER_CONTROL
  112. Description:
  113. This is used to define the behavior of the ADL parser / printer.
  114. Requirement: pLand be non-NULL and valid (see
  115. comments in ADL_LANGUAGE_SPEC definition).
  116. Requirement: pPermissions must be non-null and must be an array of 1
  117. or more ADL_MASK_STRING structs with non-NULL strings
  118. and non-zero masks. This must be terminated by an entry
  119. with a NULL string and a 0 mask.
  120. Requirement: pPermissions may NOT contain any access masks such that
  121. the bitwise AND of that mask and either amNeverSet or
  122. amSetAllow is non-zero.
  123. Requirement: For any access mask or subset of one that could be
  124. encountered in the given use of ADL, there must exist a set
  125. of pPermissions entries such that the logical OR of that
  126. set (ANDed with the negation of amNeverSet and amSetAllow)
  127. is equal to the access mask encountered. This means that
  128. any bit used should have a name associated with it, though
  129. masks with multiple bits may be specified.
  130. Requirement: If mask B is a subset of mask A, then the entry for mask
  131. A MUST appear before the entry for mask B, otherwise there
  132. will be redundant permission names in the produced ADL
  133. statements.
  134. --*/
  135. {
  136. //
  137. // Language specification
  138. //
  139. PADL_LANGUAGE_SPEC pLang;
  140. //
  141. // Permission mapping
  142. //
  143. PADL_MASK_STRING pPermissions;
  144. //
  145. // Special cases for permission bits never to be set in an ACE
  146. // such as MAXIMUM_ALLOWED and ACCESS_SYSTEM_SECURITY
  147. //
  148. ACCESS_MASK amNeverSet;
  149. //
  150. // Special cases for bits which are to be set in all allows
  151. // and never set in denies.
  152. //
  153. // With files, for example, this is the SYNCHRONIZE bit
  154. //
  155. ACCESS_MASK amSetAllow;
  156. } ADL_PARSER_CONTROL, *PADL_PARSER_CONTROL;