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.

63 lines
1.5 KiB

  1. // DevicesEnum.h: Definition of the CDevicesEnum class
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_DEVICESENUM_H__F9048FCD_C525_4BDD_AB79_018DEE3B71E8__INCLUDED_)
  5. #define AFX_DEVICESENUM_H__F9048FCD_C525_4BDD_AB79_018DEE3B71E8__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "resource.h" // main symbols
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CDevicesEnum
  12. class CDevice;
  13. class ATL_NO_VTABLE CDevicesEnum :
  14. public IDevicesEnum,
  15. public CComObjectRootEx<CComSingleThreadModel>
  16. {
  17. protected:
  18. CDevice** pDevices;
  19. DWORD Count;
  20. DWORD Position;
  21. public:
  22. BOOL CopyDevices(CDevice **pArray,DWORD Count);
  23. CDevicesEnum() {
  24. pDevices = NULL;
  25. Count = 0;
  26. Position = 0;
  27. }
  28. ~CDevicesEnum();
  29. BEGIN_COM_MAP(CDevicesEnum)
  30. COM_INTERFACE_ENTRY(IEnumVARIANT)
  31. COM_INTERFACE_ENTRY(IDevicesEnum)
  32. END_COM_MAP()
  33. DECLARE_NOT_AGGREGATABLE(CDevicesEnum)
  34. // IDevicesEnum
  35. public:
  36. STDMETHOD(Next)(
  37. /*[in]*/ ULONG celt,
  38. /*[out, size_is(celt), length_is(*pCeltFetched)]*/ VARIANT * rgVar,
  39. /*[out]*/ ULONG * pCeltFetched
  40. );
  41. STDMETHOD(Skip)(
  42. /*[in]*/ ULONG celt
  43. );
  44. STDMETHOD(Reset)(
  45. );
  46. STDMETHOD(Clone)(
  47. /*[out]*/ IEnumVARIANT ** ppEnum
  48. );
  49. };
  50. #endif // !defined(AFX_DEVICESENUM_H__F9048FCD_C525_4BDD_AB79_018DEE3B71E8__INCLUDED_)