OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // Utilities shared by both Broker RPC client and server. |
| 6 |
| 7 #include "ceee/ie/broker/broker_rpc_utils.h" |
| 8 |
| 9 #include "base/win_util.h" |
| 10 #include "ceee/common/process_utils_win.h" |
| 11 |
| 12 // Local interprocess communication only. |
| 13 const wchar_t kRpcProtocol[] = L"ncalrpc"; |
| 14 |
| 15 std::wstring GetRpcEndPointAddress() { |
| 16 std::wstring end_point; |
| 17 bool running_as_admin = false; |
| 18 // CEEE running as regular user and CEEE running as elevated user will start |
| 19 // different broker processes. So make end points names different to connect |
| 20 // to appropriate one. |
| 21 process_utils_win::IsCurrentProcessUacElevated(&running_as_admin); |
| 22 if (running_as_admin) |
| 23 end_point += L"ADMIN-"; |
| 24 std::wstring sid; |
| 25 win_util::GetUserSidString(&sid); |
| 26 end_point += sid; |
| 27 end_point += L"-B4630D08-4621-41A1-A8D0-F1E98DA460D6"; |
| 28 return end_point; |
| 29 } |
| 30 |
| 31 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len) { |
| 32 return malloc(len); |
| 33 } |
| 34 |
| 35 void __RPC_USER midl_user_free(void __RPC_FAR * ptr) { |
| 36 free(ptr); |
| 37 } |
OLD | NEW |