Index: chrome/browser/enumerate_modules_model_win.cc |
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc |
index acfed882bcbab64c6112d5597d1c9b87f1ba2b11..bd2cc51a8ed5e18af1aba1685d8f24f7709ede6f 100644 |
--- a/chrome/browser/enumerate_modules_model_win.cc |
+++ b/chrome/browser/enumerate_modules_model_win.cc |
@@ -7,7 +7,6 @@ |
#include <Tlhelp32.h> |
#include <wintrust.h> |
-#include "app/win/win_util.h" |
#include "base/command_line.h" |
#include "base/environment.h" |
#include "base/file_path.h" |
@@ -75,8 +74,23 @@ struct FindModule { |
const ModuleEnumerator::Module& module; |
}; |
+// Returns the long path name given a short path name. A short path name is a |
+// path that follows the 8.3 convention and has ~x in it. If the path is already |
+// a long path name, the function returns the current path without modification. |
+bool ConvertToLongPath(const string16& short_path, string16* long_path) { |
+ wchar_t long_path_buf[MAX_PATH]; |
+ DWORD return_value = GetLongPathName(short_path.c_str(), long_path_buf, |
+ MAX_PATH); |
+ if (return_value != 0 && return_value < MAX_PATH) { |
+ *long_path = long_path_buf; |
+ return true; |
+ } |
+ |
+ return false; |
} |
+} // namespace |
+ |
// The browser process module blacklist. This lists modules that are known |
// to cause compatibility issues within the browser process. When adding to this |
// list, make sure that all paths are lower-case, in long pathname form, end |
@@ -220,7 +234,7 @@ static void GenerateHash(const std::string& input, std::string* output) { |
// static |
void ModuleEnumerator::NormalizeModule(Module* module) { |
string16 path = module->location; |
- if (!app::win::ConvertToLongPath(path, &module->location)) |
+ if (!ConvertToLongPath(path, &module->location)) |
module->location = path; |
module->location = l10n_util::ToLower(module->location); |