Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CWIN32Util Class Reference

#include <WIN32Util.h>

Public Member Functions

 CWIN32Util (void)
 
virtual ~CWIN32Util (void)
 

Static Public Member Functions

static char FirstDriveFromMask (ULONG unitmask)
 
static int GetDriveStatus (const std::string &strPath, bool bStatusEx=false)
 
static bool XBMCShellExecute (const std::string &strPath, bool bWaitForScriptExit=false)
 
static std::string GetResInfoString ()
 
static int GetDesktopColorDepth ()
 
static size_t GetSystemMemorySize ()
 
static std::string GetSystemPath ()
 
static std::string GetProfilePath (const bool platformDirectories)
 
static std::string UncToSmb (const std::string &strPath)
 
static std::string SmbToUnc (const std::string &strPath)
 
static bool AddExtraLongPathPrefix (std::wstring &path)
 
static bool RemoveExtraLongPathPrefix (std::wstring &path)
 
static std::wstring ConvertPathToWin32Form (const std::string &pathUtf8)
 
static std::wstring ConvertPathToWin32Form (const CURL &url)
 
static __time64_t fileTimeToTimeT (const __int64 ftimei64)
 
static __time64_t fileTimeToTimeT (const FILETIME &ftimeft)
 
static __time64_t fileTimeToTimeT (const LARGE_INTEGER &ftimeli)
 
static HRESULT ToggleTray (const char cDriveLetter='\0')
 
static HRESULT EjectTray (const char cDriveLetter='\0')
 
static HRESULT CloseTray (const char cDriveLetter='\0')
 
static BOOL IsCurrentUserLocalAdministrator ()
 
static void CropSource (CRect &src, CRect &dst, CRect target, UINT rotation=0)
 
static std::string WUSysMsg (DWORD dwError)
 
static bool SetThreadLocalLocale (bool enable=true)
 
static HDR_STATUS ToggleWindowsHDR (DXGI_MODE_DESC &modeDesc)
 
static HDR_STATUS GetWindowsHDRStatus ()
 
static bool GetSystemSdrWhiteLevel (const std::wstring &gdiDeviceName, float *sdrWhiteLevel)
 Retrieve from the system the max luminance of SDR content in HDR.
 
static void PlatformSyslog ()
 
static VideoDriverInfo GetVideoDriverInfo (const UINT vendorId, const std::wstring &driverDesc)
 
static std::wstring GetDisplayFriendlyName (const std::wstring &GdiDeviceName)
 
static bool SetThreadName (const HANDLE handle, const std::string &name)
 Set the thread name using SetThreadDescription when available.
 
static bool IsDriverVersionAtLeast (const std::string &version1, const std::string &version2)
 Compare two Windows driver versions (xx.xx.xx.xx string format)
 

Constructor & Destructor Documentation

◆ CWIN32Util()

CWIN32Util::CWIN32Util ( void )

◆ ~CWIN32Util()

CWIN32Util::~CWIN32Util ( void )
virtual

Member Function Documentation

◆ AddExtraLongPathPrefix()

bool CWIN32Util::AddExtraLongPathPrefix ( std::wstring & path)
static

◆ CloseTray()

HRESULT CWIN32Util::CloseTray ( const char cDriveLetter = '\0')
static

◆ ConvertPathToWin32Form() [1/2]

std::wstring CWIN32Util::ConvertPathToWin32Form ( const CURL & url)
static

◆ ConvertPathToWin32Form() [2/2]

std::wstring CWIN32Util::ConvertPathToWin32Form ( const std::string & pathUtf8)
static

◆ CropSource()

void CWIN32Util::CropSource ( CRect & src,
CRect & dst,
CRect target,
UINT rotation = 0 )
static

◆ EjectTray()

HRESULT CWIN32Util::EjectTray ( const char cDriveLetter = '\0')
static

◆ fileTimeToTimeT() [1/3]

static __time64_t CWIN32Util::fileTimeToTimeT ( const __int64 ftimei64)
inlinestatic

◆ fileTimeToTimeT() [2/3]

