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.

89 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 2001.
  5. //
  6. // File: StoreGPE.h
  7. //
  8. // Contents: CertStoreGPE class definition
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __STOREGPE_H_INCLUDED__
  12. #define __STOREGPE_H_INCLUDED__
  13. #include "cookie.h"
  14. class CERT_CONTEXT_PSID_STRUCT
  15. {
  16. public:
  17. CERT_CONTEXT_PSID_STRUCT (PCCERT_CONTEXT pCertContext, PSID psid);
  18. ~CERT_CONTEXT_PSID_STRUCT ();
  19. PCCERT_CONTEXT m_pCertContext;
  20. PSID m_psid;
  21. };
  22. class CCertStoreGPE : public CCertStore
  23. {
  24. public:
  25. virtual PCCERT_CONTEXT EnumCertificates (PCCERT_CONTEXT pPrevCertContext);
  26. HRESULT PolicyChanged ();
  27. HRESULT DeleteEFSPolicy (bool bCommitChanges);
  28. virtual HRESULT AddCertificateContext(PCCERT_CONTEXT pContext, LPCONSOLE pConsole, bool bDeletePrivateKey);
  29. void AllowEmptyEFSPolicy();
  30. virtual bool IsNullEFSPolicy();
  31. void AddCertToList (PCCERT_CONTEXT pCertContext, PSID userPSID);
  32. virtual HKEY GetGroupPolicyKey();
  33. IGPEInformation* GetGPEInformation() const;
  34. virtual bool IsMachineStore() ;
  35. virtual bool CanContain (CertificateManagerObjectType nodeType);
  36. virtual HCERTSTORE GetStoreHandle (BOOL bSilent = FALSE, HRESULT* phr = 0);
  37. virtual HRESULT Commit ();
  38. CCertStoreGPE (
  39. DWORD dwFlags,
  40. LPCWSTR lpcszMachineName,
  41. LPCWSTR objectName,
  42. const CString & pcszLogStoreName,
  43. const CString & pcszPhysStoreName,
  44. IGPEInformation * pGPTInformation,
  45. const GUID& compDataGUID,
  46. IConsole* pConsole);
  47. virtual ~CCertStoreGPE ();
  48. private:
  49. bool m_fIsNullEFSPolicy;
  50. IGPEInformation * m_pGPEInformation;
  51. CTypedPtrList<CPtrList, CERT_CONTEXT_PSID_STRUCT*> m_EFSCertList;
  52. HKEY m_hGroupPolicyKey;
  53. protected:
  54. virtual void FinalCommit();
  55. PSID GetPSIDFromCert (PCCERT_CONTEXT pCertContext);
  56. HRESULT WriteEFSBlobToRegistry();
  57. HRESULT CreatePublicKeyInformationCertificate(
  58. IN PSID pUserSid OPTIONAL,
  59. PBYTE pbCert,
  60. DWORD cbCert,
  61. OUT PEFS_PUBLIC_KEY_INFO * PublicKeyInformation,
  62. DWORD* pcbPublicKeyInfo);
  63. bool m_fIsComputerType;
  64. };
  65. class CEnrollmentNodeCookie : public CCertMgrCookie
  66. {
  67. public:
  68. CEnrollmentNodeCookie (
  69. CertificateManagerObjectType objecttype,
  70. LPCWSTR objectName,
  71. IGPEInformation* pGPEInformation);
  72. virtual ~CEnrollmentNodeCookie ();
  73. IGPEInformation* GetGPEInformation ();
  74. private:
  75. IGPEInformation* m_pGPEInformation;
  76. };
  77. #endif // ~__STOREGPE_H_INCLUDED__