WinEFS.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:5k
源码类别:

模拟服务器

开发平台:

C/C++

  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.     
  67. } EFS_KEY_INFO, *PEFS_KEY_INFO;
  68. //
  69. // Input to add a user to an encrypted file
  70. //
  71. typedef struct _ENCRYPTION_CERTIFICATE {
  72.     DWORD cbTotalLength;
  73.     SID * pUserSid;
  74.     PEFS_CERTIFICATE_BLOB pCertBlob;
  75. } ENCRYPTION_CERTIFICATE, *PENCRYPTION_CERTIFICATE;
  76. #define MAX_SID_SIZE 256
  77. typedef struct _ENCRYPTION_CERTIFICATE_HASH {
  78.     DWORD cbTotalLength;
  79.     SID * pUserSid;
  80.     PEFS_HASH_BLOB  pHash;
  81. #ifdef MIDL_PASS
  82.     [string]
  83. #endif // MIDL_PASS
  84.     LPWSTR lpDisplayInformation;
  85. } ENCRYPTION_CERTIFICATE_HASH, *PENCRYPTION_CERTIFICATE_HASH;
  86. typedef struct _ENCRYPTION_CERTIFICATE_HASH_LIST {
  87.     DWORD nCert_Hash;
  88. #ifdef MIDL_PASS
  89.     [size_is(nCert_Hash)]
  90. #endif // MIDL_PASS
  91.      PENCRYPTION_CERTIFICATE_HASH * pUsers;
  92. } ENCRYPTION_CERTIFICATE_HASH_LIST, *PENCRYPTION_CERTIFICATE_HASH_LIST;
  93. typedef struct _ENCRYPTION_CERTIFICATE_LIST {
  94.     DWORD nUsers;
  95. #ifdef MIDL_PASS
  96.     [size_is(nUsers)]
  97. #endif // MIDL_PASS
  98.      PENCRYPTION_CERTIFICATE * pUsers;
  99. } ENCRYPTION_CERTIFICATE_LIST, *PENCRYPTION_CERTIFICATE_LIST;
  100. //+---------------------------------------------------------------------------------/
  101. //                                                                                  /
  102. //                                                                                  /
  103. //                               Prototypes                                         /
  104. //                                                                                  /
  105. //                                                                                  /
  106. //----------------------------------------------------------------------------------/
  107. WINADVAPI
  108. DWORD
  109. WINAPI
  110. QueryUsersOnEncryptedFile(
  111.      IN LPCWSTR lpFileName,
  112.      OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pUsers
  113.     );
  114. WINADVAPI
  115. DWORD
  116. WINAPI
  117. QueryRecoveryAgentsOnEncryptedFile(
  118.      IN LPCWSTR lpFileName,
  119.      OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pRecoveryAgents
  120.     );
  121. WINADVAPI
  122. DWORD
  123. WINAPI
  124. RemoveUsersFromEncryptedFile(
  125.      IN LPCWSTR lpFileName,
  126.      IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  127.     );
  128. WINADVAPI
  129. DWORD
  130. WINAPI
  131. AddUsersToEncryptedFile(
  132.      IN LPCWSTR lpFileName,
  133.      IN PENCRYPTION_CERTIFICATE_LIST pUsers
  134.     );
  135. WINADVAPI
  136. DWORD
  137. WINAPI
  138. SetUserFileEncryptionKey(
  139.     IN PENCRYPTION_CERTIFICATE pEncryptionCertificate
  140.     );
  141. WINADVAPI
  142. VOID
  143. WINAPI
  144. FreeEncryptionCertificateHashList(
  145.     IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  146.     );
  147. WINADVAPI
  148. BOOL
  149. WINAPI
  150. EncryptionDisable(
  151.     IN LPCWSTR DirPath,
  152.     IN BOOL Disable
  153.     );
  154. WINADVAPI
  155. DWORD
  156. WINAPI
  157. DuplicateEncryptionInfoFile(
  158.      IN LPCWSTR SrcFileName,
  159.      IN LPCWSTR DstFileName, 
  160.      IN DWORD dwCreationDistribution, 
  161.      IN DWORD dwAttributes, 
  162.      IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  163.      );
  164. #ifdef __cplusplus
  165. }       // Balance extern "C" above
  166. #endif
  167. #endif // __WINEFS_H__