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.

100 lines
3.6 KiB

  1. //+---------------------------------------------------------------------------
  2. /////////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Microsoft Windows
  5. // Copyright (C) Microsoft Corporation, 2000-2002.
  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 "SaferPropertyPage.h"
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CSaferEntryHashPropertyPage dialog
  22. class CSaferEntryHashPropertyPage : public CSaferPropertyPage
  23. {
  24. // Construction
  25. public:
  26. CSaferEntryHashPropertyPage(
  27. CSaferEntry& rSaferEntry,
  28. LONG_PTR lNotifyHandle,
  29. LPDATAOBJECT pDataObject,
  30. bool bReadOnly,
  31. CCertMgrComponentData* pCompData,
  32. bool bIsMachine,
  33. bool* pbObjectCreated = 0);
  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(PCWSTR lpszFilename, PVOID *lpVersionInfo);
  64. CString BuildHashFileInfoString (const 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. const CString& internalName);
  72. bool CheckLengthAndTruncateToken (CString& token);
  73. virtual void DoContextHelp (HWND hWndControl);
  74. bool FormatMemBufToString (PWSTR *ppString, PBYTE pbData, DWORD cbData);
  75. bool ConvertStringToHash (PCWSTR pszString);
  76. void FormatAndDisplayHash ();
  77. CString GetAlternateLanguageVersionInfo (PVOID pData, PCWSTR pszVersionField);
  78. bool FileIsDLL (const CString& szFilePath);
  79. private:
  80. CString m_szLastOpenedFile;
  81. BYTE m_rgbFileHash[SAFER_MAX_HASH_SIZE];
  82. DWORD m_cbFileHash;
  83. __int64 m_nFileSize;
  84. ALG_ID m_hashAlgid;
  85. bool m_bFirst;
  86. };
  87. //{{AFX_INSERT_LOCATION}}
  88. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  89. #endif // !defined(AFX_SAFERENTRYHASHPROPERTYPAGE_H__9F1BE911_6A3E_4BBA_8BE9_BFE3B29D2A6F__INCLUDED_)