Sunshine master
Self-hosted game stream host for Moonlight.
misc.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <chrono>
9#include <filesystem>
10#include <string>
11#include <string_view>
12
13// platform includes
14#include <Windows.h>
15#include <winnt.h>
16
17namespace platf {
24 void print_status(const std::string_view &prefix, HRESULT status);
30 HDESK syncThreadDesktop();
31
37 int64_t qpc_counter();
38
46 std::chrono::nanoseconds qpc_time_difference(int64_t performance_counter1, int64_t performance_counter2);
47
54 bool getFileVersionInfo(const std::filesystem::path &file_path, std::string &version_str);
55} // namespace platf
int64_t qpc_counter()
Read the current Windows high-resolution performance counter.
Definition misc.cpp:1764
bool getFileVersionInfo(const std::filesystem::path &file_path, std::string &version_str)
Get file version information from a Windows executable or driver file.
Definition misc.cpp:1852
std::chrono::nanoseconds qpc_time_difference(int64_t performance_counter1, int64_t performance_counter2)
Convert the difference between two QPC readings to nanoseconds.
Definition misc.cpp:1775
HDESK syncThreadDesktop()
Synchronize thread desktop.
Definition misc.cpp:224
void print_status(const std::string_view &prefix, HRESULT status)
Write status details to the log.
Definition misc.cpp:246