summaryrefslogtreecommitdiff
path: root/sandbox/win/src/sync_dispatcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/win/src/sync_dispatcher.cc')
-rw-r--r--sandbox/win/src/sync_dispatcher.cc36
1 files changed, 9 insertions, 27 deletions
diff --git a/sandbox/win/src/sync_dispatcher.cc b/sandbox/win/src/sync_dispatcher.cc
index 6897daccc3..3769fc6c67 100644
--- a/sandbox/win/src/sync_dispatcher.cc
+++ b/sandbox/win/src/sync_dispatcher.cc
@@ -25,7 +25,7 @@ SyncDispatcher::SyncDispatcher(PolicyBase* policy_base)
};
static const IPCCall open_params = {
- {IPC_OPENEVENT_TAG, WCHAR_TYPE, ULONG_TYPE, ULONG_TYPE},
+ {IPC_OPENEVENT_TAG, WCHAR_TYPE, ULONG_TYPE},
reinterpret_cast<CallbackGeneric>(&SyncDispatcher::OpenEvent)
};
@@ -35,33 +35,16 @@ SyncDispatcher::SyncDispatcher(PolicyBase* policy_base)
bool SyncDispatcher::SetupService(InterceptionManager* manager,
int service) {
- bool ret = false;
- // We need to intercept kernelbase.dll on Windows 7 and beyond and
- // kernel32.dll for earlier versions.
- static const wchar_t* kWin32SyncDllName =
- base::win::GetVersion() >= base::win::VERSION_WIN7 ? kKernelBasedllName :
- kKerneldllName;
-
if (IPC_CREATEEVENT_TAG == service) {
- ret = INTERCEPT_EAT(manager, kWin32SyncDllName, CreateEventW,
- CREATE_EVENTW_ID, 20);
- if (ret) {
- ret = INTERCEPT_EAT(manager, kWin32SyncDllName, CreateEventA,
- CREATE_EVENTA_ID, 20);
- }
+ return INTERCEPT_NT(manager, NtCreateEvent, CREATE_EVENT_ID, 24);
} else if (IPC_OPENEVENT_TAG == service) {
- ret = INTERCEPT_EAT(manager, kWin32SyncDllName, OpenEventW, OPEN_EVENTW_ID,
- 16);
- if (ret) {
- ret = INTERCEPT_EAT(manager, kWin32SyncDllName, OpenEventA,
- OPEN_EVENTA_ID, 16);
- }
+ return INTERCEPT_NT(manager, NtOpenEvent, OPEN_EVENT_ID, 16);
}
- return ret;
+ return false;
}
bool SyncDispatcher::CreateEvent(IPCInfo* ipc, std::wstring* name,
- DWORD manual_reset, DWORD initial_state) {
+ DWORD event_type, DWORD initial_state) {
const wchar_t* event_name = name->c_str();
CountedParameterSet<NameBased> params;
params[NameBased::NAME] = ParamPickerMake(event_name);
@@ -70,16 +53,16 @@ bool SyncDispatcher::CreateEvent(IPCInfo* ipc, std::wstring* name,
params.GetBase());
HANDLE handle = NULL;
DWORD ret = SyncPolicy::CreateEventAction(result, *ipc->client_info, *name,
- manual_reset, initial_state,
+ event_type, initial_state,
&handle);
// Return operation status on the IPC.
- ipc->return_info.win32_result = ret;
+ ipc->return_info.nt_status = ret;
ipc->return_info.handle = handle;
return true;
}
bool SyncDispatcher::OpenEvent(IPCInfo* ipc, std::wstring* name,
- DWORD desired_access, DWORD inherit_handle) {
+ DWORD desired_access) {
const wchar_t* event_name = name->c_str();
CountedParameterSet<OpenEventParams> params;
@@ -90,8 +73,7 @@ bool SyncDispatcher::OpenEvent(IPCInfo* ipc, std::wstring* name,
params.GetBase());
HANDLE handle = NULL;
DWORD ret = SyncPolicy::OpenEventAction(result, *ipc->client_info, *name,
- desired_access, inherit_handle,
- &handle);
+ desired_access, &handle);
// Return operation status on the IPC.
ipc->return_info.win32_result = ret;
ipc->return_info.handle = handle;