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.

186 lines
5.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992-1999.
  5. //
  6. // File: feclient.h
  7. //
  8. // Contents: EFS client dll interface definitions.
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef _FE_CLIENT_
  12. #define _FE_CLIENT_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define FE_MAJOR_REVISION_MASK 0xFFFF0000
  20. #define FE_MINOR_REVISION_MASK 0x0000FFFF
  21. #define FE_REVISION_1_0 0x00010000
  22. ////////////////////////////////////////////////////////////////////////////////////
  23. //
  24. // Function prototypes for API exported from client DLL. Encryption
  25. // systems intending to replace EFS that wish to support the Win32
  26. // encryption API set must implement these interfaces and export a
  27. // table (defined below) to get to them.
  28. //
  29. typedef DWORD
  30. (*LPFEAPI_CLIENT_OPEN_RAW)(
  31. IN LPCWSTR lpFileName,
  32. IN ULONG Flags,
  33. OUT PVOID * Context
  34. );
  35. typedef DWORD
  36. (*LPFEAPI_CLIENT_READ_RAW)(
  37. IN PFE_EXPORT_FUNC ExportCallback,
  38. IN PVOID CallbackContext,
  39. IN PVOID Context
  40. );
  41. typedef DWORD
  42. (*LPFEAPI_CLIENT_WRITE_RAW)(
  43. IN PFE_IMPORT_FUNC ImportCallback,
  44. IN PVOID CallbackContext,
  45. IN PVOID Context
  46. );
  47. typedef VOID
  48. (*LPFEAPI_CLIENT_CLOSE_RAW)(
  49. IN PVOID Context
  50. );
  51. typedef DWORD
  52. (*LPFEAPI_CLIENT_ENCRYPT_FILE)(
  53. IN LPCWSTR lpFileName // name of file to be encrypted
  54. );
  55. typedef DWORD
  56. (*LPFEAPI_CLIENT_DECRYPT_FILE)(
  57. IN LPCWSTR lpFileName, // name of file to be decrypted
  58. IN DWORD dwRecovery
  59. );
  60. typedef BOOL
  61. (*LPFEAPI_CLIENT_FILE_ENCRYPTION_STATUS)(
  62. IN LPCWSTR lpFileName, // name of file to be checked
  63. IN LPDWORD lpStatus
  64. );
  65. typedef DWORD
  66. (*LPFEAPI_CLIENT_QUERY_USERS)(
  67. IN LPCWSTR lpFileName,
  68. OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pUsers
  69. );
  70. typedef DWORD
  71. (*LPFEAPI_CLIENT_QUERY_RECOVERY_AGENTS)(
  72. IN LPCWSTR lpFileName,
  73. OUT PENCRYPTION_CERTIFICATE_HASH_LIST * pRecoveryAgents
  74. );
  75. typedef DWORD
  76. (*LPFEAPI_CLIENT_REMOVE_USERS)(
  77. IN LPCWSTR lpFileName,
  78. IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
  79. );
  80. typedef DWORD
  81. (*LPFEAPI_CLIENT_ADD_USERS)(
  82. IN LPCWSTR lpFileName,
  83. IN PENCRYPTION_CERTIFICATE_LIST pEncryptionCertificates
  84. );
  85. typedef DWORD
  86. (*LPFEAPI_CLIENT_SET_KEY)(
  87. IN PENCRYPTION_CERTIFICATE pEncryptionCertificate
  88. );
  89. typedef VOID
  90. (*LPFEAPI_CLIENT_FREE_HASH_LIST)(
  91. IN PENCRYPTION_CERTIFICATE_HASH_LIST pHashList
  92. );
  93. typedef DWORD
  94. (*LPFEAPI_CLIENT_DUPLICATE_ENCRYPTION_INFO)(
  95. IN LPCWSTR lpSrcFile,
  96. IN LPCWSTR lpDestFile,
  97. IN DWORD dwCreationDistribution,
  98. IN DWORD dwAttributes,
  99. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  100. );
  101. typedef BOOL
  102. (*LPFEAPI_CLIENT_DISABLE_DIR)(
  103. IN LPCWSTR DirPath,
  104. IN BOOL Disable
  105. );
  106. typedef DWORD
  107. (*LPFEAPI_CLIENT_GET_KEY_INFO)(
  108. IN LPCWSTR lpFileName,
  109. IN DWORD InfoClass,
  110. OUT PEFS_RPC_BLOB * KeyInfo
  111. );
  112. typedef VOID
  113. (*LPFEAPI_CLIENT_FREE_KEY_INFO)(
  114. IN PEFS_RPC_BLOB pKeyInfo
  115. );
  116. ////////////////////////////////////////////////////////////////////////////////////
  117. //
  118. // Interface to client dll. This dll is responsible for performing the requested
  119. // operations.
  120. //
  121. typedef struct _FE_CLIENT_DISPATCH_TABLE {
  122. LPFEAPI_CLIENT_ENCRYPT_FILE EncryptFile;
  123. LPFEAPI_CLIENT_DECRYPT_FILE DecryptFile;
  124. LPFEAPI_CLIENT_FILE_ENCRYPTION_STATUS FileEncryptionStatus;
  125. LPFEAPI_CLIENT_OPEN_RAW OpenFileRaw;
  126. LPFEAPI_CLIENT_READ_RAW ReadFileRaw;
  127. LPFEAPI_CLIENT_WRITE_RAW WriteFileRaw;
  128. LPFEAPI_CLIENT_CLOSE_RAW CloseFileRaw;
  129. LPFEAPI_CLIENT_ADD_USERS AddUsers;
  130. LPFEAPI_CLIENT_REMOVE_USERS RemoveUsers;
  131. LPFEAPI_CLIENT_QUERY_RECOVERY_AGENTS QueryRecoveryAgents;
  132. LPFEAPI_CLIENT_QUERY_USERS QueryUsers;
  133. LPFEAPI_CLIENT_SET_KEY SetKey;
  134. LPFEAPI_CLIENT_FREE_HASH_LIST FreeCertificateHashList;
  135. LPFEAPI_CLIENT_DUPLICATE_ENCRYPTION_INFO DuplicateEncryptionInfo;
  136. LPFEAPI_CLIENT_DISABLE_DIR DisableDir;
  137. LPFEAPI_CLIENT_GET_KEY_INFO GetKeyInfo;
  138. LPFEAPI_CLIENT_FREE_KEY_INFO FreeKeyInfo;
  139. } FE_CLIENT_DISPATCH_TABLE, *LPFE_CLIENT_DISPATCH_TABLE;
  140. typedef struct _FE_CLIENT_INFO {
  141. DWORD dwRevision;
  142. LPFE_CLIENT_DISPATCH_TABLE lpServices;
  143. } FE_CLIENT_INFO, *LPFE_CLIENT_INFO;
  144. typedef BOOL
  145. (*LPFEAPI_CLIENT_INITIALIZE) (
  146. IN DWORD dwEfsRevision,
  147. OUT LPFE_CLIENT_INFO *lpEfsInfo
  148. );
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152. #endif // _FE_CLIENT_