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.

145 lines
3.3 KiB

  1. #ifndef _CRYPT32_H_
  2. #define _CRYPT32_H_
  3. #ifdef _cplusplus
  4. extern "C" {
  5. #endif
  6. #define DP_ACCOUNT_LOCAL_SYSTEM 18
  7. #define DP_ACCOUNT_LOCAL_SERVICE 19
  8. #define DP_ACCOUNT_NETWORK_SERVICE 20
  9. typedef struct {
  10. DWORD cbSize; // size for validity check.
  11. handle_t hBinding; // RPC binding handle.
  12. BOOL fOverrideToLocalSystem; // over-ride impersonation to Local System?
  13. BOOL fImpersonating; // Impersonating
  14. HANDLE hToken; // access token for impersonation when duplicate
  15. LPWSTR szUserStorageArea; // cached user storage area
  16. DWORD WellKnownAccount; // local system, local service, or network service?
  17. } CRYPT_SERVER_CONTEXT, *PCRYPT_SERVER_CONTEXT;
  18. //
  19. // note: unclear at the moment whether these will be public.
  20. //
  21. DWORD
  22. CPSCreateServerContext(
  23. OUT PCRYPT_SERVER_CONTEXT pServerContext,
  24. IN handle_t hBinding
  25. );
  26. DWORD
  27. CPSDeleteServerContext(
  28. IN PCRYPT_SERVER_CONTEXT pServerContext
  29. );
  30. DWORD CPSDuplicateContext(
  31. IN PVOID pvContext,
  32. IN OUT PVOID *ppvDuplicateContext
  33. );
  34. DWORD CPSFreeContext(
  35. IN PVOID pvDuplicateContext
  36. );
  37. DWORD CPSImpersonateClient(
  38. IN PVOID pvContext
  39. );
  40. DWORD CPSRevertToSelf(
  41. IN PVOID pvContext
  42. );
  43. DWORD CPSOverrideToLocalSystem(
  44. IN PVOID pvContext,
  45. IN BOOL *pfLocalSystem,
  46. IN OUT BOOL *pfCurrentlyLocalSystem
  47. );
  48. DWORD
  49. WINAPI
  50. CPSSetWellKnownAccount(
  51. IN PVOID pvContext,
  52. IN DWORD dwAccount);
  53. DWORD
  54. WINAPI
  55. CPSQueryWellKnownAccount(
  56. IN PVOID pvContext,
  57. OUT DWORD *pdwAccount);
  58. DWORD
  59. CPSDuplicateClientAccessToken(
  60. IN PVOID pvContext, // server context
  61. IN OUT HANDLE *phToken
  62. );
  63. DWORD CPSGetUserName(
  64. IN PVOID pvContext,
  65. OUT LPWSTR *ppszUserName,
  66. OUT DWORD *pcchUserName
  67. );
  68. #define USE_DPAPI_OWF 0x1
  69. #define USE_ROOT_CREDENTIAL 0x2
  70. DWORD CPSGetDerivedCredential(
  71. IN PVOID pvContext,
  72. OUT GUID *pCredentialID,
  73. IN DWORD dwFlags,
  74. IN PBYTE pbMixingBytes,
  75. IN DWORD cbMixingBytes,
  76. IN OUT BYTE rgbDerivedCredential[A_SHA_DIGEST_LEN]
  77. );
  78. DWORD CPSGetSystemCredential(
  79. IN PVOID pvContext,
  80. IN BOOL fLocalMachine,
  81. IN OUT BYTE rgbSystemCredential[A_SHA_DIGEST_LEN]
  82. );
  83. DWORD CPSCreateWorkerThread(
  84. IN PVOID pThreadFunc,
  85. IN PVOID pThreadArg
  86. );
  87. DWORD CPSAudit(
  88. IN HANDLE hToken,
  89. IN DWORD dwAuditID,
  90. IN LPCWSTR wszMasterKeyID,
  91. IN LPCWSTR wszRecoveryServer,
  92. IN DWORD dwReason,
  93. IN LPCWSTR wszRecoveryKeyID,
  94. IN DWORD dwFailure);
  95. DWORD
  96. WINAPI
  97. CPSGetSidHistory(
  98. IN PVOID pvContext,
  99. OUT PSID **papsidHistory,
  100. OUT DWORD *cpsidHistory
  101. );
  102. DWORD
  103. CPSGetUserStorageArea(
  104. IN PVOID pvContext,
  105. IN PSID pSid, // optional
  106. IN BOOL fCreate, // Create the storage area if it doesn't exist
  107. IN OUT LPWSTR *ppszUserStorageArea
  108. );
  109. #ifdef _cplusplus
  110. } // extern "C"
  111. #endif
  112. #endif // _CRYPT32_H_