| Index: sandbox/win/src/sync_dispatcher.cc
|
| ===================================================================
|
| --- sandbox/win/src/sync_dispatcher.cc (revision 230780)
|
| +++ sandbox/win/src/sync_dispatcher.cc (working copy)
|
| @@ -25,7 +25,7 @@
|
| };
|
|
|
| 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 @@
|
|
|
| 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 @@
|
| 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 @@
|
| 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;
|
|
|