summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sandbox/win/src/broker_services.cc12
-rw-r--r--sandbox/win/src/eat_resolver.cc8
2 files changed, 9 insertions, 11 deletions
diff --git a/sandbox/win/src/broker_services.cc b/sandbox/win/src/broker_services.cc
index 01c7cdd..149218fa 100644
--- a/sandbox/win/src/broker_services.cc
+++ b/sandbox/win/src/broker_services.cc
@@ -279,7 +279,8 @@ DWORD WINAPI BrokerServicesBase::TargetEventsThread(PVOID param) {
case JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: {
{
AutoLock lock(&broker->lock_);
- broker->child_process_ids_.erase(reinterpret_cast<DWORD>(ovl));
+ broker->child_process_ids_.erase(
+ static_cast<DWORD>(reinterpret_cast<uintptr_t>(ovl)));
}
--target_counter;
if (0 == target_counter)
@@ -308,8 +309,8 @@ DWORD WINAPI BrokerServicesBase::TargetEventsThread(PVOID param) {
} else if (THREAD_CTRL_REMOVE_PEER == key) {
// Remove a process from our list of peers.
AutoLock lock(&broker->lock_);
- PeerTrackerMap::iterator it =
- broker->peer_map_.find(reinterpret_cast<DWORD>(ovl));
+ PeerTrackerMap::iterator it = broker->peer_map_.find(
+ static_cast<DWORD>(reinterpret_cast<uintptr_t>(ovl)));
DeregisterPeerTracker(it->second);
broker->peer_map_.erase(it);
} else if (THREAD_CTRL_QUIT == key) {
@@ -542,8 +543,9 @@ bool BrokerServicesBase::IsActiveTarget(DWORD process_id) {
VOID CALLBACK BrokerServicesBase::RemovePeer(PVOID parameter, BOOLEAN timeout) {
PeerTracker* peer = reinterpret_cast<PeerTracker*>(parameter);
// Don't check the return code because we this may fail (safely) at shutdown.
- ::PostQueuedCompletionStatus(peer->job_port, 0, THREAD_CTRL_REMOVE_PEER,
- reinterpret_cast<LPOVERLAPPED>(peer->id));
+ ::PostQueuedCompletionStatus(
+ peer->job_port, 0, THREAD_CTRL_REMOVE_PEER,
+ reinterpret_cast<LPOVERLAPPED>(static_cast<uintptr_t>(peer->id)));
}
ResultCode BrokerServicesBase::AddTargetPeer(HANDLE peer_process) {
diff --git a/sandbox/win/src/eat_resolver.cc b/sandbox/win/src/eat_resolver.cc
index 328ee00..1675ce8 100644
--- a/sandbox/win/src/eat_resolver.cc
+++ b/sandbox/win/src/eat_resolver.cc
@@ -45,12 +45,8 @@ NTSTATUS EatResolverThunk::Setup(const void* target_module,
return ret;
// Perform the patch.
-#pragma warning(push)
-#pragma warning(disable: 4311)
- // These casts generate warnings because they are 32 bit specific.
- *eat_entry_ = reinterpret_cast<DWORD>(thunk_storage) -
- reinterpret_cast<DWORD>(target_module);
-#pragma warning(pop)
+ *eat_entry_ = static_cast<DWORD>(reinterpret_cast<uintptr_t>(thunk_storage)) -
+ static_cast<DWORD>(reinterpret_cast<uintptr_t>(target_module));
if (NULL != storage_used)
*storage_used = GetThunkSize();