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.

46 lines
1.6 KiB

  1. //-----------------------------------------------------------------------------
  2. // This class is useful for retrieving information about a specific file. It
  3. // uses the version resource code from Dr. Watson. To use it, create an
  4. // instance of the class, and use the QueryFile method to query information
  5. // about a specific file. Then use the Get* access functions to get the
  6. // values describing the information.
  7. //-----------------------------------------------------------------------------
  8. class CFileVersionInfo
  9. {
  10. public:
  11. //-------------------------------------------------------------------------
  12. // Local structures and macros used to retrieve the file version information.
  13. // These are necessary to use to the Dr. Watson codebase without too much
  14. // modification.
  15. //-------------------------------------------------------------------------
  16. struct VERSIONSTATE
  17. {
  18. PVOID pvData;
  19. TCHAR tszLang[9];
  20. TCHAR tszLang2[9];
  21. };
  22. struct FILEVERSION
  23. {
  24. TCHAR tszFileVersion[32]; /* File version */
  25. TCHAR tszDesc[MAX_PATH]; /* File description */
  26. TCHAR tszCompany[MAX_PATH]; /* Manufacturer */
  27. TCHAR tszProduct[MAX_PATH]; /* Enclosing product */
  28. };
  29. CFileVersionInfo();
  30. ~CFileVersionInfo();
  31. HRESULT QueryFile(LPCSTR szFile, BOOL fHasDoubleBackslashes = FALSE);
  32. HRESULT QueryFile(LPCWSTR szFile, BOOL fHasDoubleBackslashes = FALSE);
  33. LPCTSTR GetVersion();
  34. LPCTSTR GetDescription();
  35. LPCTSTR GetCompany();
  36. LPCTSTR GetProduct();
  37. private:
  38. FILEVERSION * m_pfv;
  39. };