Index: dll/ntdll/def/ntdll.spec =================================================================== --- dll/ntdll/def/ntdll.spec (revision 56419) +++ dll/ntdll/def/ntdll.spec (working copy) @@ -563,9 +563,13 @@ @ stdcall RtlDestroyProcessParameters(ptr) @ stdcall RtlDestroyQueryDebugBuffer(ptr) @ stdcall RtlDetermineDosPathNameType_U(wstr) +@ stdcall RtlDetermineDosPathNameType_Ustr(ptr) @ stdcall RtlDllShutdownInProgress() @ stdcall RtlDnsHostNameToComputerName(ptr ptr long) @ stdcall RtlDoesFileExists_U(wstr) +@ stdcall RtlDoesFileExists_UEx(wstr long) +@ stdcall RtlDoesFileExists_UStr(ptr) +@ stdcall RtlDoesFileExists_UstrEx(ptr long) @ stdcall RtlDosApplyFileIsolationRedirection_Ustr(long ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall RtlDosPathNameToNtPathName_U(wstr ptr ptr ptr) ;@ stdcall RtlDosPathNameToNtPathName_U_WithStatus ; 5.2 SP1, and higher @@ -662,6 +666,7 @@ @ stdcall RtlGetFirstRange(ptr ptr ptr) ;@ stdcall RtlGetFrame @ stdcall RtlGetFullPathName_U(wstr long ptr ptr) +@ stdcall RtlGetFullPathName_Ustr(ptr long ptr ptr ptr ptr) @ stdcall RtlGetFullPathName_UstrEx(ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetLastNtStatus() Index: lib/rtl/path.c =================================================================== --- lib/rtl/path.c (revision 56419) +++ lib/rtl/path.c (working copy) @@ -57,20 +57,17 @@ PWCHAR Path; ULONG Chars; - /* Validate the input */ - if (!PathString) return RtlPathTypeUnknown; - Path = PathString->Buffer; Chars = PathString->Length / sizeof(WCHAR); /* Return if there are no characters */ - if (!Chars) return RtlPathTypeUnknown; + if (!Chars) return RtlPathTypeRelative; /* * The algorithm is similar to RtlDetermineDosPathNameType_U but here we * actually check for the path length before touching the characters */ - if ((Chars < 1) || (IS_PATH_SEPARATOR(Path[0]))) + if (IS_PATH_SEPARATOR(Path[0])) { if ((Chars < 2) || !(IS_PATH_SEPARATOR(Path[1]))) return RtlPathTypeRooted; /* \x */ if ((Chars < 3) || ((Path[2] != L'.') && (Path[2] != L'?'))) return RtlPathTypeUncAbsolute;/* \\x */ @@ -80,9 +77,9 @@ } else { - if ((Chars < 2) || (!(Path[0]) || (Path[1] != L':'))) return RtlPathTypeRelative; /* x */ - if ((Chars < 3) || (IS_PATH_SEPARATOR(Path[2]))) return RtlPathTypeDriveAbsolute; /* x:\ */ - return RtlPathTypeDriveRelative; /* x: */ + if ((Chars < 2) || (Path[1] != L':')) return RtlPathTypeRelative; /* x */ + if ((Chars < 3) || !(IS_PATH_SEPARATOR(Path[2]))) return RtlPathTypeDriveRelative; /* x: */ + return RtlPathTypeDriveAbsolute; /* x:\ */ } } @@ -308,8 +305,7 @@ /* Handle initial path type and failure case */ *PathType = RtlPathTypeUnknown; - if (!(Size) || !(Buffer) || !(FileName) || - !(FileName->Length) || (FileName->Buffer[0] == UNICODE_NULL)) return 0; + if (!(FileName->Length) || (FileName->Buffer[0] == UNICODE_NULL)) return 0; /* Break filename into component parts */ FileNameBuffer = FileName->Buffer; @@ -737,9 +733,6 @@ NTSTATUS Status; FILE_BASIC_INFORMATION BasicInformation; - /* Validate the input */ - if (!FileName) return FALSE; - /* Get the NT Path */ Result = RtlDosPathNameToRelativeNtPathName_Ustr(FileName, &NtPathName, @@ -862,7 +855,7 @@ * This is, and has always been equal to, 269 characters, except in Wine * which claims this is 277. Go figure. */ - return (MAX_PATH + RtlpDosDevicesUncPrefix.Length + sizeof(ANSI_NULL)); + return MAX_PATH + RtlpDosDevicesUncPrefix.Length / sizeof(WCHAR) + sizeof(ANSI_NULL); } /* @@ -874,9 +867,6 @@ { DPRINT("RtlDetermineDosPathNameType_U %S\n", Path); - /* Validate the input */ - if (!Path) return RtlPathTypeUnknown; - /* Unlike the newer RtlDetermineDosPathNameType_U we assume 4 characters */ if (IS_PATH_SEPARATOR(Path[0])) { @@ -1997,7 +1987,7 @@ Quickie: /* Free any buffers we should be freeing */ DPRINT("Status: %lx %S %S\n", Status, StaticBuffer, TempDynamicString.Buffer); - if ((StaticBuffer) && (StaticBuffer != StaticString->Buffer)) + if ((StaticString) && (StaticBuffer) && (StaticBuffer != StaticString->Buffer)) { RtlpFreeMemory(StaticBuffer, TAG_USTR); }