OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "sandbox/win/src/crosscall_client.h" | 8 #include "sandbox/win/src/crosscall_client.h" |
9 #include "sandbox/win/src/crosscall_server.h" | 9 #include "sandbox/win/src/crosscall_server.h" |
10 #include "sandbox/win/src/sharedmem_ipc_client.h" | 10 #include "sandbox/win/src/sharedmem_ipc_client.h" |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 // This test-only IPC dispatcher has two handlers with the same signature | 557 // This test-only IPC dispatcher has two handlers with the same signature |
558 // but only CallOneHandler should be used. | 558 // but only CallOneHandler should be used. |
559 class UnitTestIPCDispatcher : public Dispatcher { | 559 class UnitTestIPCDispatcher : public Dispatcher { |
560 public: | 560 public: |
561 enum { | 561 enum { |
562 CALL_ONE_TAG = 78, | 562 CALL_ONE_TAG = 78, |
563 CALL_TWO_TAG = 87 | 563 CALL_TWO_TAG = 87 |
564 }; | 564 }; |
565 | 565 |
566 UnitTestIPCDispatcher(); | 566 UnitTestIPCDispatcher(); |
567 ~UnitTestIPCDispatcher() override{}; | 567 ~UnitTestIPCDispatcher() override {} |
568 | 568 |
569 bool SetupService(InterceptionManager* manager, int service) override { | 569 bool SetupService(InterceptionManager* manager, int service) override { |
570 return true; | 570 return true; |
571 } | 571 } |
572 | 572 |
573 private: | 573 private: |
574 bool CallOneHandler(IPCInfo* ipc, HANDLE p1, uint32_t p2) { | 574 bool CallOneHandler(IPCInfo* ipc, HANDLE p1, uint32_t p2) { |
575 ipc->return_info.extended[0].handle = p1; | 575 ipc->return_info.extended[0].handle = p1; |
576 ipc->return_info.extended[1].unsigned_int = p2; | 576 ipc->return_info.extended[1].unsigned_int = p2; |
577 return true; | 577 return true; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 &call_return)); | 623 &call_return)); |
624 EXPECT_EQ(SBOX_ALL_OK, call_return.call_outcome); | 624 EXPECT_EQ(SBOX_ALL_OK, call_return.call_outcome); |
625 EXPECT_TRUE(bar == call_return.extended[0].handle); | 625 EXPECT_TRUE(bar == call_return.extended[0].handle); |
626 EXPECT_EQ(foo, call_return.extended[1].unsigned_int); | 626 EXPECT_EQ(foo, call_return.extended[1].unsigned_int); |
627 | 627 |
628 CloseChannelEvents(client_control); | 628 CloseChannelEvents(client_control); |
629 delete[] reinterpret_cast<char*>(client_control); | 629 delete[] reinterpret_cast<char*>(client_control); |
630 } | 630 } |
631 | 631 |
632 } // namespace sandbox | 632 } // namespace sandbox |
OLD | NEW |