Partial implementation of RtlDosPathNameToNtPathName_U

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




ChangeLog:
Partial implementation of RtlDosPathNameToNtPathName_U
Index: dlls/ntdll/rtl.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/rtl.c,v
retrieving revision 1.50
diff -u -w -r1.50 rtl.c
--- dlls/ntdll/rtl.c	12 Sep 2002 22:07:03 -0000	1.50
+++ dlls/ntdll/rtl.c	10 Nov 2002 23:54:51 -0000
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "wine/debug.h"
+#include "wine/unicode.h"
 #include "windef.h"
 #include "winerror.h"
 #include "stackframe.h"
@@ -335,13 +336,48 @@
 /**************************************************************************
  *                 RtlDosPathNameToNtPathName_U		[NTDLL.@]
  *
- * FIXME: convert to UNC or whatever is expected here
+ * szwDosPath: a fully qualified DOS path name
+ * ntpath:     pointer to a UNICODE_STRING to hold the converted
+ *              path name
+ *
+ * FIXME: Should we not allocate the ntpath buffer under some
+ *         circumstances?
+ *        Are the conversions static? (always prepend '\??\' ?)
+ *        Not really sure about the last two arguments.
  */
 BOOLEAN  WINAPI RtlDosPathNameToNtPathName_U(
-	LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3)
+	LPWSTR szwDosPath,PUNICODE_STRING ntpath,
+	BOOLEAN AllocFlag,PUNICODE_STRING reserved)
 {
-    FIXME("(%s,%p,%08lx,%08lx)\n",debugstr_w(from),us,x2,x3);
-    if (us) RtlCreateUnicodeString( us, from );
+    ULONG length;
+    UNICODE_STRING pathprefix;
+    WCHAR szPrefix[] = { '\\', '?', '?', '\\', 0 };
+
+    FIXME("(%s,%p,%08x,%p) partial stub\n",
+        debugstr_w(szwDosPath),ntpath,AllocFlag,reserved);
+
+    if ( !szwDosPath )
+        return FALSE;
+
+    if ( !szwDosPath[0] )
+        return FALSE;
+ 
+    if ( szwDosPath[1]!= ':' )
+        return FALSE;
+
+    length = strlenW(szwDosPath) * sizeof (WCHAR) + sizeof szPrefix;
+ 
+    ntpath->Buffer = RtlAllocateHeap(GetProcessHeap(), 0, length);
+    ntpath->Length = 0;
+    ntpath->MaximumLength = length;
+
+    if ( !ntpath->Buffer )
+        return FALSE;
+
+    RtlInitUnicodeString( &pathprefix, szPrefix );
+    RtlCopyUnicodeString( ntpath, &pathprefix );
+    RtlAppendUnicodeToString( ntpath, szwDosPath );
+
     return TRUE;
 }
 
Index: include/winternl.h
===================================================================
RCS file: /home/wine/wine/include/winternl.h,v
retrieving revision 1.6
diff -u -w -r1.6 winternl.h
--- include/winternl.h	25 Oct 2002 19:14:29 -0000	1.6
+++ include/winternl.h	10 Nov 2002 23:54:52 -0000
@@ -857,7 +857,7 @@
 DWORD     WINAPI RtlDeleteSecurityObject(DWORD);
 DWORD     WINAPI RtlDestroyEnvironment(DWORD);
 HANDLE    WINAPI RtlDestroyHeap(HANDLE);
-BOOLEAN   WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,DWORD,DWORD);
+BOOLEAN   WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,BOOLEAN,PUNICODE_STRING);
 void      WINAPI RtlDumpResource(LPRTL_RWLOCK);
 
 LONGLONG  WINAPI RtlEnlargedIntegerMultiply(INT,INT);

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux