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.

233 lines
4.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992-1999.
  5. //
  6. // File: winefs.h
  7. //
  8. // Contents: EFS Data and prototypes.
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __WINEFS_H__
  12. #define __WINEFS_H__
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. //+---------------------------------------------------------------------------------/
  20. // /
  21. // /
  22. // Data Structures /
  23. // /
  24. // /
  25. //----------------------------------------------------------------------------------/
  26. #ifndef ALGIDDEF
  27. #define ALGIDDEF
  28. typedef unsigned int ALG_ID;
  29. #endif
  30. //
  31. // Encoded Certificate
  32. //
  33. typedef struct _CERTIFICATE_BLOB {
  34. DWORD dwCertEncodingType;
  35. DWORD cbData;
  36. #ifdef MIDL_PASS
  37. [size_is(cbData)]
  38. #endif // MIDL_PASS
  39. PBYTE pbData;
  40. } EFS_CERTIFICATE_BLOB, *PEFS_CERTIFICATE_BLOB;
  41. //
  42. // Certificate Hash
  43. //
  44. typedef struct _EFS_HASH_BLOB {
  45. DWORD cbData;
  46. #ifdef MIDL_PASS
  47. [size_is(cbData)]
  48. #endif // MIDL_PASS
  49. PBYTE pbData;
  50. } EFS_HASH_BLOB, *PEFS_HASH_BLOB;
  51. //
  52. // RPC blob
  53. //
  54. typedef struct _EFS_RPC_BLOB {
  55. DWORD cbData;
  56. #ifdef MIDL_PASS
  57. [size_is(cbData)]
  58. #endif // MIDL_PASS
  59. PBYTE pbData;
  60. } EFS_RPC_BLOB, *PEFS_RPC_BLOB;
  61. typedef struct _EFS_KEY_INFO {
  62. DWORD dwVersion;
  63. ULONG Entropy;
  64. ALG_ID Algorithm;
  65. ULONG KeyLength;
  66. } EFS_KEY_INFO, *PEFS_KEY_INFO;
  67. //
  68. // Input to add a user to an encrypted file
  69. //
  70. typedef struct _ENCRYPTION_CERTIFICATE {
  71. DWORD cbTotalLength;
  72. SID * pUserSid;
  73. PEFS_CERTIFICATE_BLOB pCertBlob;
  74. } ENCRYPTION_CERTIFICATE, *PENCRYPTION_CERTIFICATE;
  75. #define MAX_SID_SIZE 256
  76. typedef struct _ENCRYPTION_CERTIFICATE_HASH {
  77. DWORD cbTotalLength;
  78. SID * pUserSid;
  79. PEFS_HASH_BLOB pHash;
  80. #ifdef MIDL_PASS
  81. [string]
  82. #endif // MIDL_PASS
  83. LPWSTR lpDisplayInformation;
  84. } ENCRYPTION_CERTIFICATE_HASH, *PENCRYPTION_CERTIFICATE_HASH;
  85. typedef struct _ENCRYPTION_CERTIFICATE_HASH_LIST {
  86. DWORD nCert_Hash;
  87. #ifdef MIDL_PASS
  88. [size_is(nCert_Hash)]
  89. #endif // MIDL_PASS
  90. PENCRYPTION_CERTIFICATE_HASH * pUsers;
  91. } ENCRYPTION_CERTIFICATE_HASH_LIST, *PENCRYPTION_CERTIFICATE_HASH_LIST;
  92. typedef struct _ENCRYPTION_CERTIFICATE_LIST {
  93. DWORD nUsers;
  94. #ifdef MIDL_PASS
  95. [size_is(nUsers)]
  96. #endif // MIDL_PASS
  97. PENCRYPTION_CERTIFICATE * pUsers;
  98. } ENCRYPTION_CERTIFICATE_LIST, *PENCRYPTION_CERTIFICATE_LIST;
  99. //+---------------------------------------------------------------------------------/
  100. // /
  101. // /
  102. // Prototypes /
  103. // /
  104. // /
  105. //----------------------------------------------------------------------------------/
  106. WINADVAPI
  107. DWORD
  108. WINAPI
  109. QueryUsersOnEncryptedFile(
  110. IN LPCWSTR lpFileName,
  111. OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pUsers
  112. );
  113. WINADVAPI
  114. DWORD
  115. WINAPI
  116. QueryRecoveryAgentsOnEncryptedFile(
  117. IN LPCWSTR lpFileName,
  118. OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pRecoveryAgents
  119. );
  120. WINADVAPI
  121. DWORD
  122. WINAPI
  123. RemoveUsersFromEncryptedFile(
  124. IN LPCWSTR lpFileName,
  125. IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  126. );
  127. WINADVAPI
  128. DWORD
  129. WINAPI
  130. AddUsersToEncryptedFile(
  131. IN LPCWSTR lpFileName,
  132. IN PENCRYPTION_CERTIFICATE_LIST pUsers
  133. );
  134. WINADVAPI
  135. DWORD
  136. WINAPI
  137. SetUserFileEncryptionKey(
  138. IN PENCRYPTION_CERTIFICATE pEncryptionCertificate
  139. );
  140. WINADVAPI
  141. VOID
  142. WINAPI
  143. FreeEncryptionCertificateHashList(
  144. IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  145. );
  146. WINADVAPI
  147. BOOL
  148. WINAPI
  149. EncryptionDisable(
  150. IN LPCWSTR DirPath,
  151. IN BOOL Disable
  152. );
  153. WINADVAPI
  154. DWORD
  155. WINAPI
  156. DuplicateEncryptionInfoFile(
  157. IN LPCWSTR SrcFileName,
  158. IN LPCWSTR DstFileName,
  159. IN DWORD dwCreationDistribution,
  160. IN DWORD dwAttributes,
  161. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  162. );
  163. #ifdef __cplusplus
  164. } // Balance extern "C" above
  165. #endif
  166. #endif // __WINEFS_H__