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 "sandbox/win/src/sandbox_policy_base.h" | 5 #include "sandbox/win/src/sandbox_policy_base.h" |
6 | 6 |
7 #include <sddl.h> | 7 #include <sddl.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 HANDLE CreateLowBoxObjectDirectory(PSID lowbox_sid) { | 73 HANDLE CreateLowBoxObjectDirectory(PSID lowbox_sid) { |
74 DWORD session_id = 0; | 74 DWORD session_id = 0; |
75 if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &session_id)) | 75 if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &session_id)) |
76 return NULL; | 76 return NULL; |
77 | 77 |
78 LPWSTR sid_string = NULL; | 78 LPWSTR sid_string = NULL; |
79 if (!::ConvertSidToStringSid(lowbox_sid, &sid_string)) | 79 if (!::ConvertSidToStringSid(lowbox_sid, &sid_string)) |
80 return NULL; | 80 return NULL; |
81 | 81 |
82 base::string16 directory_path = base::StringPrintf( | 82 base::string16 directory_path = L"";/* base::StringPrintf( |
83 L"\\Sessions\\%d\\AppContainerNamedObjects\\%ls", | 83 L"\\Sessions\\%d\\AppContainerNamedObjects\\%ls", |
84 session_id, sid_string).c_str(); | 84 session_id, sid_string).c_str();*/ |
85 ::LocalFree(sid_string); | 85 ::LocalFree(sid_string); |
86 | 86 |
87 NtCreateDirectoryObjectFunction CreateObjectDirectory = NULL; | 87 NtCreateDirectoryObjectFunction CreateObjectDirectory = NULL; |
88 ResolveNTFunctionPtr("NtCreateDirectoryObject", &CreateObjectDirectory); | 88 ResolveNTFunctionPtr("NtCreateDirectoryObject", &CreateObjectDirectory); |
89 | 89 |
90 OBJECT_ATTRIBUTES obj_attr; | 90 OBJECT_ATTRIBUTES obj_attr; |
91 UNICODE_STRING obj_name; | 91 UNICODE_STRING obj_name; |
92 sandbox::InitObjectAttribs(directory_path, | 92 sandbox::InitObjectAttribs(directory_path, |
93 OBJ_CASE_INSENSITIVE | OBJ_OPENIF, | 93 OBJ_CASE_INSENSITIVE | OBJ_OPENIF, |
94 NULL, | 94 NULL, |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 break; | 873 break; |
874 } | 874 } |
875 | 875 |
876 default: { return SBOX_ERROR_UNSUPPORTED; } | 876 default: { return SBOX_ERROR_UNSUPPORTED; } |
877 } | 877 } |
878 | 878 |
879 return SBOX_ALL_OK; | 879 return SBOX_ALL_OK; |
880 } | 880 } |
881 | 881 |
882 } // namespace sandbox | 882 } // namespace sandbox |
OLD | NEW |