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.

95 lines
2.7 KiB

  1. /********************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. pchealth.H
  5. Abstract:
  6. Main header file for all PCHealth WMI providers
  7. Contains all defines and includes used elsewhere
  8. Revision History:
  9. Ghim-Sim Chua (gschua) 04/27/99
  10. - Created
  11. Ghim-Sim Chua (gschua) 05/02/99
  12. - Added GetWbemServices & CopyProperty
  13. Kalyani Narlanka (kalyanin) 05/10/99
  14. - Added #define INCL_WINSOCK_API_TYPEDEFS
  15. - Included <winsock2.>
  16. ********************************************************************/
  17. #define INCL_WINSOCK_API_TYPEDEFS 1
  18. #include <winsock2.h>
  19. #include <sys/stat.h>
  20. #ifndef _pchdef_h_
  21. #define _pchdef_h_
  22. #ifdef _WIN32_WINNT
  23. #undef _WIN32_WINNT
  24. #endif
  25. #include <fwcommon.h> // This must be the first include.
  26. #include <provider.h>
  27. #include <atlbase.h>
  28. #include "dbgtrace.h"
  29. #include "traceids.h"
  30. #include "smartptr.h"
  31. //
  32. // Namespaces that we'll be working with
  33. //
  34. #define PCH_NAMESPACE L"root\\pchealth"
  35. #define CIM_NAMESPACE L"root\\cimv2"
  36. // #include <winsock2.h>
  37. //
  38. // Global Variables
  39. //
  40. extern CComPtr<IWbemServices> g_pWbemServices;
  41. //
  42. // Utility functions
  43. //
  44. HRESULT ExecWQLQuery(IEnumWbemClassObject **ppEnumInst, BSTR bstrQuery);
  45. HRESULT GetWbemServices(IWbemServices **ppServices);
  46. HRESULT CopyProperty(IWbemClassObject * pFrom, LPCWSTR szFrom, CInstance * pTo, LPCWSTR szTo);
  47. HRESULT GetCIMDataFile(BSTR bstrFile, IWbemClassObject ** ppFileObject, BOOL fHasDoubleSlashes = FALSE);
  48. BOOL getCompletePath(CComBSTR bstrFileName, CComBSTR &bstrFileWithPathName);
  49. int DelimitedStringToArray(LPWSTR strDelimitedString, LPTSTR strDelimiter, LPTSTR apstrArray[], int iMaxArraySize);
  50. int DelimitedStringToArray(LPTSTR strDelimitedString, LPTSTR strDelimiter, LPTSTR apstrArray[], int iMaxArraySize);
  51. //-----------------------------------------------------------------------------
  52. // This class is useful for retrieving information about a specific file. It
  53. // uses the version resource code from Dr. Watson. To use it, create an
  54. // instance of the class, and use the QueryFile method to query information
  55. // about a specific file. Then use the Get* access functions to get the
  56. // values describing the information.
  57. //-----------------------------------------------------------------------------
  58. struct FILEVERSION;
  59. class CFileVersionInfo
  60. {
  61. public:
  62. CFileVersionInfo();
  63. ~CFileVersionInfo();
  64. HRESULT QueryFile(LPCSTR szFile, BOOL fHasDoubleBackslashes = FALSE);
  65. HRESULT QueryFile(LPCWSTR szFile, BOOL fHasDoubleBackslashes = FALSE);
  66. LPCTSTR GetVersion();
  67. LPCTSTR GetDescription();
  68. LPCTSTR GetCompany();
  69. LPCTSTR GetProduct();
  70. private:
  71. FILEVERSION * m_pfv;
  72. };
  73. #endif // _pchdef_h_