Home | History | Annotate | Download | only in win

Lines Matching refs:handle

34 //   - IsValid() method can tolerate multiple invalid handle values such as NULL
36 // - Receive() method allows to receive a handle value from a function that
37 // takes a raw handle pointer only.
43 typedef typename Traits::Handle Handle;
46 // a pointer, and allow proper tracking of the handle.
54 operator Handle*() { return &handle_; }
57 Handle handle_;
63 explicit GenericScopedHandle(Handle handle) : handle_(Traits::NullHandle()) {
64 Set(handle);
88 void Set(Handle handle) {
89 if (handle_ != handle) {
92 if (Traits::IsHandleValid(handle)) {
93 handle_ = handle;
94 Verifier::StartTracking(handle, this, BASE_WIN_GET_CALLER,
100 Handle Get() const {
104 operator Handle() const {
109 // a destination handle, like so:
110 // void CreateRequiredHandle(Handle* out_handle);
114 DCHECK(!Traits::IsHandleValid(handle_)) << "Handle must be NULL";
119 Handle Take() {
120 Handle temp = handle_;
129 // Explicitly closes the owned handle.
143 Handle handle_;
151 typedef HANDLE Handle;
153 // Closes the handle.
154 static bool CloseHandle(HANDLE handle) {
155 return ::CloseHandle(handle) != FALSE;
158 // Returns true if the handle value is valid.
159 static bool IsHandleValid(HANDLE handle) {
160 return handle != NULL && handle != INVALID_HANDLE_VALUE;
163 // Returns NULL handle value.
164 static HANDLE NullHandle() {
175 typedef HANDLE Handle;
177 static void StartTracking(HANDLE handle, const void* owner,
179 static void StopTracking(HANDLE handle, const void* owner,
189 typedef HANDLE Handle;
191 static void StartTracking(HANDLE handle, const void* owner,
193 static void StopTracking(HANDLE handle, const void* owner,