Sunshine v2026.319.132152
Self-hosted game stream host for Moonlight.
misc.h File Reference

Miscellaneous declarations for Windows. More...

#include <chrono>
#include <filesystem>
#include <string>
#include <string_view>
#include <Windows.h>
#include <winnt.h>
Include dependency graph for misc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool platf::getFileVersionInfo (const std::filesystem::path &file_path, std::string &version_str)
 Get file version information from a Windows executable or driver file.
 
void platf::print_status (const std::string_view &prefix, HRESULT status)
 
int64_t platf::qpc_counter ()
 
std::chrono::nanoseconds platf::qpc_time_difference (int64_t performance_counter1, int64_t performance_counter2)
 
HDESK platf::syncThreadDesktop ()
 

Detailed Description

Miscellaneous declarations for Windows.

Function Documentation

◆ getFileVersionInfo()

bool platf::getFileVersionInfo ( const std::filesystem::path & file_path,
std::string & version_str )

Get file version information from a Windows executable or driver file.

Parameters
file_pathPath to the file to query.
version_strOutput parameter for version string in format "major.minor.build.revision".
Returns
true if version info was successfully extracted, false otherwise.