| Index: base/sys_info_win.cc
|
| diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc
|
| index 98d2f7c951bb28605406ce0657793dc91ca711c8..4b7f03827d1a0fd012fe40c7deb554fc92641ff3 100644
|
| --- a/base/sys_info_win.cc
|
| +++ b/base/sys_info_win.cc
|
| @@ -4,9 +4,11 @@
|
|
|
| #include "base/sys_info.h"
|
|
|
| +#include <shlwapi.h>
|
| #include <windows.h>
|
|
|
| #include "base/file_path.h"
|
| +#include "base/file_util.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/stringprintf.h"
|
| @@ -65,6 +67,28 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
|
| }
|
|
|
| // static
|
| +int SysInfo::GetMaximumPathComponentLength(const FilePath& path) {
|
| + base::ThreadRestrictions::AssertIOAllowed();
|
| + FilePath full_path(path);
|
| + if (!full_path.IsAbsolute() && !file_util::AbsolutePath(&full_path))
|
| + return -1;
|
| +
|
| + // GetVolumeInformationW takes a root path ended with a backslash.
|
| + std::vector<FilePath::CharType> root(full_path.value().begin(),
|
| + full_path.value().end());
|
| + root.resize(root.size() + 2); // +2 for trailing \0 and backslash.
|
| + PathStripToRootW(&root[0]);
|
| + PathAddBackslashW(&root[0]);
|
| +
|
| + DWORD max_length = 0;
|
| + if (!GetVolumeInformationW(&root[0], NULL, 0, NULL, &max_length, NULL, NULL,
|
| + 0)) {
|
| + return -1;
|
| + }
|
| + return static_cast<int>(max_length);
|
| +}
|
| +
|
| +// static
|
| std::string SysInfo::OperatingSystemName() {
|
| return "Windows NT";
|
| }
|
|
|