mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[Analyzers][CPP]Changes to fix warning 26493 on PowerToys/tools (#23674)
This commit is contained in:
@@ -57,7 +57,7 @@ namespace
|
||||
if (ERROR_INSUFFICIENT_BUFFER == (status = GetLastError()))
|
||||
{
|
||||
dwBufferSize = dwBufferUsed;
|
||||
pRenderedContent = (LPWSTR)malloc(dwBufferSize);
|
||||
pRenderedContent = static_cast<LPWSTR>(malloc(dwBufferSize));
|
||||
if (pRenderedContent)
|
||||
{
|
||||
EvtRender(NULL, hEvent, EvtRenderEventXml, dwBufferSize, pRenderedContent, &dwBufferUsed, &dwPropertyCount);
|
||||
|
||||
@@ -27,7 +27,7 @@ wstring GetVersion(path filePath)
|
||||
{
|
||||
if (size)
|
||||
{
|
||||
VS_FIXEDFILEINFO* verInfo = (VS_FIXEDFILEINFO*)lpBuffer;
|
||||
VS_FIXEDFILEINFO* verInfo = static_cast<VS_FIXEDFILEINFO*>(lpBuffer);
|
||||
if (verInfo->dwSignature == 0xfeef04bd)
|
||||
{
|
||||
version =
|
||||
|
||||
@@ -166,7 +166,7 @@ void ReportWindowsVersion(const filesystem::path& tmpDir)
|
||||
{
|
||||
NTSTATUS(WINAPI * RtlGetVersion)
|
||||
(LPOSVERSIONINFOEXW) = nullptr;
|
||||
*(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
|
||||
*reinterpret_cast<FARPROC*>(& RtlGetVersion) = GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
|
||||
if (RtlGetVersion)
|
||||
{
|
||||
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace
|
||||
stream << achValue;
|
||||
}
|
||||
|
||||
stream << " > " << (LPCTSTR)value << "\n";
|
||||
stream << " > " << reinterpret_cast<LPCTSTR>(value) << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace
|
||||
};
|
||||
|
||||
auto callback = [](HMONITOR monitor, HDC, RECT*, LPARAM prm) -> BOOL {
|
||||
std::wostream& os = *((capture*)prm)->os;
|
||||
std::wostream& os = *(reinterpret_cast<capture*>(prm))->os;
|
||||
MONITORINFOEX mi;
|
||||
mi.cbSize = sizeof(mi);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace
|
||||
|
||||
capture c;
|
||||
c.os = &os;
|
||||
if (EnumDisplayMonitors(nullptr, nullptr, callback, (LPARAM)&c))
|
||||
if (EnumDisplayMonitors(nullptr, nullptr, callback, reinterpret_cast<LPARAM>(& c)))
|
||||
{
|
||||
os << "EnumDisplayMonitors OK\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user