diff options
author | jfb <jfb@chromium.org> | 2015-02-20 13:46:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-20 21:47:49 +0000 |
commit | faeb8f6a5524dded1f97c16dee4b09dce548bae4 (patch) | |
tree | 7309dfd6ba6e78d9de7d5c93aea9bab34beb47d0 /sandbox | |
parent | 12bf6c6e4f42ae41274d8fde255aaed13f868045 (diff) | |
download | chromium_src-faeb8f6a5524dded1f97c16dee4b09dce548bae4.zip chromium_src-faeb8f6a5524dded1f97c16dee4b09dce548bae4.tar.gz chromium_src-faeb8f6a5524dded1f97c16dee4b09dce548bae4.tar.bz2 |
Revert of sandbox: Fix Win64 porting issue by using SIZE_T instead of ULONG (patchset #3 id:40001 of https://codereview.chromium.org/921353002/)
Reason for revert:
Speculative revert after discussion on IRC, this seems pretty unlikely but may have caused the failures at:
http://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/35506
Original issue's description:
> sandbox: Fix some nt_internals.h function prototypes for Win64
>
> NtQuerySection should use ULONG instead of SIZE_T as it is dealing with PE section sizes.
>
> NtQueryVirtualMemory should use SIZE_T instead of ULONG as it is dealing with memory sizes.
>
> DynamoRIO, another project that consumes these native APIs, uses the prototypes introduced by this change.
>
> R=robertshield@chromium.org,rvargas@chromium.org
> BUG=458690
>
> Committed: https://crrev.com/4ede4e174a51d08262edfb2e2c05845504bd9b1a
> Cr-Commit-Position: refs/heads/master@{#317177}
TBR=jschuh@chromium.org,robertshield@chromium.org,thakis@chromium.org,wfh@chromium.org,rvargas@chromium.org,rnk@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=458690
Review URL: https://codereview.chromium.org/943043002
Cr-Commit-Position: refs/heads/master@{#317409}
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/win/src/nt_internals.h | 8 | ||||
-rw-r--r-- | sandbox/win/src/sandbox_nt_util.cc | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sandbox/win/src/nt_internals.h b/sandbox/win/src/nt_internals.h index ade2d67..8b22e0e 100644 --- a/sandbox/win/src/nt_internals.h +++ b/sandbox/win/src/nt_internals.h @@ -250,8 +250,8 @@ typedef NTSTATUS (WINAPI *NtQuerySectionFunction)( IN HANDLE SectionHandle, IN SECTION_INFORMATION_CLASS SectionInformationClass, OUT PVOID SectionInformation, - IN ULONG SectionInformationLength, - OUT PULONG ReturnLength OPTIONAL); + IN SIZE_T SectionInformationLength, + OUT PSIZE_T ReturnLength OPTIONAL); // ----------------------------------------------------------------------- // Process and Thread @@ -450,8 +450,8 @@ typedef NTSTATUS (WINAPI *NtQueryVirtualMemoryFunction)( IN PVOID BaseAddress, IN MEMORY_INFORMATION_CLASS MemoryInformationClass, OUT PVOID MemoryInformation, - IN SIZE_T MemoryInformationLength, - OUT PSIZE_T ReturnLength OPTIONAL); + IN ULONG MemoryInformationLength, + OUT PULONG ReturnLength OPTIONAL); typedef NTSTATUS (WINAPI *NtProtectVirtualMemoryFunction)( IN HANDLE ProcessHandle, diff --git a/sandbox/win/src/sandbox_nt_util.cc b/sandbox/win/src/sandbox_nt_util.cc index 15a9cf7..cc446e5 100644 --- a/sandbox/win/src/sandbox_nt_util.cc +++ b/sandbox/win/src/sandbox_nt_util.cc @@ -385,7 +385,7 @@ bool IsValidImageSection(HANDLE section, PVOID *base, PLARGE_INTEGER offset, return false; SECTION_BASIC_INFORMATION basic_info; - ULONG bytes_returned; + SIZE_T bytes_returned; ret = g_nt.QuerySection(query_section, SectionBasicInformation, &basic_info, sizeof(basic_info), &bytes_returned); @@ -469,7 +469,7 @@ UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) { UNICODE_STRING* GetBackingFilePath(PVOID address) { // We'll start with something close to max_path charactes for the name. - SIZE_T buffer_bytes = MAX_PATH * 2; + ULONG buffer_bytes = MAX_PATH * 2; for (;;) { MEMORY_SECTION_NAME* section_name = reinterpret_cast<MEMORY_SECTION_NAME*>( @@ -478,7 +478,7 @@ UNICODE_STRING* GetBackingFilePath(PVOID address) { if (!section_name) return NULL; - SIZE_T returned_bytes; + ULONG returned_bytes; NTSTATUS ret = g_nt.QueryVirtualMemory(NtCurrentProcess, address, MemorySectionName, section_name, buffer_bytes, &returned_bytes); |