Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: sandbox/win/src/handle_closer_agent.cc

Issue 11035012: Enable handle tracing in Canary, Dev, and all debug builds of Chrome (Windows only). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid single-thread race between _try and exception handling code. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698