2016-04-19 16:08:25 +10:00
|
|
|
/*
|
2018-08-04 15:14:06 +10:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2016-04-19 16:08:25 +10:00
|
|
|
*
|
|
|
|
* Copyright 2016 Danny Robson <danny@nerdcruft.net>
|
|
|
|
*/
|
|
|
|
|
2018-08-27 14:16:27 +10:00
|
|
|
#include "windows.hpp"
|
2016-04-19 16:08:25 +10:00
|
|
|
|
2018-08-22 21:34:02 +10:00
|
|
|
#include "../posix/fd.hpp"
|
|
|
|
|
2018-08-05 14:42:02 +10:00
|
|
|
namespace cruft::win32 {
|
2016-04-19 16:08:25 +10:00
|
|
|
struct handle {
|
2016-04-27 17:01:45 +10:00
|
|
|
handle ();
|
2016-08-25 12:03:48 +10:00
|
|
|
explicit handle (HANDLE&&);
|
2016-04-19 16:08:25 +10:00
|
|
|
handle (handle&&);
|
|
|
|
handle (const handle&) = delete;
|
2018-08-22 21:34:02 +10:00
|
|
|
handle (posix::fd&&);
|
2016-04-19 16:08:25 +10:00
|
|
|
~handle ();
|
|
|
|
|
|
|
|
operator HANDLE& (void) &;
|
|
|
|
HANDLE& native (void) &;
|
|
|
|
const HANDLE& native (void) const &;
|
|
|
|
|
2016-04-27 17:01:45 +10:00
|
|
|
void reset (HANDLE);
|
|
|
|
void reset (handle&&);
|
|
|
|
|
2016-04-19 16:08:25 +10:00
|
|
|
static handle current_process (void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
HANDLE m_native;
|
|
|
|
};
|
2017-01-05 15:06:49 +11:00
|
|
|
}
|