Index: sandbox/win/src/handle_closer_agent.cc |
diff --git a/sandbox/win/src/handle_closer_agent.cc b/sandbox/win/src/handle_closer_agent.cc |
index be262e8d158c192407c89f78387ff8f87df0e8b3..b7e872c7112bbd9bde8367651e5c79f2c1bc89e3 100644 |
--- a/sandbox/win/src/handle_closer_agent.cc |
+++ b/sandbox/win/src/handle_closer_agent.cc |
@@ -10,6 +10,12 @@ |
namespace { |
+int QueryObjectTypeInformationFilter(EXCEPTION_POINTERS* exception_pointers, |
+ NTSTATUS* exception_code) { |
+ *exception_code = exception_pointers->ExceptionRecord->ExceptionCode; |
+ return EXCEPTION_EXECUTE_HANDLER; |
rvargas (doing something else)
2012/10/03 03:01:16
I'm a little concerned here about the actual handl
|
+} |
+ |
// Returns type infomation for an NT object. This routine is expected to be |
// called for invalid handles so it catches STATUS_INVALID_HANDLE exceptions |
// that can be generated when handle tracing is enabled. |
@@ -20,14 +26,13 @@ NTSTATUS QueryObjectTypeInformation(HANDLE handle, |
if (!QueryObject) |
ResolveNTFunctionPtr("NtQueryObject", &QueryObject); |
- NTSTATUS status = STATUS_UNSUCCESSFUL; |
+ NTSTATUS exception_code = STATUS_UNSUCCESSFUL; |
rvargas (doing something else)
2012/10/03 03:01:16
I would prefer setting exeption_code, but I don't
|
__try { |
- status = QueryObject(handle, ObjectTypeInformation, buffer, *size, size); |
- } __except(GetExceptionCode() == STATUS_INVALID_HANDLE ? |
- EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { |
- status = STATUS_INVALID_HANDLE; |
+ return QueryObject(handle, ObjectTypeInformation, buffer, *size, size); |
+ } __except(QueryObjectTypeInformationFilter(GetExceptionInformation(), |
+ &exception_code)) { |
cpu_(ooo_6.6-7.5)
2012/10/02 19:21:37
can't you call GetExceptionCode() from the body of
alexeypa (please no reviews)
2012/10/02 19:23:22
GetExceptionCode() can only be called from the fil
|
+ return exception_code; |
} |
- return status; |
} |
} // namespace |