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.

134 lines
3.4 KiB

  1. #ifndef _TESTWMI_H_INCLUDED
  2. #define _TESTWMI_H_INCLUDED
  3. #define _WIN32_DCOM
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <windows.h>
  7. #include <tchar.h>
  8. #include <wchar.h>
  9. #include <commctrl.h> // For common controls, e.g. Tree
  10. #include <objidl.h>
  11. #include <objbase.h>
  12. #include <ole2.h>
  13. #include <wbemcli.h>
  14. //
  15. // Resource editor generated header file.
  16. //
  17. #include "resource.h"
  18. //
  19. // Default namespace.
  20. //
  21. #define DEFAULT_NAMESPACE L"root\\wmi"
  22. #define ROOT_CLASS NULL
  23. typedef struct _PROPERTY_INFO {
  24. IWbemServices *pIWbemServices;
  25. IWbemClassObject *pInstance;
  26. LPTSTR lpszProperty;
  27. LPTSTR lpszType;
  28. LPVARIANT pvaValue;
  29. } PROPERTY_INFO, *LPPROPERTY_INFO;
  30. //
  31. // Function defined in testwmi.cpp
  32. //
  33. int APIENTRY WinMain (HINSTANCE hInst,
  34. HINSTANCE hPrevInstance,
  35. LPSTR lpCmdLine,
  36. int nCmdShow);
  37. INT_PTR CALLBACK MainDlgProc (HWND hwndDlg,
  38. UINT uMsg,
  39. WPARAM wParam,
  40. LPARAM lParam);
  41. INT_PTR CALLBACK DlgProcScalar (HWND hwndDlg,
  42. UINT uMsg,
  43. WPARAM wParam,
  44. LPARAM lParam);
  45. VOID ListDefaults (HWND hwndDlg);
  46. VOID ShowProperties (HWND hwndDlg,
  47. HWND hwndInstTree);
  48. VOID EditProperty (HWND hwndDlg,
  49. HWND hwndPropTree);
  50. BOOL ModifyProperty (HWND hwndDlg);
  51. BOOL DisplayArrayProperty (LPTSTR lpszProperty,
  52. VARIANT *pvaValue,
  53. HWND hwndDlg);
  54. HRESULT AddToList (HWND hwndDlg,
  55. VARIANT *pvaValue);
  56. VOID ModifyArrayProperty(HWND hwndDlg,
  57. LPPROPERTY_INFO pPropInfo);
  58. VOID RefreshOnClassSelection (HWND hwndDlg);
  59. LPTSTR GetSelectedClass (HWND hwndClassList);
  60. LPTSTR GetSelectedItem (HWND hwndTree);
  61. VOID InsertItem (HWND hwndTree,
  62. LPTSTR lpszItem);
  63. VOID PrintError (HRESULT hr,
  64. UINT uiLine,
  65. LPTSTR lpszFile,
  66. LPCTSTR lpFmt,
  67. ...);
  68. //
  69. // Functions defined in wmicode.c
  70. //
  71. IWbemServices *ConnectToNamespace (VOID);
  72. VOID EnumInstances (IWbemServices *pIWbemServices,
  73. LPTSTR lpszClass,
  74. HWND hwndInstTree);
  75. VOID EnumProperties (IWbemServices *pIWbemServices,
  76. LPTSTR lpszClass,
  77. LPTSTR lpszInstance,
  78. HWND hwndPropTree);
  79. IWbemClassObject *GetInstanceReference (IWbemServices *pIWbemServices,
  80. LPTSTR lpszClass,
  81. LPTSTR lpszInstance);
  82. BOOL IsInstance (IWbemClassObject *pInst,
  83. LPTSTR lpszInstance);
  84. BOOL GetPropertyValue (IWbemClassObject *pRef,
  85. LPTSTR lpszProperty,
  86. VARIANT *pvaPropertyValue,
  87. LPTSTR *lppszPropertyType);
  88. HRESULT UpdatePropertyValue (IWbemServices *pIWbemServices,
  89. IWbemClassObject *pInstance,
  90. LPTSTR lpszProperty,
  91. LPVARIANT pvaNewValue);
  92. BSTR StringToBstr (LPTSTR lpSrc,
  93. int nLenSrc);
  94. LPTSTR BstrToString (BSTR lpSrc,
  95. int nLenSrc);
  96. #endif // _TESTWMI_H_INCLUDED