ChangeLog: simple test for DosPathName2NtPathName_U
--- /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); +} + --- /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); +} +