simple test for DosPathName2NtPathName_U (take 2)
Mike McCormack
mike at codeweavers.com
Tue Nov 12 23:35:21 CST 2002
ChangeLog:
simple test for DosPathName2NtPathName_U
-------------- next part --------------
Index: dlls/ntdll/tests/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tests/Makefile.in,v
retrieving revision 1.4
diff -u -r1.4 Makefile.in
--- dlls/ntdll/tests/Makefile.in 12 Nov 2002 02:18:10 -0000 1.4
+++ dlls/ntdll/tests/Makefile.in 13 Nov 2002 05:32:52 -0000
@@ -6,6 +6,7 @@
IMPORTS = ntdll
CTESTS = \
+ dos2ntpath.c \
error.c \
generated.c \
rtlbitmap.c \
--- /dev/null Mon Jul 18 08:46:18 1994
+++ dlls/ntdll/tests/dos2ntpath.c Tue Nov 12 14:42:11 2002
@@ -0,0 +1,70 @@
+/* Unit test suite for RtlDosPathNameToNtPathName_U
+ *
+ * Copyright 2002 Mike McCormack
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "winbase.h"
+#include "winnt.h"
+#include "wine/test.h"
+
+#include "pshpack1.h"
+
+typedef struct _UNICODE_STRING {
+ USHORT Length;
+ USHORT MaximumLength;
+ PWSTR Buffer;
+} UNICODE_STRING, *PUNICODE_STRING;
+
+#include "poppack.h"
+
+typedef BOOLEAN (WINAPI *fnRtlDosPathNameToNtPathName_U)
+ (LPWSTR, PUNICODE_STRING,DWORD,DWORD);
+typedef VOID (WINAPI *fnRtlFreeUnicodeString)
+ (PUNICODE_STRING);
+fnRtlDosPathNameToNtPathName_U RtlDosPathNameToNtPathName_U;
+fnRtlFreeUnicodeString RtlFreeUnicodeString;
+HMODULE hntdll;
+
+START_TEST(dos2ntpath)
+{
+ UNICODE_STRING name;
+ WCHAR szwCslash[] = { 'C',':','\\',0 };
+ WCHAR szwResult[] = { '\\','?','?','\\','C',':','\\', 0};
+ DWORD r;
+
+ /* get a pointer to the function to test */
+ hntdll = LoadLibrary("ntdll.dll");
+ ok( (DWORD) hntdll, "no ntdll" );
+
+ RtlDosPathNameToNtPathName_U = (fnRtlDosPathNameToNtPathName_U)
+ GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U");
+ ok( (DWORD) RtlDosPathNameToNtPathName_U,
+ "RtlDosPathNameToNtPathName_U missing\n");
+
+ RtlFreeUnicodeString = (fnRtlFreeUnicodeString)
+ GetProcAddress(hntdll, "RtlFreeUnicodeString");
+ ok( (DWORD) RtlFreeUnicodeString,"RtlFreeUnicodeString missing\n");
+
+ r = RtlDosPathNameToNtPathName_U(szwCslash,&name,0,0);
+
+ ok(r, "failed\n");
+
+ ok(!lstrcmpW(name.Buffer, szwResult),"Differs!\n");
+
+ RtlFreeUnicodeString(&name);
+}
+
More information about the wine-patches
mailing list