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.

66 lines
1.3 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation
  2. //
  3. // File: NetworkAdapterConfig.h
  4. //
  5. // Synopsis: Declares a NetworkAdapterConfig
  6. // This object has the knowledge for installing
  7. // using WMI to retrieve network adapter information
  8. //
  9. // History: 02/16/2001 JeffJon Created
  10. #ifndef __CYS_NETWORKADAPTERCONFIG_H
  11. #define __CYS_NETWORKADAPTERCONFIG_H
  12. #include "NetworkInterface.h"
  13. class NetworkAdapterConfig
  14. {
  15. public:
  16. // Constructor
  17. NetworkAdapterConfig();
  18. // Destructor
  19. ~NetworkAdapterConfig();
  20. // Initializer
  21. HRESULT
  22. Initialize();
  23. // Pulic methods
  24. unsigned int
  25. GetNICCount() const;
  26. NetworkInterface
  27. GetNIC(unsigned int nicIndex);
  28. bool
  29. IsInitialized() const { return initialized; }
  30. protected:
  31. HRESULT
  32. GetWbemServices(SmartInterface<IWbemServices>& spWbemService);
  33. HRESULT
  34. ExecQuery(
  35. const String& classType,
  36. SmartInterface<IEnumWbemClassObject>& enumClassObject);
  37. void
  38. AddInterface(NetworkInterface* newInterface);
  39. private:
  40. bool initialized;
  41. unsigned int nicCount;
  42. std::vector<NetworkInterface*> networkInterfaceVector;
  43. SmartInterface<IWbemServices> wbemService;
  44. };
  45. #endif // __CYS_NETWORKADAPTERCONFIG_H