From 16bd095b0c37ce3cccbc89494c4d71e70685f640 Mon Sep 17 00:00:00 2001 From: "jschuh@chromium.org" Date: Thu, 11 Aug 2011 22:50:34 +0000 Subject: Handle STATUS_BUFFER_OVERFLOW return value from NtQueryObject(). BUG=91386 TEST=None Review URL: http://codereview.chromium.org/7542026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96478 0039d316-1c4b-4281-b951-d872f2087c98 --- sandbox/src/handle_closer.cc | 3 ++- sandbox/src/handle_closer_agent.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'sandbox') diff --git a/sandbox/src/handle_closer.cc b/sandbox/src/handle_closer.cc index a9778eb..d79f2c1 100644 --- a/sandbox/src/handle_closer.cc +++ b/sandbox/src/handle_closer.cc @@ -187,7 +187,8 @@ bool GetHandleName(HANDLE handle, string16* handle_name) { name.reset(reinterpret_cast(new BYTE[size])); result = QueryObject(handle, ObjectNameInformation, name.get(), size, &size); - } while (result == STATUS_INFO_LENGTH_MISMATCH); + } while (result == STATUS_INFO_LENGTH_MISMATCH || + result == STATUS_BUFFER_OVERFLOW); if (NT_SUCCESS(result) && name->Buffer && name->Length) handle_name->assign(name->Buffer, name->Length / sizeof(wchar_t)); diff --git a/sandbox/src/handle_closer_agent.cc b/sandbox/src/handle_closer_agent.cc index b640c08..38c174e1 100644 --- a/sandbox/src/handle_closer_agent.cc +++ b/sandbox/src/handle_closer_agent.cc @@ -82,7 +82,8 @@ bool HandleCloserAgent::CloseHandles() { // Get the type name, reusing the buffer. ULONG size = static_cast(type_info_buffer.size()); rc = QueryObject(handle, ObjectTypeInformation, type_info, size, &size); - while (rc == STATUS_INFO_LENGTH_MISMATCH) { + while (rc == STATUS_INFO_LENGTH_MISMATCH || + rc == STATUS_BUFFER_OVERFLOW) { type_info_buffer.resize(size + sizeof(wchar_t)); type_info = reinterpret_cast( &(type_info_buffer[0])); -- cgit v1.1