summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/src/handle_closer.cc3
-rw-r--r--sandbox/src/handle_closer_agent.cc3
2 files changed, 4 insertions, 2 deletions
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<UNICODE_STRING*>(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<ULONG>(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<OBJECT_TYPE_INFORMATION*>(
&(type_info_buffer[0]));