[CodeQuality]Fix C++ static analyzer findings (#29745)

* [PVS] Fix static analyzer findings

* f: fix error handling

* f: more improvements

* Update src/modules/FileLocksmith/FileLocksmithLibInterop/NtdllExtensions.cpp
This commit is contained in:
Andrey Nekrasov
2023-11-15 17:38:44 +01:00
committed by GitHub
parent 4ebc4cbc0d
commit 5ab83c6ad2
10 changed files with 19 additions and 27 deletions

View File

@@ -12,8 +12,7 @@ namespace KeyboardEventHandlers
// Num Lock's key state is applied before it is intercepted by low level keyboard hooks, so we have to manually set back the state when we suppress the key. This is done by sending an additional key up, key down set of messages.
// We need 2 key events because after Num Lock is suppressed, key up to release num lock key and key down to revert the num lock state
int key_count = 2;
LPINPUT keyEventList = new INPUT[size_t(key_count)]();
memset(keyEventList, 0, sizeof(keyEventList));
LPINPUT keyEventList = new INPUT[size_t(key_count)]{};
// Use the suppress flag to ensure these are not intercepted by any remapped keys or shortcuts
Helpers::SetKeyEvent(keyEventList, 0, INPUT_KEYBOARD, VK_NUMLOCK, KEYEVENTF_KEYUP, KeyboardManagerConstants::KEYBOARDMANAGER_SUPPRESS_FLAG);