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

Side by Side Diff: sandbox/win/src/sandbox_nt_util.cc

Issue 942003008: Reland the ULONG -> SIZE_T change from 317177 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « sandbox/win/src/nt_internals.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/win/src/sandbox_nt_util.h" 5 #include "sandbox/win/src/sandbox_nt_util.h"
6 6
7 #include "base/win/pe_image.h" 7 #include "base/win/pe_image.h"
8 #include "sandbox/win/src/sandbox_factory.h" 8 #include "sandbox/win/src/sandbox_factory.h"
9 #include "sandbox/win/src/target_services.h" 9 #include "sandbox/win/src/target_services.h"
10 10
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } while (false); 462 } while (false);
463 } __except(EXCEPTION_EXECUTE_HANDLER) { 463 } __except(EXCEPTION_EXECUTE_HANDLER) {
464 } 464 }
465 465
466 return out_name; 466 return out_name;
467 #pragma warning(pop) 467 #pragma warning(pop)
468 } 468 }
469 469
470 UNICODE_STRING* GetBackingFilePath(PVOID address) { 470 UNICODE_STRING* GetBackingFilePath(PVOID address) {
471 // We'll start with something close to max_path charactes for the name. 471 // We'll start with something close to max_path charactes for the name.
472 ULONG buffer_bytes = MAX_PATH * 2; 472 SIZE_T buffer_bytes = MAX_PATH * 2;
473 473
474 for (;;) { 474 for (;;) {
475 MEMORY_SECTION_NAME* section_name = reinterpret_cast<MEMORY_SECTION_NAME*>( 475 MEMORY_SECTION_NAME* section_name = reinterpret_cast<MEMORY_SECTION_NAME*>(
476 new(NT_ALLOC) char[buffer_bytes]); 476 new(NT_ALLOC) char[buffer_bytes]);
477 477
478 if (!section_name) 478 if (!section_name)
479 return NULL; 479 return NULL;
480 480
481 ULONG returned_bytes; 481 SIZE_T returned_bytes;
482 NTSTATUS ret = g_nt.QueryVirtualMemory(NtCurrentProcess, address, 482 NTSTATUS ret = g_nt.QueryVirtualMemory(NtCurrentProcess, address,
483 MemorySectionName, section_name, 483 MemorySectionName, section_name,
484 buffer_bytes, &returned_bytes); 484 buffer_bytes, &returned_bytes);
485 485
486 if (STATUS_BUFFER_OVERFLOW == ret) { 486 if (STATUS_BUFFER_OVERFLOW == ret) {
487 // Retry the call with the given buffer size. 487 // Retry the call with the given buffer size.
488 operator delete(section_name, NT_ALLOC); 488 operator delete(section_name, NT_ALLOC);
489 section_name = NULL; 489 section_name = NULL;
490 buffer_bytes = returned_bytes; 490 buffer_bytes = returned_bytes;
491 continue; 491 continue;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 UNREFERENCED_PARAMETER(type); 670 UNREFERENCED_PARAMETER(type);
671 return buffer; 671 return buffer;
672 } 672 }
673 673
674 void __cdecl operator delete(void* memory, void* buffer, 674 void __cdecl operator delete(void* memory, void* buffer,
675 sandbox::AllocationType type) { 675 sandbox::AllocationType type) {
676 UNREFERENCED_PARAMETER(memory); 676 UNREFERENCED_PARAMETER(memory);
677 UNREFERENCED_PARAMETER(buffer); 677 UNREFERENCED_PARAMETER(buffer);
678 UNREFERENCED_PARAMETER(type); 678 UNREFERENCED_PARAMETER(type);
679 } 679 }
OLDNEW
« no previous file with comments | « sandbox/win/src/nt_internals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698