diff options
Diffstat (limited to 'chromium/base/win/scoped_devinfo.h')
-rw-r--r-- | chromium/base/win/scoped_devinfo.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chromium/base/win/scoped_devinfo.h b/chromium/base/win/scoped_devinfo.h new file mode 100644 index 00000000000..37a3a0f765a --- /dev/null +++ b/chromium/base/win/scoped_devinfo.h @@ -0,0 +1,24 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_WIN_SCOPED_DEVINFO_H_ +#define BASE_WIN_SCOPED_DEVINFO_H_ + +#include <setupapi.h> + +#include "base/scoped_generic.h" + +namespace base { +namespace win { + +struct DevInfoScopedTraits { + static HDEVINFO InvalidValue() { return INVALID_HANDLE_VALUE; } + static void Free(HDEVINFO h) { SetupDiDestroyDeviceInfoList(h); } +}; +using ScopedDevInfo = base::ScopedGeneric<HDEVINFO, DevInfoScopedTraits>; + +} // namespace win +} // namespace base + +#endif // BASE_WIN_SCOPED_DEVINFO_H_ |