__time64_t CWIN32Util::fileTimeToTimeT ( const FILETIME & ftimeft)
static

◆ fileTimeToTimeT() [3/3]

__time64_t CWIN32Util::fileTimeToTimeT ( const LARGE_INTEGER & ftimeli)
static

◆ FirstDriveFromMask()

char CWIN32Util::FirstDriveFromMask ( ULONG unitmask)
static

◆ GetDesktopColorDepth()

int CWIN32Util::GetDesktopColorDepth ( )
static

◆ GetDisplayFriendlyName()

std::wstring CWIN32Util::GetDisplayFriendlyName ( const std::wstring & GdiDeviceName)
static

◆ GetDriveStatus()

int CWIN32Util::GetDriveStatus ( const std::string & strPath,
bool bStatusEx = false )
static

◆ GetProfilePath()

std::string CWIN32Util::GetProfilePath ( const bool platformDirectories)
static

◆ GetResInfoString()

std::string CWIN32Util::GetResInfoString ( )
static

◆ GetSystemMemorySize()

size_t CWIN32Util::GetSystemMemorySize ( )
static

◆ GetSystemPath()

std::string CWIN32Util::GetSystemPath ( )
static

◆ GetSystemSdrWhiteLevel()

bool CWIN32Util::GetSystemSdrWhiteLevel ( const std::wstring & gdiDeviceName,
float * sdrWhiteLevel )
static

Retrieve from the system the max luminance of SDR content in HDR.

Retrieve from the system the max luminance of SDR content in HDR. Note: always returns 80 nits when the screen is in SDR mode.

Parameters
gdiDeviceNameThe screen to retrieve the information for
sdrWhiteLevelMax luminance in nits, clamped to 10000
Returns
true if a value could be read from the system and copied to sdrWhiteLevel, false otherwise

◆ GetVideoDriverInfo()

VideoDriverInfo CWIN32Util::GetVideoDriverInfo ( const UINT vendorId,
const std::wstring & driverDesc )
static

◆ GetWindowsHDRStatus()

HDR_STATUS CWIN32Util::GetWindowsHDRStatus ( )
static

◆ IsCurrentUserLocalAdministrator()

BOOL CWIN32Util::IsCurrentUserLocalAdministrator ( )
static

◆ IsDriverVersionAtLeast()

bool CWIN32Util::IsDriverVersionAtLeast ( const std::string & version1,
const std::string & version2 )
static

Compare two Windows driver versions (xx.xx.xx.xx string format)

Parameters
version1First version to compare
version2Second version to compare
Returns
true when version1 is greater or equal to version2. Undefined results when the strings are not formatted properly.

◆ PlatformSyslog()

void CWIN32Util::PlatformSyslog ( )
static

◆ RemoveExtraLongPathPrefix()

bool CWIN32Util::RemoveExtraLongPathPrefix ( std::wstring & path)
static

◆ SetThreadLocalLocale()

bool CWIN32Util::SetThreadLocalLocale ( bool enable = true)
static

◆ SetThreadName()

bool CWIN32Util::SetThreadName ( const HANDLE handle,
const std::string & name )
static

Set the thread name using SetThreadDescription when available.

Parameters
handlehandle of the thread
namename of the thread
Returns
true if the name was successfully set, false otherwise (API not supported or API failure)

◆ SmbToUnc()

std::string CWIN32Util::SmbToUnc ( const std::string & strPath)
static

◆ ToggleTray()

HRESULT CWIN32Util::ToggleTray ( const char cDriveLetter = '\0')
static

◆ ToggleWindowsHDR()

HDR_STATUS CWIN32Util::ToggleWindowsHDR ( DXGI_MODE_DESC & modeDesc)
static

◆ UncToSmb()

std::string CWIN32Util::UncToSmb ( const std::string & strPath)
static

◆ WUSysMsg()

std::string CWIN32Util::WUSysMsg ( DWORD dwError)
static

◆ XBMCShellExecute()

bool CWIN32Util::XBMCShellExecute ( const std::string & strPath,
bool bWaitForScriptExit = false )
static
Todo
Pause music and video playback

The documentation for this class was generated from the following files: