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.

299 lines
8.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: pstdef.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _PSTDEF_H_
  11. #define _PSTDEF_H_
  12. /*
  13. Typedefs, values
  14. */
  15. // provider flags
  16. // provider capabilities
  17. typedef DWORD PST_PROVIDERCAPABILITIES;
  18. #define PST_PC_PFX 0x00000001
  19. #define PST_PC_HARDWARE 0x00000002
  20. #define PST_PC_SMARTCARD 0x00000004
  21. #define PST_PC_PCMCIA 0x00000008
  22. #define PST_PC_MULTIPLE_REPOSITORIES 0x00000010
  23. #define PST_PC_ROAMABLE 0x00000020
  24. #define PST_PC_NOT_AVAILABLE 0x00000040
  25. // NYI (not yet implemented)
  26. typedef DWORD PST_REPOSITORYCAPABILITIES;
  27. #define PST_RC_REMOVABLE 0x80000000
  28. // provider storage area
  29. typedef DWORD PST_KEY;
  30. #define PST_KEY_CURRENT_USER 0x00000000
  31. #define PST_KEY_LOCAL_MACHINE 0x00000001
  32. /*
  33. dwDefaultConfirmationStyle flags
  34. */
  35. //
  36. // allows user to choose confirmation style
  37. //
  38. #define PST_CF_DEFAULT 0x00000000
  39. //
  40. // forces silent item creation
  41. //
  42. #define PST_CF_NONE 0x00000001
  43. /*
  44. dwPromptFlags
  45. */
  46. //
  47. // app forces confirmation to be shown
  48. //
  49. #define PST_PF_ALWAYS_SHOW 0x00000001
  50. //
  51. // RSABase rqmt: determine if item has ui attached
  52. //
  53. #define PST_PF_NEVER_SHOW 0x00000002
  54. /*
  55. dwFlags values
  56. */
  57. //
  58. // Allows caller to specify creation not overwrite
  59. // of item during WriteItem call
  60. //
  61. #define PST_NO_OVERWRITE 0x00000002
  62. //
  63. // specifies insecure data stream to be written/read
  64. // there is no protection or guarantees for this data
  65. // flag only valid during item read/write calls
  66. // default: item calls are secure
  67. //
  68. #define PST_UNRESTRICTED_ITEMDATA 0x00000004
  69. //
  70. // on ReadItem call
  71. // return value on success without UI on item is PST_E_OK
  72. // return value on success with UI on item is PST_E_ITEM_EXISTS
  73. // return value on failure is a different error code
  74. //
  75. #define PST_PROMPT_QUERY 0x00000008
  76. //
  77. // on ReadItem, DeleteItem, for data migration purposes:
  78. // Avoid displaying UI on ReadItem unless a custom password is required (highsecurity).
  79. // Avoid displaying UI on DeleteItem, period.
  80. //
  81. #define PST_NO_UI_MIGRATION 0x00000010
  82. /*
  83. Security masks, rule modifiers
  84. */
  85. //
  86. // models access after NT access mask
  87. //
  88. // read, write
  89. typedef DWORD PST_ACCESSMODE;
  90. #define PST_READ 0x0001
  91. #define PST_WRITE 0x0002
  92. #define PST_CREATE_TYPE 0x0004
  93. #define PST_CREATE_SUBTYPE 0x0008
  94. #define PST_DELETE_TYPE 0x0010
  95. #define PST_DELETE_SUBTYPE 0x0020
  96. #define PST_USE 0x0040
  97. #define PST_GENERIC_READ PST_READ
  98. #define PST_GENERIC_WRITE (PST_WRITE | PST_CREATE_TYPE | PST_CREATE_SUBTYPE)
  99. #define PST_GENERIC_EXECUTE PST_USE
  100. #define PST_ALL_ACCESS 0x01FF
  101. // PST_ACCESSCLAUSETYPE
  102. // memhash, diskhash, authenticode, etc
  103. typedef DWORD PST_ACCESSCLAUSETYPE;
  104. //
  105. // pbClauseData points to PST_AUTHENTICODEDATA structure.
  106. //
  107. #define PST_AUTHENTICODE 1
  108. //
  109. // pbClauseData points to PST_BINARYCHECKDATA structure.
  110. //
  111. #define PST_BINARY_CHECK 2
  112. //
  113. // pbClauseData points to valid Windows NT security descriptor.
  114. // note that performance is improved on Set operations if the security
  115. // descriptor is in self-relative format, with valid owner and group Sids
  116. // (non-NULL).
  117. //
  118. #define PST_SECURITY_DESCRIPTOR 4
  119. //
  120. // pbClauseData is in self-relative format
  121. // (for internal use only)
  122. //
  123. #define PST_SELF_RELATIVE_CLAUSE 0x80000000L
  124. //
  125. // currently access clause modifiers - NOT to be or'd together
  126. //
  127. //
  128. // specified image is the immediate caller, and is an application (.exe)
  129. //
  130. #define PST_AC_SINGLE_CALLER 0
  131. //
  132. // specified image is not necessary the immediate caller, and is an
  133. // application (.exe)
  134. //
  135. #define PST_AC_TOP_LEVEL_CALLER 1
  136. //
  137. // specified image is the immediate caller. May be
  138. // an application (.exe) or a .dll
  139. //
  140. #define PST_AC_IMMEDIATE_CALLER 2
  141. /*
  142. Provider Parameters
  143. */
  144. //
  145. // flush the internal cache of passwords -- temporary?
  146. //
  147. #define PST_PP_FLUSH_PW_CACHE 0x1
  148. /*
  149. Provider Defns
  150. */
  151. //
  152. // Microsoft Base Provider (MS_BASE_PSTPROVIDER...)
  153. //
  154. #define MS_BASE_PSTPROVIDER_NAME L"System Protected Storage"
  155. // {8A078C30-3755-11d0-A0BD-00AA0061426A}
  156. #define MS_BASE_PSTPROVIDER_ID { 0x8a078c30, 0x3755, 0x11d0, { 0xa0, 0xbd, 0x0, 0xaa, 0x0, 0x61, 0x42, 0x6a } }
  157. #define MS_BASE_PSTPROVIDER_SZID L"8A078C30-3755-11d0-A0BD-00AA0061426A"
  158. //
  159. // Microsoft PFX Provider (MS_PFX_PSTPROVIDER...)
  160. //
  161. #define MS_PFX_PSTPROVIDER_NAME L"PFX Storage Provider"
  162. // {3ca94f30-7ac1-11d0-8c42-00c04fc299eb}
  163. #define MS_PFX_PSTPROVIDER_ID { 0x3ca94f30, 0x7ac1, 0x11d0, {0x8c, 0x42, 0x00, 0xc0, 0x4f, 0xc2, 0x99, 0xeb} }
  164. #define MS_PFX_PSTPROVIDER_SZID L"3ca94f30-7ac1-11d0-8c42-00c04fc299eb"
  165. /*
  166. Globally registered Type/Subtype guid/name pairs
  167. */
  168. #define PST_CONFIGDATA_TYPE_STRING L"Configuration Data"
  169. // 8ec99652-8909-11d0-8c4d-00c04fc297eb
  170. #define PST_CONFIGDATA_TYPE_GUID \
  171. { 0x8ec99652, \
  172. 0x8909, \
  173. 0x11d0, \
  174. {0x8c, 0x4d, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb} \
  175. }
  176. #define PST_PROTECTEDSTORAGE_SUBTYPE_STRING L"Protected Storage"
  177. // d3121b8e-8a7d-11d0-8c4f-00c04fc297eb
  178. #define PST_PROTECTEDSTORAGE_SUBTYPE_GUID \
  179. { 0xd3121b8e, \
  180. 0x8a7d, \
  181. 0x11d0, \
  182. {0x8c, 0x4f, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb} \
  183. }
  184. #define PST_PSTORE_PROVIDERS_SUBTYPE_STRING L"Protected Storage Provider List"
  185. // 8ed17a64-91d0-11d0-8c43-00c04fc2c621
  186. #define PST_PSTORE_PROVIDERS_SUBTYPE_GUID \
  187. { \
  188. 0x8ed17a64, \
  189. 0x91d0, \
  190. 0x11d0, \
  191. {0x8c, 0x43, 0x00, 0xc0, 0x4f, 0xc2, 0xc6, 0x21} \
  192. }
  193. //
  194. // error codes
  195. //
  196. #ifndef PST_E_OK
  197. #define PST_E_OK _HRESULT_TYPEDEF_(0x00000000L)
  198. #define PST_E_FAIL _HRESULT_TYPEDEF_(0x800C0001L)
  199. #define PST_E_PROV_DLL_NOT_FOUND _HRESULT_TYPEDEF_(0x800C0002L)
  200. #define PST_E_INVALID_HANDLE _HRESULT_TYPEDEF_(0x800C0003L)
  201. #define PST_E_TYPE_EXISTS _HRESULT_TYPEDEF_(0x800C0004L)
  202. #define PST_E_TYPE_NO_EXISTS _HRESULT_TYPEDEF_(0x800C0005L)
  203. #define PST_E_INVALID_RULESET _HRESULT_TYPEDEF_(0x800C0006L)
  204. #define PST_E_NO_PERMISSIONS _HRESULT_TYPEDEF_(0x800C0007L)
  205. #define PST_E_STORAGE_ERROR _HRESULT_TYPEDEF_(0x800C0008L)
  206. #define PST_E_CALLER_NOT_VERIFIED _HRESULT_TYPEDEF_(0x800C0009L)
  207. #define PST_E_WRONG_PASSWORD _HRESULT_TYPEDEF_(0x800C000AL)
  208. #define PST_E_DISK_IMAGE_MISMATCH _HRESULT_TYPEDEF_(0x800C000BL)
  209. #define PST_E_MEMORY_IMAGE_MISMATCH _HRESULT_TYPEDEF_(0x800C000CL)
  210. #define PST_E_UNKNOWN_EXCEPTION _HRESULT_TYPEDEF_(0x800C000DL)
  211. #define PST_E_BAD_FLAGS _HRESULT_TYPEDEF_(0x800C000EL)
  212. #define PST_E_ITEM_EXISTS _HRESULT_TYPEDEF_(0x800C000FL)
  213. #define PST_E_ITEM_NO_EXISTS _HRESULT_TYPEDEF_(0x800C0010L)
  214. #define PST_E_SERVICE_UNAVAILABLE _HRESULT_TYPEDEF_(0x800C0011L)
  215. #define PST_E_NOTEMPTY _HRESULT_TYPEDEF_(0x800C0012L)
  216. #define PST_E_INVALID_STRING _HRESULT_TYPEDEF_(0x800C0013L)
  217. #define PST_E_STATE_INVALID _HRESULT_TYPEDEF_(0x800C0014L)
  218. #define PST_E_NOT_OPEN _HRESULT_TYPEDEF_(0x800C0015L)
  219. #define PST_E_ALREADY_OPEN _HRESULT_TYPEDEF_(0x800C0016L)
  220. #define PST_E_NYI _HRESULT_TYPEDEF_(0x800C0F00L)
  221. #define MIN_PST_ERROR 0x800C0001
  222. #define MAX_PST_ERROR 0x800C0F00
  223. #endif // !PST_OK
  224. #endif // _PSTDEF_H_