mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-03-19 01:01:49 +08:00
Replace magic numbers with named constants
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#define DOPUS_CLASS L"DOpus.ParentWindow"
|
||||
#define DOPUS_NAME L"Directory Opus"
|
||||
#define MSGWINDOW_CLASS L"QuickLook.Native.DOpus.MsgWindow"
|
||||
#define MAX_BUFFER_SIZE (10 * 1024 * 1024) // 10MB limit for IPC data
|
||||
|
||||
HWND hMsgWnd;
|
||||
HANDLE hGetResultEvent;
|
||||
@@ -137,7 +138,7 @@ LRESULT CALLBACK DOpus::msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
{
|
||||
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
|
||||
// Validate COPYDATASTRUCT and enforce reasonable size limit (10MB)
|
||||
if (cds == nullptr || cds->lpData == nullptr || cds->cbData == 0 || cds->cbData > 10 * 1024 * 1024)
|
||||
if (cds == nullptr || cds->lpData == nullptr || cds->cbData == 0 || cds->cbData > MAX_BUFFER_SIZE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ LRESULT CALLBACK MultiCommander::msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wPar
|
||||
|
||||
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
|
||||
// Validate COPYDATASTRUCT and enforce reasonable size limit (10MB)
|
||||
if (cds == nullptr || cds->lpData == nullptr || cds->cbData == 0 || cds->cbData > 10 * 1024 * 1024)
|
||||
if (cds == nullptr || cds->lpData == nullptr || cds->cbData == 0 || cds->cbData > MAX_BUFFER_SIZE)
|
||||
{
|
||||
SetEvent(hGetResultEvent);
|
||||
return 0;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#define MULTICMD_CPF_GETCURITEMFULL 0x00000010L // Get full path of current item (file or folder) in focus
|
||||
#define MULTICMD_CPF_SOURCE 0x00000400L // Go to the new path in the source panel side
|
||||
#define MAX_BUFFER_SIZE (10 * 1024 * 1024) // 10MB limit for IPC data
|
||||
|
||||
#define MULTICMD_CLASS L"MultiCommander MainWnd"
|
||||
#define MULTICMD_MSGWINDOW_CLASS L"QuickLook.Native.MultiCmd.MsgWindow"
|
||||
|
||||
1
_codeql_detected_source_root
Symbolic link
1
_codeql_detected_source_root
Symbolic link
@@ -0,0 +1 @@
|
||||
.
|
||||
Reference in New Issue
Block a user