if in Vs2019 release Od/O1 will get the following error:
Severity Code Description Project File Line Suppression State
error LNK2019 Unresolved external symbol _enable, referenced in function "long __cdecl ReadR3MemoryToR3ByCR3(void *,void *,unsigned __int64,void *)"
Severity Code Description Project File Line Suppression State
error LNK2019 Unresolved external symbol _disable, referenced in function "long __cdecl ReadR3MemoryToR3ByCR3(void *,void *,unsigned __int64,void *)"
void foo()
{
_disable();
__writecr3(targetCR3);
if (!MmIsAddressValid(readAddr))
{
__writecr3(currentCR3);
_enable();
KeLeaveCriticalRegion();
ExFreePoolWithTag(tempBuffer, 'buFF');
status = STATUS_INVALID_PARAMETER_2;
break;
}
memcpy(tempBuffer, readAddr, readSize);
__writecr3(currentCR3);
_enable();
}
But under vs2019, this does not happen with debug and release 02.
Question: why is this