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.

249 lines
5.2 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. #ifdef MIDL_PASS
  36. [range(0,32768)]
  37. #endif // MIDL_PASS
  38. DWORD cbData;
  39. #ifdef MIDL_PASS
  40. [size_is(cbData)]
  41. #endif // MIDL_PASS
  42. PBYTE pbData;
  43. } EFS_CERTIFICATE_BLOB, *PEFS_CERTIFICATE_BLOB;
  44. //
  45. // Certificate Hash
  46. //
  47. typedef struct _EFS_HASH_BLOB {
  48. #ifdef MIDL_PASS
  49. [range(0,100)]
  50. #endif // MIDL_PASS
  51. DWORD cbData;
  52. #ifdef MIDL_PASS
  53. [size_is(cbData)]
  54. #endif // MIDL_PASS
  55. PBYTE pbData;
  56. } EFS_HASH_BLOB, *PEFS_HASH_BLOB;
  57. //
  58. // RPC blob
  59. //
  60. typedef struct _EFS_RPC_BLOB {
  61. #ifdef MIDL_PASS
  62. [range(0,266240)]
  63. #endif // MIDL_PASS
  64. DWORD cbData;
  65. #ifdef MIDL_PASS
  66. [size_is(cbData)]
  67. #endif // MIDL_PASS
  68. PBYTE pbData;
  69. } EFS_RPC_BLOB, *PEFS_RPC_BLOB;
  70. typedef struct _EFS_KEY_INFO {
  71. DWORD dwVersion;
  72. ULONG Entropy;
  73. ALG_ID Algorithm;
  74. ULONG KeyLength;
  75. } EFS_KEY_INFO, *PEFS_KEY_INFO;
  76. //
  77. // Input to add a user to an encrypted file
  78. //
  79. typedef struct _ENCRYPTION_CERTIFICATE {
  80. DWORD cbTotalLength;
  81. SID * pUserSid;
  82. PEFS_CERTIFICATE_BLOB pCertBlob;
  83. } ENCRYPTION_CERTIFICATE, *PENCRYPTION_CERTIFICATE;
  84. #define MAX_SID_SIZE 256
  85. typedef struct _ENCRYPTION_CERTIFICATE_HASH {
  86. DWORD cbTotalLength;
  87. SID * pUserSid;
  88. PEFS_HASH_BLOB pHash;
  89. #ifdef MIDL_PASS
  90. [string]
  91. #endif // MIDL_PASS
  92. LPWSTR lpDisplayInformation;
  93. } ENCRYPTION_CERTIFICATE_HASH, *PENCRYPTION_CERTIFICATE_HASH;
  94. typedef struct _ENCRYPTION_CERTIFICATE_HASH_LIST {
  95. #ifdef MIDL_PASS
  96. [range(0,500)]
  97. #endif // MIDL_PASS
  98. DWORD nCert_Hash;
  99. #ifdef MIDL_PASS
  100. [size_is(nCert_Hash)]
  101. #endif // MIDL_PASS
  102. PENCRYPTION_CERTIFICATE_HASH * pUsers;
  103. } ENCRYPTION_CERTIFICATE_HASH_LIST, *PENCRYPTION_CERTIFICATE_HASH_LIST;
  104. typedef struct _ENCRYPTION_CERTIFICATE_LIST {
  105. #ifdef MIDL_PASS
  106. [range(0,500)]
  107. #endif // MIDL_PASS
  108. DWORD nUsers;
  109. #ifdef MIDL_PASS
  110. [size_is(nUsers)]
  111. #endif // MIDL_PASS
  112. PENCRYPTION_CERTIFICATE * pUsers;
  113. } ENCRYPTION_CERTIFICATE_LIST, *PENCRYPTION_CERTIFICATE_LIST;
  114. //+---------------------------------------------------------------------------------/
  115. // /
  116. // /
  117. // Prototypes /
  118. // /
  119. // /
  120. //----------------------------------------------------------------------------------/
  121. WINADVAPI
  122. DWORD
  123. WINAPI
  124. QueryUsersOnEncryptedFile(
  125. IN LPCWSTR lpFileName,
  126. OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pUsers
  127. );
  128. WINADVAPI
  129. DWORD
  130. WINAPI
  131. QueryRecoveryAgentsOnEncryptedFile(
  132. IN LPCWSTR lpFileName,
  133. OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pRecoveryAgents
  134. );
  135. WINADVAPI
  136. DWORD
  137. WINAPI
  138. RemoveUsersFromEncryptedFile(
  139. IN LPCWSTR lpFileName,
  140. IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  141. );
  142. WINADVAPI
  143. DWORD
  144. WINAPI
  145. AddUsersToEncryptedFile(
  146. IN LPCWSTR lpFileName,
  147. IN PENCRYPTION_CERTIFICATE_LIST pUsers
  148. );
  149. WINADVAPI
  150. DWORD
  151. WINAPI
  152. SetUserFileEncryptionKey(
  153. IN PENCRYPTION_CERTIFICATE pEncryptionCertificate
  154. );
  155. WINADVAPI
  156. VOID
  157. WINAPI
  158. FreeEncryptionCertificateHashList(
  159. IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  160. );
  161. WINADVAPI
  162. BOOL
  163. WINAPI
  164. EncryptionDisable(
  165. IN LPCWSTR DirPath,
  166. IN BOOL Disable
  167. );
  168. WINADVAPI
  169. DWORD
  170. WINAPI
  171. DuplicateEncryptionInfoFile(
  172. IN LPCWSTR SrcFileName,
  173. IN LPCWSTR DstFileName,
  174. IN DWORD dwCreationDistribution,
  175. IN DWORD dwAttributes,
  176. IN CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
  177. );
  178. #ifdef __cplusplus
  179. } // Balance extern "C" above
  180. #endif
  181. #endif // __WINEFS_H__