scoped_devinfo.h 649 B

123456789101112131415161718192021222324
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_WIN_SCOPED_DEVINFO_H_
  5. #define BASE_WIN_SCOPED_DEVINFO_H_
  6. #include <setupapi.h>
  7. #include "base/scoped_generic.h"
  8. namespace base {
  9. namespace win {
  10. struct DevInfoScopedTraits {
  11. static HDEVINFO InvalidValue() { return INVALID_HANDLE_VALUE; }
  12. static void Free(HDEVINFO h) { SetupDiDestroyDeviceInfoList(h); }
  13. };
  14. using ScopedDevInfo = base::ScopedGeneric<HDEVINFO, DevInfoScopedTraits>;
  15. } // namespace win
  16. } // namespace base
  17. #endif // BASE_WIN_SCOPED_DEVINFO_H_