Miscellaneous declarations for Windows.
More...
#include <chrono>
#include <filesystem>
#include <string>
#include <string_view>
#include <Windows.h>
#include <winnt.h>
Go to the source code of this file.
|
| 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) |
| | Write status details to the log.
|
| int64_t | platf::qpc_counter () |
| | Read the current Windows high-resolution performance counter.
|
| std::chrono::nanoseconds | platf::qpc_time_difference (int64_t performance_counter1, int64_t performance_counter2) |
| | Convert the difference between two QPC readings to nanoseconds.
|
| HDESK | platf::syncThreadDesktop () |
| | Synchronize thread desktop.
|
Miscellaneous declarations for Windows.
◆ 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_path | Path to the file to query. |
| version_str | Output parameter for version string in format "major.minor.build.revision". |
- Returns
- true if version info was successfully extracted, false otherwise.
◆ print_status()
| void platf::print_status |
( |
const std::string_view & | prefix, |
|
|
HRESULT | status ) |
Write status details to the log.
- Parameters
-
| prefix | Text prefix used when formatting the message. |
| status | Native status code returned by the platform API. |
◆ qpc_counter()
| int64_t platf::qpc_counter |
( |
| ) |
|
Read the current Windows high-resolution performance counter.
- Returns
- Raw QPC tick value from QueryPerformanceCounter.
◆ qpc_time_difference()
| std::chrono::nanoseconds platf::qpc_time_difference |
( |
int64_t | performance_counter1, |
|
|
int64_t | performance_counter2 ) |
Convert the difference between two QPC readings to nanoseconds.
- Parameters
-
| performance_counter1 | Newer performance-counter reading. |
| performance_counter2 | Older performance-counter reading. |
- Returns
- Duration represented by the difference between two QPC values.
◆ syncThreadDesktop()
| HDESK platf::syncThreadDesktop |
( |
| ) |
|
Synchronize thread desktop.
- Returns
- true when the thread desktop was synchronized successfully.