mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[CPP][Analyzers] turn on warning 4189 (#21522)
* Turn on 4189 and fix code * changes from PR comments
This commit is contained in:
@@ -30,8 +30,6 @@ KeyboardHook::~KeyboardHook()
|
||||
void KeyboardHook::Start()
|
||||
{
|
||||
hookProc = gcnew HookProcDelegate(this, &KeyboardHook::HookProc);
|
||||
Process ^ curProcess = Process::GetCurrentProcess();
|
||||
ProcessModule ^ curModule = curProcess->MainModule;
|
||||
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||
const bool hookDisabled = IsDebuggerPresent();
|
||||
#else
|
||||
|
||||
@@ -425,7 +425,7 @@ void TwoWayPipeMessageIPC::TwoWayPipeMessageIPCImpl::start_named_pipe_server(HAN
|
||||
|
||||
if (token != NULL)
|
||||
{
|
||||
int err = change_pipe_security_allow_restricted_token(connect_pipe_handle, token);
|
||||
change_pipe_security_allow_restricted_token(connect_pipe_handle, token);
|
||||
}
|
||||
current_connect_pipe_handle = connect_pipe_handle;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace notifications
|
||||
}
|
||||
const auto now = timeutil::now();
|
||||
const size_t buf_size = sizeof(now);
|
||||
if (RegSetValueExW(key, nullptr, 0, REG_QWORD, reinterpret_cast<const BYTE*>(&now), sizeof(now)) != ERROR_SUCCESS)
|
||||
if (RegSetValueExW(key, nullptr, 0, REG_QWORD, reinterpret_cast<const BYTE*>(&now), buf_size) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(key);
|
||||
return false;
|
||||
|
||||
@@ -405,7 +405,7 @@ void notifications::update_toast_progress_bar(std::wstring_view tag, progress_ba
|
||||
map.Insert(L"progressTitle", params.progress_title);
|
||||
|
||||
NotificationData data(map);
|
||||
NotificationUpdateResult res = notifier.Update(data, tag, DEFAULT_TOAST_GROUP);
|
||||
notifier.Update(data, tag, DEFAULT_TOAST_GROUP);
|
||||
}
|
||||
|
||||
void notifications::remove_toasts_by_tag(std::wstring_view tag)
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace updating
|
||||
const bool architecture_matched = filename_lower.find(required_architecture) != std::wstring::npos;
|
||||
const bool filename_matched = filename_lower.find(required_filename_pattern) != std::wstring::npos;
|
||||
const bool asset_matched = extension_matched && architecture_matched && filename_matched;
|
||||
if (extension_matched && architecture_matched && filename_matched)
|
||||
if (asset_matched)
|
||||
{
|
||||
return std::make_pair(Uri{ asset.GetNamedString(L"browser_download_url") }, std::move(filename_lower));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user