fixed the definition of RtlDosPathNameToNtPathName_U

svn path=/trunk/; revision=20224
This commit is contained in:
Thomas Bluemel 2005-12-17 15:45:59 +00:00
parent 56c1699b7b
commit b89c461211
17 changed files with 53 additions and 53 deletions

View file

@ -1639,10 +1639,10 @@ NTSYSAPI
BOOLEAN BOOLEAN
NTAPI NTAPI
RtlDosPathNameToNtPathName_U( RtlDosPathNameToNtPathName_U(
PWSTR DosName, IN PCWSTR DosPathName,
PUNICODE_STRING NtName, OUT PUNICODE_STRING NtPathName,
PWSTR *ShortName, OUT PCWSTR *NtFileNamePart,
PCURDIR CurrentDirectory OUT CURDIR *DirectoryInfo
); );
NTSYSAPI NTSYSAPI

View file

@ -2586,7 +2586,7 @@ RegLoadKeyW (HKEY hKey,
return RtlNtStatusToDosError (Status); return RtlNtStatusToDosError (Status);
} }
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFile, if (!RtlDosPathNameToNtPathName_U (lpFile,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))
@ -3858,7 +3858,7 @@ RegReplaceKeyW (HKEY hKey,
} }
/* Convert new file name */ /* Convert new file name */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpNewFile, if (!RtlDosPathNameToNtPathName_U (lpNewFile,
&NewFileName, &NewFileName,
NULL, NULL,
NULL)) NULL))
@ -3878,7 +3878,7 @@ RegReplaceKeyW (HKEY hKey,
NULL); NULL);
/* Convert old file name */ /* Convert old file name */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpOldFile, if (!RtlDosPathNameToNtPathName_U (lpOldFile,
&OldFileName, &OldFileName,
NULL, NULL,
NULL)) NULL))
@ -3977,7 +3977,7 @@ RegRestoreKeyW (HKEY hKey,
return RtlNtStatusToDosError (Status); return RtlNtStatusToDosError (Status);
} }
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFile, if (!RtlDosPathNameToNtPathName_U (lpFile,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))
@ -4070,7 +4070,7 @@ RegSaveKeyW (HKEY hKey,
return RtlNtStatusToDosError (Status); return RtlNtStatusToDosError (Status);
} }
if (!RtlDosPathNameToNtPathName_U ((PWSTR)lpFile, if (!RtlDosPathNameToNtPathName_U (lpFile,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))

View file

@ -221,7 +221,7 @@ GetFileSecurityW(LPCWSTR lpFileName,
AccessMask |= ACCESS_SYSTEM_SECURITY; AccessMask |= ACCESS_SYSTEM_SECURITY;
} }
if (!RtlDosPathNameToNtPathName_U((LPWSTR)lpFileName, if (!RtlDosPathNameToNtPathName_U(lpFileName,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))
@ -365,7 +365,7 @@ SetFileSecurityW (LPCWSTR lpFileName,
AccessMask |= ACCESS_SYSTEM_SECURITY; AccessMask |= ACCESS_SYSTEM_SECURITY;
} }
if (!RtlDosPathNameToNtPathName_U((LPWSTR)lpFileName, if (!RtlDosPathNameToNtPathName_U(lpFileName,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))

View file

@ -70,7 +70,7 @@ FindFirstChangeNotificationW (
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE hDir; HANDLE hDir;
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpPathName, if (!RtlDosPathNameToNtPathName_U (lpPathName,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))

View file

@ -105,7 +105,7 @@ HANDLE STDCALL CreateFileW (LPCWSTR lpFileName,
} }
/* validate & translate the filename */ /* validate & translate the filename */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFileName, if (!RtlDosPathNameToNtPathName_U (lpFileName,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))
@ -437,7 +437,7 @@ CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName,
case DEVICE_PATH: case DEVICE_PATH:
case UNC_DOT_PATH: case UNC_DOT_PATH:
default: default:
if(!RtlDosPathNameToNtPathName_U((LPWSTR)lpTargetFileName, &TargetFileName, NULL, NULL)) if(!RtlDosPathNameToNtPathName_U(lpTargetFileName, &TargetFileName, NULL, NULL))
{ {
dwErr = ERROR_INVALID_PARAMETER; dwErr = ERROR_INVALID_PARAMETER;
goto Cleanup; goto Cleanup;
@ -475,7 +475,7 @@ CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName,
if(bRelativePath) if(bRelativePath)
pReparseData->SymbolicLinkReparseBuffer.Flags |= 1; // TODO! give this lone flag a name pReparseData->SymbolicLinkReparseBuffer.Flags |= 1; // TODO! give this lone flag a name
if(!RtlDosPathNameToNtPathName_U((LPWSTR)lpSymlinkFileName, &SymlinkFileName, NULL, NULL)) if(!RtlDosPathNameToNtPathName_U(lpSymlinkFileName, &SymlinkFileName, NULL, NULL))
{ {
dwErr = ERROR_PATH_NOT_FOUND; dwErr = ERROR_PATH_NOT_FOUND;
goto Cleanup; goto Cleanup;

View file

@ -55,7 +55,7 @@ DeleteFileW (
DPRINT("DeleteFileW (lpFileName %S)\n",lpFileName); DPRINT("DeleteFileW (lpFileName %S)\n",lpFileName);
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFileName, if (!RtlDosPathNameToNtPathName_U (lpFileName,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))

View file

@ -100,7 +100,7 @@ CreateDirectoryW (
DPRINT ("lpPathName %S lpSecurityAttributes %p\n", DPRINT ("lpPathName %S lpSecurityAttributes %p\n",
lpPathName, lpSecurityAttributes); lpPathName, lpSecurityAttributes);
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpPathName, if (!RtlDosPathNameToNtPathName_U (lpPathName,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))
@ -182,7 +182,7 @@ CreateDirectoryExW (
* Translate the template directory path * Translate the template directory path
*/ */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpTemplateDirectory, if (!RtlDosPathNameToNtPathName_U (lpTemplateDirectory,
&NtTemplatePathU, &NtTemplatePathU,
NULL, NULL,
NULL)) NULL))
@ -239,7 +239,7 @@ OpenTemplateDir:
* Translate the new directory path and check if they're the same * Translate the new directory path and check if they're the same
*/ */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpNewDirectory, if (!RtlDosPathNameToNtPathName_U (lpNewDirectory,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))
@ -526,7 +526,7 @@ RemoveDirectoryW (
DPRINT("lpPathName %S\n", lpPathName); DPRINT("lpPathName %S\n", lpPathName);
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpPathName, if (!RtlDosPathNameToNtPathName_U (lpPathName,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))

View file

@ -296,7 +296,7 @@ OpenFile(LPCSTR lpFileName,
else else
RtlUnicodeStringToOemString (&FileName, &FileNameU, FALSE); RtlUnicodeStringToOemString (&FileName, &FileNameU, FALSE);
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)PathNameW, if (!RtlDosPathNameToNtPathName_U (PathNameW,
&FileNameString, &FileNameString,
NULL, NULL,
NULL)) NULL))
@ -849,7 +849,7 @@ GetFileAttributesExW(LPCWSTR lpFileName,
} }
/* Validate and translate the filename */ /* Validate and translate the filename */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFileName, if (!RtlDosPathNameToNtPathName_U (lpFileName,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))
@ -1061,7 +1061,7 @@ SetFileAttributesW(LPCWSTR lpFileName,
DPRINT ("SetFileAttributeW(%S, 0x%lx) called\n", lpFileName, dwFileAttributes); DPRINT ("SetFileAttributeW(%S, 0x%lx) called\n", lpFileName, dwFileAttributes);
/* Validate and translate the filename */ /* Validate and translate the filename */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFileName, if (!RtlDosPathNameToNtPathName_U (lpFileName,
&FileName, &FileName,
NULL, NULL,
NULL)) NULL))

View file

@ -279,7 +279,7 @@ InternalFindFirstFile (
SearchPath[Length] = 0; SearchPath[Length] = 0;
} }
bResult = RtlDosPathNameToNtPathName_U ((LPWSTR)SearchPath, bResult = RtlDosPathNameToNtPathName_U (SearchPath,
&NtPathU, &NtPathU,
NULL, NULL,
NULL); NULL);

View file

@ -51,7 +51,7 @@ CreateHardLinkW(LPCWSTR lpFileName,
return FALSE; return FALSE;
} }
if(RtlDosPathNameToNtPathName_U((LPWSTR)lpExistingFileName, &LinkTarget, NULL, NULL)) if(RtlDosPathNameToNtPathName_U(lpExistingFileName, &LinkTarget, NULL, NULL))
{ {
ULONG NeededSize = RtlGetFullPathName_U((LPWSTR)lpExistingFileName, 0, NULL, NULL); ULONG NeededSize = RtlGetFullPathName_U((LPWSTR)lpExistingFileName, 0, NULL, NULL);
if(NeededSize > 0) if(NeededSize > 0)
@ -108,7 +108,7 @@ CreateHardLinkW(LPCWSTR lpFileName,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT); FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT);
if(NT_SUCCESS(Status)) if(NT_SUCCESS(Status))
{ {
if(RtlDosPathNameToNtPathName_U((LPWSTR)lpFileName, &LinkName, NULL, NULL)) if(RtlDosPathNameToNtPathName_U(lpFileName, &LinkName, NULL, NULL))
{ {
NeededSize = sizeof(FILE_LINK_INFORMATION) + LinkName.Length + sizeof(WCHAR); NeededSize = sizeof(FILE_LINK_INFORMATION) + LinkName.Length + sizeof(WCHAR);
LinkInformation = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, NeededSize); LinkInformation = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, NeededSize);

View file

@ -63,7 +63,7 @@ CreateMailslotW(LPCWSTR lpName,
ULONG Attributes = OBJ_CASE_INSENSITIVE; ULONG Attributes = OBJ_CASE_INSENSITIVE;
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL; PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName, Result = RtlDosPathNameToNtPathName_U(lpName,
&MailslotName, &MailslotName,
NULL, NULL,
NULL); NULL);

View file

@ -91,13 +91,13 @@ static BOOL add_boot_rename_entry( LPCWSTR source, LPCWSTR dest, DWORD flags )
DPRINT("Add support to smss for keys created by MOVEFILE_DELAY_UNTIL_REBOOT\n"); DPRINT("Add support to smss for keys created by MOVEFILE_DELAY_UNTIL_REBOOT\n");
if (!RtlDosPathNameToNtPathName_U( (LPWSTR)source, &source_name, NULL, NULL )) if (!RtlDosPathNameToNtPathName_U( source, &source_name, NULL, NULL ))
{ {
SetLastError( ERROR_PATH_NOT_FOUND ); SetLastError( ERROR_PATH_NOT_FOUND );
return FALSE; return FALSE;
} }
dest_name.Buffer = NULL; dest_name.Buffer = NULL;
if (dest && !RtlDosPathNameToNtPathName_U( (LPWSTR)dest, &dest_name, NULL, NULL )) if (dest && !RtlDosPathNameToNtPathName_U( dest, &dest_name, NULL, NULL ))
{ {
RtlFreeUnicodeString( &source_name ); RtlFreeUnicodeString( &source_name );
SetLastError( ERROR_PATH_NOT_FOUND ); SetLastError( ERROR_PATH_NOT_FOUND );
@ -224,7 +224,7 @@ MoveFileWithProgressW (
/* validate & translate the filename */ /* validate & translate the filename */
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpNewFileName, if (!RtlDosPathNameToNtPathName_U (lpNewFileName,
&DstPathU, &DstPathU,
NULL, NULL,
NULL)) NULL))

View file

@ -90,7 +90,7 @@ CreateNamedPipeW(LPCWSTR lpName,
if (nMaxInstances == PIPE_UNLIMITED_INSTANCES) nMaxInstances = -1; if (nMaxInstances == PIPE_UNLIMITED_INSTANCES) nMaxInstances = -1;
/* Convert the name */ /* Convert the name */
Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName, Result = RtlDosPathNameToNtPathName_U(lpName,
&NamedPipeName, &NamedPipeName,
NULL, NULL,
NULL); NULL);
@ -464,7 +464,7 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
HANDLE FileHandle; HANDLE FileHandle;
IO_STATUS_BLOCK Iosb; IO_STATUS_BLOCK Iosb;
r = RtlDosPathNameToNtPathName_U((LPWSTR)lpNamedPipeName, r = RtlDosPathNameToNtPathName_U(lpNamedPipeName,
&NamedPipeName, &NamedPipeName,
NULL, NULL,
NULL); NULL);

View file

@ -38,7 +38,7 @@ InternalOpenDirW(LPCWSTR DirName,
IO_STATUS_BLOCK IoStatusBlock; IO_STATUS_BLOCK IoStatusBlock;
HANDLE hFile; HANDLE hFile;
if (!RtlDosPathNameToNtPathName_U((LPWSTR)DirName, if (!RtlDosPathNameToNtPathName_U(DirName,
&NtPathU, &NtPathU,
NULL, NULL,
NULL)) NULL))

View file

@ -412,7 +412,7 @@ BasepMapFile(IN LPCWSTR lpApplicationName,
RelativeName.Handle = NULL; RelativeName.Handle = NULL;
/* Find the application name */ /* Find the application name */
RtlDosPathNameToNtPathName_U((LPWSTR)lpApplicationName, RtlDosPathNameToNtPathName_U(lpApplicationName,
ApplicationName, ApplicationName,
NULL, NULL,
&RelativeName); &RelativeName);

View file

@ -675,10 +675,10 @@ DWORD NTAPI RtlGetFullPathName_U(
* @implemented * @implemented
*/ */
BOOLEAN NTAPI BOOLEAN NTAPI
RtlDosPathNameToNtPathName_U(PWSTR dosname, RtlDosPathNameToNtPathName_U(IN PCWSTR DosPathName,
PUNICODE_STRING ntname, OUT PUNICODE_STRING NtPathName,
PWSTR *FilePart, OUT PCWSTR *NtFileNamePart,
PCURDIR nah) OUT CURDIR *DirectoryInfo)
{ {
UNICODE_STRING us; UNICODE_STRING us;
PCURDIR cd; PCURDIR cd;
@ -693,7 +693,7 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname,
RtlAcquirePebLock (); RtlAcquirePebLock ();
RtlInitUnicodeString (&us, dosname); RtlInitUnicodeString (&us, DosPathName);
if (us.Length > 8) if (us.Length > 8)
{ {
Buffer = us.Buffer; Buffer = us.Buffer;
@ -721,10 +721,10 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname,
return FALSE; return FALSE;
} }
Size = RtlGetFullPathName_U (dosname, Size = RtlGetFullPathName_U (DosPathName,
sizeof(fullname), sizeof(fullname),
fullname, fullname,
FilePart); (PWSTR*)NtFileNamePart);
if (Size == 0 || Size > MAX_PATH * sizeof(WCHAR)) if (Size == 0 || Size > MAX_PATH * sizeof(WCHAR))
{ {
RtlFreeHeap (RtlGetProcessHeap (), RtlFreeHeap (RtlGetProcessHeap (),
@ -763,18 +763,18 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname,
} }
/* set NT filename */ /* set NT filename */
ntname->Length = Length * sizeof(WCHAR); NtPathName->Length = Length * sizeof(WCHAR);
ntname->MaximumLength = sizeof(fullname) + MAX_PFX_SIZE; NtPathName->MaximumLength = sizeof(fullname) + MAX_PFX_SIZE;
ntname->Buffer = Buffer; NtPathName->Buffer = Buffer;
/* set pointer to file part if possible */ /* set pointer to file part if possible */
if (FilePart && *FilePart) if (NtFileNamePart && *NtFileNamePart)
*FilePart = Buffer + Length - wcslen (*FilePart); *NtFileNamePart = Buffer + Length - wcslen (*NtFileNamePart);
/* Set name and handle structure if possible */ /* Set name and handle structure if possible */
if (nah) if (DirectoryInfo)
{ {
memset (nah, 0, sizeof(CURDIR)); memset (DirectoryInfo, 0, sizeof(CURDIR));
cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectory.DosPath); cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectory.DosPath);
if (Type == 5 && cd->Handle) if (Type == 5 && cd->Handle)
{ {
@ -782,10 +782,10 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname,
if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE)) if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE))
{ {
Length = ((cd->DosPath.Length / sizeof(WCHAR)) - Offset) + ((Type == 1) ? 8 : 4); Length = ((cd->DosPath.Length / sizeof(WCHAR)) - Offset) + ((Type == 1) ? 8 : 4);
nah->DosPath.Buffer = Buffer + Length; DirectoryInfo->DosPath.Buffer = Buffer + Length;
nah->DosPath.Length = ntname->Length - (Length * sizeof(WCHAR)); DirectoryInfo->DosPath.Length = NtPathName->Length - (Length * sizeof(WCHAR));
nah->DosPath.MaximumLength = nah->DosPath.Length; DirectoryInfo->DosPath.MaximumLength = DirectoryInfo->DosPath.Length;
nah->Handle = cd->Handle; DirectoryInfo->Handle = cd->Handle;
} }
} }
} }

View file

@ -1965,7 +1965,7 @@ void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER); NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR); DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR); BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*); BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PCWSTR*,CURDIR*);
ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*); ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR); WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN); NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);