| Index: base/sys_info_win.cc
|
| diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc
|
| index 98d2f7c951bb28605406ce0657793dc91ca711c8..d6ea16bedcdd22b9c80af643e11c7df8edf528b6 100644
|
| --- a/base/sys_info_win.cc
|
| +++ b/base/sys_info_win.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "base/sys_info.h"
|
|
|
| +#include <shlwapi.h>
|
| #include <windows.h>
|
|
|
| #include "base/file_path.h"
|
| @@ -65,6 +66,27 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
|
| }
|
|
|
| // static
|
| +int SysInfo::GetMaximumPathComponentLength(const FilePath& path) {
|
| + base::ThreadRestrictions::AssertIOAllowed();
|
| + if (!path.IsAbsolute())
|
| + return -1;
|
| +
|
| + // GetVolumeInformationW takes a root path ended with a backslash.
|
| + std::vector<FilePath::CharType> root(path.value().begin(),
|
| + path.value().end());
|
| + root.resize(root.size() + 2); // space for trailing zero 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";
|
| }
|
|
|