| Index: base/win/scoped_device_info_list.h
|
| diff --git a/base/win/scoped_device_info_list.h b/base/win/scoped_device_info_list.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b8ad1fe54370bb6ae3751e3afa3ceaf9bbc56dd4
|
| --- /dev/null
|
| +++ b/base/win/scoped_device_info_list.h
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2015 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_DEVICE_INFO_LIST_H_
|
| +#define BASE_WIN_SCOPED_DEVICE_INFO_LIST_H_
|
| +
|
| +#include <windows.h>
|
| +#include <setupapi.h>
|
| +
|
| +#include "base/win/scoped_handle.h"
|
| +
|
| +namespace base {
|
| +namespace win {
|
| +
|
| +// Traits for HDEVINFO that properly destroys it.
|
| +struct DeviceInfoListTraits {
|
| + typedef HDEVINFO Handle;
|
| +
|
| + static void CloseHandle(HDEVINFO handle) {
|
| + SetupDiDestroyDeviceInfoList(handle);
|
| + }
|
| +
|
| + static bool IsHandleValid(HDEVINFO handle) {
|
| + return handle != INVALID_HANDLE_VALUE;
|
| + }
|
| +
|
| + static HDEVINFO NullHandle() { return INVALID_HANDLE_VALUE; }
|
| +};
|
| +
|
| +typedef base::win::GenericScopedHandle<DeviceInfoListTraits,
|
| + base::win::DummyVerifierTraits>
|
| + ScopedDeviceInfoList;
|
| +
|
| +} // namespace win
|
| +} // namespace base
|
| +
|
| +#endif // BASE_WIN_SCOPED_DEVICE_INFO_LIST_H_
|
|
|