+ /* Work around defective behavior in Windows where paths longer than 260
+ * characters are not supported by default; instead they need to be
+ * turned into absolute paths and prefixed with "\\?\". */
+
+ if (wcsncmp(root_disk_path, L"\\\\?\\", 4)) {
+ dret = GetFullPathName(root_disk_path, WINDOWS_NT_MAX_PATH - 4,
+ &path[4], NULL);
+
+ if (dret == 0 || dret >= WINDOWS_NT_MAX_PATH - 4) {
+ WARNING("Can't get full path name for \"%ls\"", root_disk_path);
+ wmemcpy(path, root_disk_path, path_nchars + 1);
+ } else {
+ wmemcpy(path, L"\\\\?\\", 4);
+ path_nchars = 4 + dret;
+ }
+ } else {
+ wmemcpy(path, root_disk_path, path_nchars + 1);
+ }