diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-07 03:10:12 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-07 03:10:12 +0000 |
commit | a7cab943cd84df541a4f290a431f39942f3934bf (patch) | |
tree | ae28a35b76b2d6676b0bcb1115ddfd8b51c03117 /sandbox/src/win_utils.h | |
parent | b78804c8b2abe1ea162383795e612af1a09e273f (diff) | |
download | chromium_src-a7cab943cd84df541a4f290a431f39942f3934bf.zip chromium_src-a7cab943cd84df541a4f290a431f39942f3934bf.tar.gz chromium_src-a7cab943cd84df541a4f290a431f39942f3934bf.tar.bz2 |
Allow native (nt-style) paths to be used for sandbox policy specification
1- bypass fixup when adding the path into the policy
2- make SameObject() do case-insensitive perfect match
BUG=50774
TEST= unit test included
Review URL: http://codereview.chromium.org/3092014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/win_utils.h')
-rw-r--r-- | sandbox/src/win_utils.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sandbox/src/win_utils.h b/sandbox/src/win_utils.h index 8bc44b7..a80bb81 100644 --- a/sandbox/src/win_utils.h +++ b/sandbox/src/win_utils.h @@ -15,6 +15,9 @@ namespace sandbox { const wchar_t kNTPrefix[] = L"\\??\\"; const size_t kNTPrefixLen = arraysize(kNTPrefix) - 1; +const wchar_t kNTObjManPrefix[] = L"\\Device\\"; +const size_t kNTObjManPrefixLen = arraysize(kNTObjManPrefix) - 1; + // Automatically acquires and releases a lock when the object is // is destroyed. class AutoLock { @@ -74,9 +77,13 @@ DWORD IsReparsePoint(const std::wstring& full_path, bool* result); // Returns true if the handle corresponds to the object pointed by this path. bool SameObject(HANDLE handle, const wchar_t* full_path); -// Resolves a handle to a path. Returns true if the handle can be resolved. +// Resolves a handle to an nt path. Returns true if the handle can be resolved. bool GetPathFromHandle(HANDLE handle, std::wstring* path); +// Resolves a win32 path to an nt path using GetPathFromHandle. The path must +// exist. Returs true if the translation was succesful. +bool GetNtPathFromWin32Path(const std::wstring& path, std::wstring* nt_path); + // Translates a reserved key name to its handle. // For example "HKEY_LOCAL_MACHINE" returns HKEY_LOCAL_MACHINE. // Returns NULL if the name does not represent any reserved key name. |