[go: nahoru, domu]

Improve handling and testing of reparse points.

BUG=28804
TEST=unit tests.

Review URL: http://codereview.chromium.org/553080

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37286 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/sandbox/src/win_utils.h b/sandbox/src/win_utils.h
index b3aad3f..c52f3e3 100644
--- a/sandbox/src/win_utils.h
+++ b/sandbox/src/win_utils.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -30,8 +30,8 @@
   };
 
  private:
-  DISALLOW_IMPLICIT_CONSTRUCTORS(AutoLock);
   CRITICAL_SECTION *lock_;
+  DISALLOW_IMPLICIT_CONSTRUCTORS(AutoLock);
 };
 
 // Basic implementation of a singleton which calls the destructor
@@ -71,6 +71,9 @@
 // returns true if any of them is a reparse point.
 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.
 bool GetPathFromHandle(HANDLE handle, std::wstring* path);