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.

104 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. /////////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Microsoft Windows
  5. // Copyright (C) Microsoft Corporation, 2000-2001.
  6. //
  7. // File: SaferEntryHashPropertyPage.h
  8. //
  9. // Contents: Declaration of CSaferEntryHashPropertyPage
  10. //
  11. //----------------------------------------------------------------------------
  12. #if !defined(AFX_SAFERENTRYHASHPROPERTYPAGE_H__9F1BE911_6A3E_4BBA_8BE9_BFE3B29D2A6F__INCLUDED_)
  13. #define AFX_SAFERENTRYHASHPROPERTYPAGE_H__9F1BE911_6A3E_4BBA_8BE9_BFE3B29D2A6F__INCLUDED_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif // _MSC_VER > 1000
  17. // SaferEntryHashPropertyPage.h : header file
  18. //
  19. #include "SaferEntry.h"
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CSaferEntryHashPropertyPage dialog
  22. class CCertMgrComponentData; // forward declaration
  23. class CSaferEntryHashPropertyPage : public CHelpPropertyPage
  24. {
  25. // Construction
  26. public:
  27. CSaferEntryHashPropertyPage(
  28. CSaferEntry& rSaferEntry,
  29. LONG_PTR lNotifyHandle,
  30. LPDATAOBJECT pDataObject,
  31. bool bReadOnly,
  32. CCertMgrComponentData* pCompData,
  33. bool bIsMachine);
  34. ~CSaferEntryHashPropertyPage();
  35. // Dialog Data
  36. //{{AFX_DATA(CSaferEntryHashPropertyPage)
  37. enum { IDD = IDD_SAFER_ENTRY_HASH };
  38. CEdit m_hashFileDetailsEdit;
  39. CEdit m_descriptionEdit;
  40. CComboBox m_securityLevelCombo;
  41. //}}AFX_DATA
  42. // Overrides
  43. // ClassWizard generate virtual function overrides
  44. //{{AFX_VIRTUAL(CSaferEntryHashPropertyPage)
  45. public:
  46. virtual BOOL OnApply();
  47. protected:
  48. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. protected:
  52. // Generated message map functions
  53. //{{AFX_MSG(CSaferEntryHashPropertyPage)
  54. virtual BOOL OnInitDialog();
  55. afx_msg void OnHashEntryBrowse();
  56. afx_msg void OnChangeHashEntryDescription();
  57. afx_msg void OnSelchangeHashEntrySecurityLevel();
  58. afx_msg void OnChangeHashHashedFilePath();
  59. afx_msg void OnSetfocusHashHashedFilePath();
  60. afx_msg void OnChangeHashEntryHashfileDetails();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. BOOL MyGetFileVersionInfo(LPTSTR lpszFilename, LPVOID *lpVersionInfo);
  64. CString BuildHashFileInfoString (PVOID szBuff);
  65. CString ConcatStrings (
  66. const CString& productName,
  67. const CString& description,
  68. const CString& companyName,
  69. const CString& fileName,
  70. const CString& fileVersion);
  71. bool CheckLengthAndTruncateToken (CString& token);
  72. virtual void DoContextHelp (HWND hWndControl);
  73. bool FormatMemBufToString (PWSTR *ppString, PBYTE pbData, DWORD cbData);
  74. bool ConvertStringToHash (PCWSTR pszString);
  75. void FormatAndDisplayHash ();
  76. private:
  77. CString m_szLastOpenedFile;
  78. CSaferEntry& m_rSaferEntry;
  79. bool m_bDirty;
  80. BYTE m_rgbFileHash[SAFER_MAX_HASH_SIZE];
  81. DWORD m_cbFileHash;
  82. __int64 m_nFileSize;
  83. LONG_PTR m_lNotifyHandle;
  84. LPDATAOBJECT m_pDataObject;
  85. const bool m_bReadOnly;
  86. bool m_bIsMachine;
  87. ALG_ID m_hashAlgid;
  88. bool m_bFirst;
  89. CCertMgrComponentData* m_pCompData;
  90. };
  91. //{{AFX_INSERT_LOCATION}}
  92. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  93. #endif // !defined(AFX_SAFERENTRYHASHPROPERTYPAGE_H__9F1BE911_6A3E_4BBA_8BE9_BFE3B29D2A6F__INCLUDED_)