Author: ion
Date: Thu Jul 14 15:33:29 2011
New Revision: 52681
URL:
http://svn.reactos.org/svn/reactos?rev=52681&view=rev
Log:
[RTL]: Fix prototype of RtlDosPathNameToNtPathName_U and fix code to match the new
prototype.
[NDK]: Add RTL_RELATIVE_NAME_U which is the Windows 2003+ structure used instead of CURDIR
for all relative path APIs.
Modified:
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/include/ndk/rtltypes.h
trunk/reactos/lib/rtl/path.c
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Thu Jul 14 15:33:29 2011
@@ -2348,7 +2348,7 @@
IN PCWSTR DosPathName,
OUT PUNICODE_STRING NtPathName,
OUT PCWSTR *NtFileNamePart,
- OUT CURDIR *DirectoryInfo
+ OUT PRTL_RELATIVE_NAME_U DirectoryInfo
);
NTSYSAPI
@@ -2377,18 +2377,6 @@
IN ULONG Size,
IN PWSTR Buffer,
OUT PWSTR *ShortName
-);
-
-NTSYSAPI
-ULONG
-NTAPI
-RtlGetFullPathName_Ustr(
- IN PUNICODE_STRING FileName,
- IN ULONG Size,
- IN PWSTR Buffer,
- OUT PWSTR *ShortName,
- OUT PBOOLEAN InvalidName,
- OUT RTL_PATH_TYPE *PathType
);
NTSYSAPI
Modified: trunk/reactos/include/ndk/rtltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtltypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] Thu Jul 14 15:33:29 2011
@@ -1016,6 +1016,14 @@
UNICODE_STRING DosPath;
HANDLE Handle;
} CURDIR, *PCURDIR;
+
+typedef struct _RTLP_CURDIR_REF *PRTLP_CURDIR_REF;
+typedef struct _RTL_RELATIVE_NAME_U
+{
+ UNICODE_STRING RelativeName;
+ HANDLE ContainingDirectory;
+ PRTLP_CURDIR_REF CurDirRef;
+} RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U;
typedef struct _RTL_DRIVE_LETTER_CURDIR
{
Modified: trunk/reactos/lib/rtl/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=52681&a…
==============================================================================
--- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Thu Jul 14 15:33:29 2011
@@ -669,7 +669,7 @@
RtlDosPathNameToNtPathName_U(IN PCWSTR DosPathName,
OUT PUNICODE_STRING NtPathName,
OUT PCWSTR *NtFileNamePart,
- OUT CURDIR *DirectoryInfo)
+ OUT PRTL_RELATIVE_NAME_U DirectoryInfo)
{
UNICODE_STRING us;
PCURDIR cd;
@@ -731,10 +731,10 @@
if (DirectoryInfo != NULL)
{
- DirectoryInfo->DosPath.Length = 0;
- DirectoryInfo->DosPath.MaximumLength = 0;
- DirectoryInfo->DosPath.Buffer = NULL;
- DirectoryInfo->Handle = NULL;
+ DirectoryInfo->RelativeName.Length = 0;
+ DirectoryInfo->RelativeName.MaximumLength = 0;
+ DirectoryInfo->RelativeName.Buffer = NULL;
+ DirectoryInfo->ContainingDirectory = NULL;
}
return TRUE;
@@ -804,7 +804,7 @@
/* Set name and handle structure if possible */
if (DirectoryInfo)
{
- memset (DirectoryInfo, 0, sizeof(CURDIR));
+ memset (DirectoryInfo, 0, sizeof(RTL_RELATIVE_NAME_U));
cd = (PCURDIR)&(NtCurrentPeb
()->ProcessParameters->CurrentDirectory.DosPath);
if (Type == 5 && cd->Handle)
{
@@ -812,10 +812,10 @@
if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE))
{
Length = ((cd->DosPath.Length / sizeof(WCHAR)) - Offset) + ((Type == 1) ? 8 : 4);
- DirectoryInfo->DosPath.Buffer = Buffer + Length;
- DirectoryInfo->DosPath.Length = NtPathName->Length - (Length * sizeof(WCHAR));
- DirectoryInfo->DosPath.MaximumLength = DirectoryInfo->DosPath.Length;
- DirectoryInfo->Handle = cd->Handle;
+ DirectoryInfo->RelativeName.Buffer = Buffer + Length;
+ DirectoryInfo->RelativeName.Length = NtPathName->Length - (Length *
sizeof(WCHAR));
+ DirectoryInfo->RelativeName.MaximumLength = DirectoryInfo->RelativeName.Length;
+ DirectoryInfo->ContainingDirectory = cd->Handle;
}
}
}
@@ -914,23 +914,23 @@
OBJECT_ATTRIBUTES Attr;
FILE_BASIC_INFORMATION Info;
NTSTATUS Status;
- CURDIR CurDir;
+ RTL_RELATIVE_NAME_U RelativeName;
if (!RtlDosPathNameToNtPathName_U (FileName,
&NtFileName,
NULL,
- &CurDir))
+ &RelativeName))
return FALSE;
- if (CurDir.DosPath.Length)
- NtFileName = CurDir.DosPath;
+ if (RelativeName.RelativeName.Length)
+ NtFileName = RelativeName.RelativeName;
else
- CurDir.Handle = 0;
+ RelativeName.ContainingDirectory = 0;
InitializeObjectAttributes (&Attr,
&NtFileName,
OBJ_CASE_INSENSITIVE,
- CurDir.Handle,
+ RelativeName.ContainingDirectory,
NULL);
Status = ZwQueryAttributesFile (&Attr, &Info);