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.

99 lines
3.1 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 void SetAdding ()
  48. {
  49. m_bAddInCallToPolicyChanged = TRUE;
  50. }
  51. virtual void SetDeleting ()
  52. {
  53. m_bAddInCallToPolicyChanged = FALSE;
  54. }
  55. virtual ~CCertStoreGPE ();
  56. private:
  57. bool m_fIsNullEFSPolicy;
  58. IGPEInformation * m_pGPEInformation;
  59. CTypedPtrList<CPtrList, CERT_CONTEXT_PSID_STRUCT*> m_EFSCertList;
  60. HKEY m_hGroupPolicyKey;
  61. BOOL m_bAddInCallToPolicyChanged; // corresponds to bAdd
  62. // argument in IGPEInformation::PolicyChanged ()
  63. protected:
  64. virtual void FinalCommit();
  65. PSID GetPSIDFromCert (PCCERT_CONTEXT pCertContext);
  66. HRESULT WriteEFSBlobToRegistry();
  67. HRESULT CreatePublicKeyInformationCertificate(
  68. IN PSID pUserSid OPTIONAL,
  69. PBYTE pbCert,
  70. DWORD cbCert,
  71. OUT PEFS_PUBLIC_KEY_INFO * PublicKeyInformation,
  72. DWORD* pcbPublicKeyInfo);
  73. };
  74. class CEnrollmentNodeCookie : public CCertMgrCookie
  75. {
  76. public:
  77. CEnrollmentNodeCookie (
  78. CertificateManagerObjectType objecttype,
  79. LPCWSTR objectName,
  80. IGPEInformation* pGPEInformation);
  81. virtual ~CEnrollmentNodeCookie ();
  82. IGPEInformation* GetGPEInformation ();
  83. private:
  84. IGPEInformation* m_pGPEInformation;
  85. };
  86. #endif // ~__STOREGPE_H_INCLUDED__