mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Improve Windows page fault handler.
- Re-throw exception if not access violation exception. - If pointer is not within known pointers also re-throw. Change-Id: I01461f550994e32c9e8757b0344e70f2195612fb Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
093bc4da9c
commit
d4571d685a
@@ -18,10 +18,14 @@ std::function<LONG(struct _EXCEPTION_POINTERS *exceptionInfo)> PageFaultManagerW
|
||||
|
||||
PageFaultManagerWindows::PageFaultManagerWindows() {
|
||||
pageFaultHandler = [&](struct _EXCEPTION_POINTERS *exceptionInfo) {
|
||||
if (exceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && !this->verifyPageFault(reinterpret_cast<void *>(exceptionInfo->ExceptionRecord->ExceptionInformation[1]))) {
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
if (exceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
|
||||
if (this->verifyPageFault(reinterpret_cast<void *>(exceptionInfo->ExceptionRecord->ExceptionInformation[1]))) {
|
||||
//this is our fault that we serviced, continue app execution
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
}
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
//not our exception
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
};
|
||||
|
||||
previousHandler = AddVectoredExceptionHandler(1, pageFaultHandlerWrapper);
|
||||
|
||||
Reference in New Issue
Block a user