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.

54 lines
1.3 KiB

  1. // Drivers.h : Declaration of the CDriverPackages
  2. #ifndef __DRIVERS_H_
  3. #define __DRIVERS_H_
  4. #include "resource.h" // main symbols
  5. class CDriverPackage;
  6. class CDrvSearchSet;
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CDriverPackages
  9. class ATL_NO_VTABLE CDriverPackages :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. public IDispatchImpl<IDriverPackages, &IID_IDriverPackages, &LIBID_DEVCON2Lib>
  12. {
  13. public:
  14. CDrvSearchSet *pDrvSearchSet;
  15. CDriverPackage **pDrivers;
  16. ULONG Count;
  17. ULONG ArraySize;
  18. public:
  19. CDriverPackages()
  20. {
  21. pDrvSearchSet = NULL;
  22. pDrivers = NULL;
  23. Count = 0;
  24. ArraySize = 0;
  25. }
  26. ~CDriverPackages();
  27. DECLARE_PROTECT_FINAL_CONSTRUCT()
  28. BEGIN_COM_MAP(CDriverPackages)
  29. COM_INTERFACE_ENTRY(IDriverPackages)
  30. COM_INTERFACE_ENTRY(IDispatch)
  31. END_COM_MAP()
  32. // IDriverPackages
  33. public:
  34. STDMETHOD(BestDriver)(LPDISPATCH *ppVal);
  35. STDMETHOD(get__NewEnum)(/*[out, retval]*/ IUnknown** ppUnk);
  36. STDMETHOD(Item)(/*[in]*/ long Index,/*[out, retval]*/ LPDISPATCH * ppVal);
  37. STDMETHOD(get_Count)(/*[out, retval]*/ long *pVal);
  38. //
  39. // helpers
  40. //
  41. HRESULT InternalAdd(CDriverPackage *pDriver);
  42. HRESULT Init(CDrvSearchSet *pSet);
  43. BOOL IncreaseArraySize(DWORD add);
  44. };
  45. #endif //__DRIVERS_H_