Commit 266720b3 authored by rnk's avatar rnk Committed by Commit bot

Reland the ULONG -> SIZE_T change from 317177

Testing shows that this change is correct, but there was no evidence supporting the other change. Will manually run the x64 dbg test try bot for this change.

TBR=thakis@chromium.org,jvoung@chromium.org
BUG=458690,460563

Review URL: https://codereview.chromium.org/942003008

Cr-Commit-Position: refs/heads/master@{#318160}
parent b23b8b4e
...@@ -51,7 +51,7 @@ base::string16 GetBackingModuleFilePath(PVOID address) { ...@@ -51,7 +51,7 @@ base::string16 GetBackingModuleFilePath(PVOID address) {
DCHECK_NT(g_nt_query_virtual_memory_func); DCHECK_NT(g_nt_query_virtual_memory_func);
// We'll start with something close to max_path characters for the name. // We'll start with something close to max_path characters for the name.
ULONG buffer_bytes = MAX_PATH * 2; SIZE_T buffer_bytes = MAX_PATH * 2;
std::vector<BYTE> buffer_data(buffer_bytes); std::vector<BYTE> buffer_data(buffer_bytes);
for (;;) { for (;;) {
...@@ -61,7 +61,7 @@ base::string16 GetBackingModuleFilePath(PVOID address) { ...@@ -61,7 +61,7 @@ base::string16 GetBackingModuleFilePath(PVOID address) {
if (!section_name) if (!section_name)
break; break;
ULONG returned_bytes; SIZE_T returned_bytes;
NTSTATUS ret = g_nt_query_virtual_memory_func( NTSTATUS ret = g_nt_query_virtual_memory_func(
NtCurrentProcess, address, MemorySectionName, section_name, NtCurrentProcess, address, MemorySectionName, section_name,
buffer_bytes, &returned_bytes); buffer_bytes, &returned_bytes);
......
...@@ -450,8 +450,8 @@ typedef NTSTATUS (WINAPI *NtQueryVirtualMemoryFunction)( ...@@ -450,8 +450,8 @@ typedef NTSTATUS (WINAPI *NtQueryVirtualMemoryFunction)(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN MEMORY_INFORMATION_CLASS MemoryInformationClass, IN MEMORY_INFORMATION_CLASS MemoryInformationClass,
OUT PVOID MemoryInformation, OUT PVOID MemoryInformation,
IN ULONG MemoryInformationLength, IN SIZE_T MemoryInformationLength,
OUT PULONG ReturnLength OPTIONAL); OUT PSIZE_T ReturnLength OPTIONAL);
typedef NTSTATUS (WINAPI *NtProtectVirtualMemoryFunction)( typedef NTSTATUS (WINAPI *NtProtectVirtualMemoryFunction)(
IN HANDLE ProcessHandle, IN HANDLE ProcessHandle,
......
...@@ -469,7 +469,7 @@ UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) { ...@@ -469,7 +469,7 @@ UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) {
UNICODE_STRING* GetBackingFilePath(PVOID address) { UNICODE_STRING* GetBackingFilePath(PVOID address) {
// We'll start with something close to max_path charactes for the name. // We'll start with something close to max_path charactes for the name.
ULONG buffer_bytes = MAX_PATH * 2; SIZE_T buffer_bytes = MAX_PATH * 2;
for (;;) { for (;;) {
MEMORY_SECTION_NAME* section_name = reinterpret_cast<MEMORY_SECTION_NAME*>( MEMORY_SECTION_NAME* section_name = reinterpret_cast<MEMORY_SECTION_NAME*>(
...@@ -478,7 +478,7 @@ UNICODE_STRING* GetBackingFilePath(PVOID address) { ...@@ -478,7 +478,7 @@ UNICODE_STRING* GetBackingFilePath(PVOID address) {
if (!section_name) if (!section_name)
return NULL; return NULL;
ULONG returned_bytes; SIZE_T returned_bytes;
NTSTATUS ret = g_nt.QueryVirtualMemory(NtCurrentProcess, address, NTSTATUS ret = g_nt.QueryVirtualMemory(NtCurrentProcess, address,
MemorySectionName, section_name, MemorySectionName, section_name,
buffer_bytes, &returned_bytes); buffer_bytes, &returned_bytes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment