| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "sandbox/win/src/sync_policy.h" | 7 #include "sandbox/win/src/sync_policy.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 NtOpenDirectoryObjectFunction NtOpenDirectoryObject = NULL; | 94 NtOpenDirectoryObjectFunction NtOpenDirectoryObject = NULL; |
| 95 ResolveNTFunctionPtr("NtOpenDirectoryObject", &NtOpenDirectoryObject); | 95 ResolveNTFunctionPtr("NtOpenDirectoryObject", &NtOpenDirectoryObject); |
| 96 | 96 |
| 97 DWORD session_id = 0; | 97 DWORD session_id = 0; |
| 98 ProcessIdToSessionId(::GetCurrentProcessId(), &session_id); | 98 ProcessIdToSessionId(::GetCurrentProcessId(), &session_id); |
| 99 | 99 |
| 100 base::string16 base_named_objects_path; | 100 base::string16 base_named_objects_path; |
| 101 | 101 |
| 102 NTSTATUS status = ResolveSymbolicLink(L"\\Sessions\\BNOLINKS", | 102 NTSTATUS status = 0;/* ResolveSymbolicLink(L"\\Sessions\\BNOLINKS", |
| 103 base::StringPrintf(L"%d", session_id), | 103 base::StringPrintf(L"%d", session_id), |
| 104 &base_named_objects_path); | 104 &base_named_objects_path);*/ |
| 105 if (!NT_SUCCESS(status)) { | 105 if (!NT_SUCCESS(status)) { |
| 106 DLOG(ERROR) << "Failed to resolve BaseNamedObjects path. Error: " | 106 DLOG(ERROR) << "Failed to resolve BaseNamedObjects path. Error: " |
| 107 << status; | 107 << status; |
| 108 return status; | 108 return status; |
| 109 } | 109 } |
| 110 | 110 |
| 111 UNICODE_STRING directory_name = {}; | 111 UNICODE_STRING directory_name = {}; |
| 112 OBJECT_ATTRIBUTES object_attributes = {}; | 112 OBJECT_ATTRIBUTES object_attributes = {}; |
| 113 InitObjectAttribs(base_named_objects_path, OBJ_CASE_INSENSITIVE, NULL, | 113 InitObjectAttribs(base_named_objects_path, OBJ_CASE_INSENSITIVE, NULL, |
| 114 &object_attributes, &directory_name, NULL); | 114 &object_attributes, &directory_name, NULL); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 if (!::DuplicateHandle(::GetCurrentProcess(), local_handle, | 236 if (!::DuplicateHandle(::GetCurrentProcess(), local_handle, |
| 237 client_info.process, handle, 0, FALSE, | 237 client_info.process, handle, 0, FALSE, |
| 238 DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { | 238 DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { |
| 239 return STATUS_ACCESS_DENIED; | 239 return STATUS_ACCESS_DENIED; |
| 240 } | 240 } |
| 241 return status; | 241 return status; |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace sandbox | 244 } // namespace sandbox |
| OLD | NEW |