Chromium Code Reviews| Index: sandbox/win/src/sandbox_nt_util.cc |
| diff --git a/sandbox/win/src/sandbox_nt_util.cc b/sandbox/win/src/sandbox_nt_util.cc |
| index 2b2a3bae0f7c85838f88d847b7cb7a3717605bdf..2189673b93741029a04b83e8faba62bf8e82b5c5 100644 |
| --- a/sandbox/win/src/sandbox_nt_util.cc |
| +++ b/sandbox/win/src/sandbox_nt_util.cc |
| @@ -4,6 +4,7 @@ |
| #include "sandbox/win/src/sandbox_nt_util.h" |
| +#include <limits> |
| #include <string> |
| #include "base/win/pe_image.h" |
| @@ -290,7 +291,8 @@ NTSTATUS AllocAndGetFullPath(HANDLE root, |
| // Hacky code... replace with AllocAndCopyObjectAttributes. |
| NTSTATUS AllocAndCopyName(const OBJECT_ATTRIBUTES* in_object, |
| - wchar_t** out_name, uint32* attributes, |
| + wchar_t** out_name, |
| + uint32_t* attributes, |
| HANDLE* root) { |
| if (!InitHeap()) |
| return STATUS_NO_MEMORY; |
| @@ -433,7 +435,7 @@ UNICODE_STRING* AnsiToUnicode(const char* string) { |
| return out_string; |
| } |
| -UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) { |
| +UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32_t* flags) { |
| // PEImage's dtor won't be run during SEH unwinding, but that's OK. |
| #pragma warning(push) |
| #pragma warning(disable: 4509) |
| @@ -529,7 +531,7 @@ UNICODE_STRING* ExtractModuleName(const UNICODE_STRING* module_path) { |
| // Based on the code above, size_bytes should always be small enough |
| // to make the static_cast below safe. |
| - DCHECK_NT(kuint16max > size_bytes); |
| + DCHECK_NT(std::numeric_limits<uint16_t>::max() > size_bytes); |
|
cpu_(ooo_6.6-7.5)
2015/11/30 18:33:06
I don't know about this. If this ever translates t
Mark Mentovai
2015/11/30 18:38:34
cpu wrote:
Avi (use Gerrit)
2015/11/30 22:12:24
I can switch to UINT16_MAX if that would alleviate
|
| char* str_buffer = new(NT_ALLOC) char[size_bytes + sizeof(UNICODE_STRING)]; |
| if (!str_buffer) |
| return NULL; |
| @@ -585,8 +587,9 @@ NTSTATUS AutoProtectMemory::RevertProtection() { |
| return ret; |
| } |
| -bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length, |
| - uint32 file_info_class) { |
| +bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, |
| + DWORD length, |
| + uint32_t file_info_class) { |
| if (FileRenameInformation != file_info_class) |
| return false; |
| @@ -606,7 +609,7 @@ bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length, |
| // Check if it starts with \\??\\. We don't support relative paths. |
| if (file_info->FileNameLength < sizeof(kPathPrefix) || |
| - file_info->FileNameLength > kuint16max) |
| + file_info->FileNameLength > std::numeric_limits<uint16_t>::max()) |
|
cpu_(ooo_6.6-7.5)
2015/11/30 18:33:06
same here.
|
| return false; |
| if (file_info->FileName[0] != kPathPrefix[0] || |