Bug 1230910 Replace GetExceptionCode() with a constant choice of EXCEPTION_ACCESS_VIOLATION.
While MinGW appears to define the macro (mapping it to the function _exception_code) there is no definition of the function, so it results in a linker error.
MozReview-Commit-ID: E5qZSA2Hsff
--- a/security/sandbox/chromium/sandbox/win/src/sandbox_nt_util.cc
+++ b/security/sandbox/chromium/sandbox/win/src/sandbox_nt_util.cc
@@ -218,17 +218,17 @@ bool ValidParameter(void* buffer, size_t
return true;
}
NTSTATUS CopyData(void* destination, const void* source, size_t bytes) {
NTSTATUS ret = STATUS_SUCCESS;
__try1(ehandler) {
g_nt.memcpy(destination, source, bytes);
} __except1 {
- ret = GetExceptionCode();
+ ret = EXCEPTION_ACCESS_VIOLATION;//GetExceptionCode();
}
return ret;
}
NTSTATUS AllocAndGetFullPath(HANDLE root,
wchar_t* path,
wchar_t** full_path) {
if (!InitHeap())
@@ -278,17 +278,17 @@ NTSTATUS AllocAndGetFullPath(HANDLE root
off += 1;
ret = CopyData(off, path, wcslen(path) * sizeof(wchar_t));
if (!NT_SUCCESS(ret))
break;
off += wcslen(path);
*off = L'\0';
} while (false);
} __except1 {
- ret = GetExceptionCode();
+ ret = EXCEPTION_ACCESS_VIOLATION;//GetExceptionCode();
}
if (!NT_SUCCESS(ret)) {
if (*full_path) {
operator delete(*full_path, NT_ALLOC);
*full_path = NULL;
}
if (handle_name) {
@@ -335,17 +335,17 @@ NTSTATUS AllocAndCopyName(const OBJECT_A
if (attributes)
*attributes = in_object->Attributes;
if (root)
*root = in_object->RootDirectory;
ret = STATUS_SUCCESS;
} while (false);
} __except1 {
- ret = GetExceptionCode();
+ ret = EXCEPTION_ACCESS_VIOLATION;//GetExceptionCode();
}
if (!NT_SUCCESS(ret) && *out_name) {
operator delete(*out_name, NT_ALLOC);
*out_name = NULL;
}
return ret;