Skip to content

Commit

Permalink
Provide some generic debug information for invalid parameters in some…
Browse files Browse the repository at this point in the history
… cases
  • Loading branch information
brianferguson committed Jul 24, 2024
1 parent 8a37186 commit da6b0a2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Library/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,17 @@ HICON GetIconBySize(UINT id, int size)

void RmNullCRTInvalidParameterHandler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved)
{
// Do nothing.

#ifdef _DEBUG
if (*function && *file)
{
LogErrorF(L"Invalid parameter detected. Function: \"%s\" File: \"%s:%d\" Expression: \"%s\"", function, file, line, expression);
return;
}
#endif

if (GetRainmeter().GetDebug())
{
LogError(L"Invalid parameter detected");
}
}

0 comments on commit da6b0a2

Please sign in to comment.