summaryrefslogtreecommitdiffstats
path: root/sandbox/win
diff options
context:
space:
mode:
authoravi <avi@chromium.org>2015-12-01 09:21:01 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-01 17:21:56 +0000
commit911c3c05c6eb35562f354b5b4ddb57528141357f (patch)
treef96a6ac1adc64a75b56eff7ba43c6a269ce81d94 /sandbox/win
parent1d9641452a852078f8bee59d24467c10541ffca4 (diff)
downloadchromium_src-911c3c05c6eb35562f354b5b4ddb57528141357f.zip
chromium_src-911c3c05c6eb35562f354b5b4ddb57528141357f.tar.gz
chromium_src-911c3c05c6eb35562f354b5b4ddb57528141357f.tar.bz2
Revert of Remove kuint16max. (patchset #7 id:120001 of https://codereview.chromium.org/1475803002/ )
Reason for revert: missed one :( Original issue's description: > Remove kuint16max. > > BUG=138542 > > Committed: https://crrev.com/0d94fda8c494d7a6c27d065d782f42e99d834f46 > Cr-Commit-Position: refs/heads/master@{#362431} TBR=treib@chromium.org,mark@chromium.org,sergeyu@chromium.org,bartfab@chromium.org,rsleevi@chromium.org,sky@chromium.org,cpu@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=138542 Review URL: https://codereview.chromium.org/1485853003 Cr-Commit-Position: refs/heads/master@{#362444}
Diffstat (limited to 'sandbox/win')
-rw-r--r--sandbox/win/src/sandbox_nt_util.cc14
-rw-r--r--sandbox/win/src/sandbox_nt_util.h14
2 files changed, 11 insertions, 17 deletions
diff --git a/sandbox/win/src/sandbox_nt_util.cc b/sandbox/win/src/sandbox_nt_util.cc
index 82de75c..2b2a3ba 100644
--- a/sandbox/win/src/sandbox_nt_util.cc
+++ b/sandbox/win/src/sandbox_nt_util.cc
@@ -290,8 +290,7 @@ NTSTATUS AllocAndGetFullPath(HANDLE root,
// Hacky code... replace with AllocAndCopyObjectAttributes.
NTSTATUS AllocAndCopyName(const OBJECT_ATTRIBUTES* in_object,
- wchar_t** out_name,
- uint32_t* attributes,
+ wchar_t** out_name, uint32* attributes,
HANDLE* root) {
if (!InitHeap())
return STATUS_NO_MEMORY;
@@ -434,7 +433,7 @@ UNICODE_STRING* AnsiToUnicode(const char* string) {
return out_string;
}
-UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32_t* flags) {
+UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) {
// PEImage's dtor won't be run during SEH unwinding, but that's OK.
#pragma warning(push)
#pragma warning(disable: 4509)
@@ -530,7 +529,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(UINT16_MAX > size_bytes);
+ DCHECK_NT(kuint16max > size_bytes);
char* str_buffer = new(NT_ALLOC) char[size_bytes + sizeof(UNICODE_STRING)];
if (!str_buffer)
return NULL;
@@ -586,9 +585,8 @@ NTSTATUS AutoProtectMemory::RevertProtection() {
return ret;
}
-bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info,
- DWORD length,
- uint32_t file_info_class) {
+bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length,
+ uint32 file_info_class) {
if (FileRenameInformation != file_info_class)
return false;
@@ -608,7 +606,7 @@ bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info,
// Check if it starts with \\??\\. We don't support relative paths.
if (file_info->FileNameLength < sizeof(kPathPrefix) ||
- file_info->FileNameLength > UINT16_MAX)
+ file_info->FileNameLength > kuint16max)
return false;
if (file_info->FileName[0] != kPathPrefix[0] ||
diff --git a/sandbox/win/src/sandbox_nt_util.h b/sandbox/win/src/sandbox_nt_util.h
index 3dee932..83dd7c0 100644
--- a/sandbox/win/src/sandbox_nt_util.h
+++ b/sandbox/win/src/sandbox_nt_util.h
@@ -6,9 +6,8 @@
#define SANDBOX_SRC_SANDBOX_NT_UTIL_H_
#include <intrin.h>
-#include <stdint.h>
-#include "base/macros.h"
+#include "base/basictypes.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/sandbox_nt_types.h"
@@ -102,9 +101,7 @@ NTSTATUS CopyData(void* destination, const void* source, size_t bytes);
// Copies the name from an object attributes.
NTSTATUS AllocAndCopyName(const OBJECT_ATTRIBUTES* in_object,
- wchar_t** out_name,
- uint32_t* attributes,
- HANDLE* root);
+ wchar_t** out_name, uint32* attributes, HANDLE* root);
// Determine full path name from object root and path.
NTSTATUS AllocAndGetFullPath(HANDLE root,
@@ -137,7 +134,7 @@ enum MappedModuleFlags {
// }
// InsertYourLogicHere(name);
// operator delete(name, NT_ALLOC);
-UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32_t* flags);
+UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags);
// Returns the full path and filename for a given dll.
// May return NULL if the provided address is not backed by a named section, or
@@ -185,9 +182,8 @@ class AutoProtectMemory {
// Returns true if the file_rename_information structure is supported by our
// rename handler.
-bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info,
- DWORD length,
- uint32_t file_info_class);
+bool IsSupportedRenameCall(FILE_RENAME_INFORMATION* file_info, DWORD length,
+ uint32 file_info_class);
} // namespace sandbox