I am using _set_invalid_parameter_handler to override the default behaviour of the program when a CRT function gets an invalid parameter, which is to crash with 0xc0000417 (STATUS_INVALID_CRUNTIME_PARAMETER).
This is my handler:
void my_invalid_parameter_handler(
const wchar_t * expression,
const wchar_t * function,
const wchar_t * file,
unsigned int line,
uintptr_t pReserved
)
{
Log(L"Invalid parameter detected");
Log(L"expression= %s", expression);
Log(L"function= %s", function);
Log(L"file= %s", file);
Log(L"line= %d", line);
Log(L"pReserved= %p", pReserved);
}
I want to log the information and send an error report. In the Debug build I get useful information with the parameters, but in the Release build all the parameters are NULL, which is not very useful. Is there any way to add useful information in the Release builds as well?