|
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 const wchar_t kRpcProtocol[] = L"ncalrpc"; | |
Sigurður Ásgeirsson
2010/11/11 19:30:35
a quick one-line comment on ncalrpc (this is machi
Vitaly Buka corp
2010/11/11 23:12:10
Done.
Vitaly Buka corp
2010/11/11 23:12:10
Done.
| |
13 | |
14 std::wstring GetRpcEndPointAddress() { | |
15 std::wstring end_point; | |
16 bool running_as_admin = false; | |
17 process_utils_win::IsCurrentProcessUacElevated(&running_as_admin); | |
Sigurður Ásgeirsson
2010/11/11 19:30:35
a quick comment on how and maybe why we construct
Vitaly Buka corp
2010/11/11 23:12:10
Done.
| |
18 if (running_as_admin) | |
19 end_point += L"ADMIN"; | |
20 std::wstring sid; | |
21 win_util::GetUserSidString(&sid); | |
22 end_point += sid; | |
23 end_point += L"B4630D08-4621-41A1-A8D0-F1E98DA460D6"; | |
24 | |
25 // TODO(vitalybuka@google.com): Find proof link why endpoint size is limited. | |
26 end_point.resize(std::min(52u, end_point.size())); | |
27 return end_point; | |
28 } | |
29 | |
30 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len) { | |
31 return malloc(len); | |
32 } | |
33 | |
34 void __RPC_USER midl_user_free(void __RPC_FAR * ptr) { | |
35 free(ptr); | |
36 } | |
OLD | NEW |