FreeRDP
Loading...
Searching...
No Matches
sdl_common_utils.hpp
1
20#pragma once
21
22#include <cstdlib>
23#include <memory>
24
25#include <freerdp/settings_types.h>
26
27using CStringPtr = std::unique_ptr<char, decltype(std::free)*>;
28
29bool operator==(const MONITOR_ATTRIBUTES& l, const MONITOR_ATTRIBUTES& r);
30bool operator==(const rdpMonitor& l, const rdpMonitor& r);
31
33{
34 public:
35 explicit WinPREvent(bool initial = false);
36 WinPREvent(const WinPREvent& other) = delete;
37 WinPREvent(WinPREvent&& other) = delete;
38
39 WinPREvent& operator=(const WinPREvent& other) = delete;
40 WinPREvent& operator=(WinPREvent&& other) = delete;
41
43
44 void set();
45 void clear();
46 [[nodiscard]] bool isSet() const;
47
48 [[nodiscard]] HANDLE handle() const;
49
50 private:
51 HANDLE _handle;
52};
53
55{
56 public:
58 CriticalSection(const CriticalSection& other) = delete;
59 CriticalSection(CriticalSection&& other) = delete;
61
62 CriticalSection& operator=(const CriticalSection& other) = delete;
63 CriticalSection& operator=(const CriticalSection&& other) = delete;
64
65 void lock();
66 void unlock();
67
68 private:
69 CRITICAL_SECTION _section{};
70};