1 // Copyright (c) 2012 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.
5 #ifndef REMOTING_BASE_SCOPED_SC_HANDLE_WIN_H_
6 #define REMOTING_BASE_SCOPED_SC_HANDLE_WIN_H_
10 #include "base/win/scoped_handle.h"
14 class ScHandleTraits
{
16 typedef SC_HANDLE Handle
;
19 static bool CloseHandle(SC_HANDLE handle
) {
20 return ::CloseServiceHandle(handle
) != FALSE
;
23 // Returns true if the handle value is valid.
24 static bool IsHandleValid(SC_HANDLE handle
) {
25 return handle
!= NULL
;
28 // Returns NULL handle value.
29 static SC_HANDLE
NullHandle() {
34 DISALLOW_IMPLICIT_CONSTRUCTORS(ScHandleTraits
);
37 typedef base::win::GenericScopedHandle
<
38 ScHandleTraits
, base::win::DummyVerifierTraits
> ScopedScHandle
;
40 } // namespace remoting
42 #endif // REMOTING_BASE_SCOPED_SC_HANDLE_WIN_H_