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.

65 lines
1.7 KiB

  1. // SetupClasses.h : Declaration of the CSetupClasses
  2. #ifndef __SETUPCLASSES_H_
  3. #define __SETUPCLASSES_H_
  4. #include "resource.h" // main symbols
  5. class CSetupClass;
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CSetupClasses
  8. class ATL_NO_VTABLE CSetupClasses :
  9. public CComObjectRootEx<CComSingleThreadModel>,
  10. public CComCoClass<CSetupClasses, &CLSID_SetupClasses>,
  11. public IDispatchImpl<ISetupClasses, &IID_ISetupClasses, &LIBID_DEVCON2Lib>
  12. {
  13. protected:
  14. CComPtr<IDeviceConsole> DeviceConsole;
  15. BSTR pMachine;
  16. CSetupClass** pSetupClasses;
  17. DWORD Count;
  18. DWORD ArraySize;
  19. public:
  20. CSetupClasses()
  21. {
  22. pMachine = NULL;
  23. pSetupClasses = NULL;
  24. Count = 0;
  25. ArraySize = 0;
  26. }
  27. ~CSetupClasses();
  28. DECLARE_REGISTRY_RESOURCEID(IDR_SETUPCLASSES)
  29. DECLARE_PROTECT_FINAL_CONSTRUCT()
  30. BEGIN_COM_MAP(CSetupClasses)
  31. COM_INTERFACE_ENTRY(ISetupClasses)
  32. COM_INTERFACE_ENTRY(IDispatch)
  33. END_COM_MAP()
  34. // ISetupClasses
  35. public:
  36. STDMETHOD(get_Machine)(/*[out, retval]*/ BSTR *pVal);
  37. STDMETHOD(Devices)(/*[in,optional]*/ VARIANT flags,/*[out,retval]*/ LPDISPATCH * pDevices);
  38. STDMETHOD(Remove)(/*[in]*/ VARIANT v);
  39. STDMETHOD(Add)(/*[in]*/ VARIANT ClassNames);
  40. STDMETHOD(get__NewEnum)(/*[out, retval]*/ IUnknown** ppUnk);
  41. STDMETHOD(Item)(/*[in]*/ long Index,/*[out, retval]*/ LPDISPATCH * ppVal);
  42. STDMETHOD(get_Count)(/*[out, retval]*/ long *pVal);
  43. //
  44. // helpers
  45. //
  46. BOOL IncreaseArraySize(DWORD strings);
  47. HRESULT AddGuid(GUID *pGuid);
  48. HRESULT AppendClass(LPCWSTR Filter);
  49. HRESULT Init(LPCWSTR Machine, IDeviceConsole * pDevCon);
  50. BOOL FindDuplicate(GUID *pGuid);
  51. HRESULT GetIndex(LPVARIANT Index,DWORD *pAt);
  52. HRESULT AllClasses();
  53. };
  54. #endif //__SETUPCLASSES_H_