1c2c66affSColin Finck /*
2c2c66affSColin Finck  * PROJECT:     ReactOS api tests
3*2eb96f0cSMark Jansen  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4c2c66affSColin Finck  * PURPOSE:     Test for RtlNtPathNameToDosPathName
5*2eb96f0cSMark Jansen  * COPYRIGHT:   Copyright 2017-2020 Mark Jansen (mark.jansen@reactos.org)
6c2c66affSColin Finck  */
7c2c66affSColin Finck 
8283bbe73SAmine Khaldi #include "precomp.h"
9c2c66affSColin Finck 
10c2c66affSColin Finck NTSTATUS (NTAPI *pRtlNtPathNameToDosPathName)(ULONG Flags, PRTL_UNICODE_STRING_BUFFER Path, PULONG Type, PULONG Unknown4);
11c2c66affSColin Finck 
12*2eb96f0cSMark Jansen #define ok_hex2(expression, result) \
13c2c66affSColin Finck     do { \
14c2c66affSColin Finck         int _value = (expression); \
15c2c66affSColin Finck         winetest_ok(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \
16c2c66affSColin Finck            #expression, (int)(result), _value); \
17c2c66affSColin Finck     } while (0)
18c2c66affSColin Finck 
19c2c66affSColin Finck 
20*2eb96f0cSMark Jansen #define ok_ptr2(expression, result) \
21c2c66affSColin Finck     do { \
22c2c66affSColin Finck         void *_value = (expression); \
23c2c66affSColin Finck         winetest_ok(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \
24c2c66affSColin Finck            #expression, (void*)(result), _value); \
25c2c66affSColin Finck     } while (0)
26c2c66affSColin Finck 
27*2eb96f0cSMark Jansen #define ok_wstr2(x, y) \
28c2c66affSColin Finck     winetest_ok(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x)
29c2c66affSColin Finck 
30c2c66affSColin Finck 
31c2c66affSColin Finck 
32c2c66affSColin Finck struct test_entry
33c2c66affSColin Finck {
34c2c66affSColin Finck     WCHAR* InputPath;
35c2c66affSColin Finck     WCHAR* OutputPath;
36c2c66affSColin Finck     ULONG Type;
37c2c66affSColin Finck 
38c2c66affSColin Finck     const char* File;
39c2c66affSColin Finck     int Line;
40c2c66affSColin Finck };
41c2c66affSColin Finck 
42c2c66affSColin Finck 
43c2c66affSColin Finck static struct test_entry test_data[] =
44c2c66affSColin Finck {
45c2c66affSColin Finck     /* Originally from RtlGetFullPathName_*.c (edited) */
46c2c66affSColin Finck     { L"",                      L"",                            RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
47c2c66affSColin Finck     { L".\\test",               L".\\test",                     RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
48c2c66affSColin Finck     { L"/test",                 L"/test",                       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
49c2c66affSColin Finck     { L"??\\",                  L"??\\",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
50c2c66affSColin Finck     { L"??\\C:",                L"??\\C:",                      RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
51c2c66affSColin Finck     { L"??\\C:\\",              L"??\\C:\\",                    RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
52c2c66affSColin Finck     { L"??\\C:\\test",          L"??\\C:\\test",                RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
53c2c66affSColin Finck     { L"??\\C:\\test\\",        L"??\\C:\\test\\",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
54c2c66affSColin Finck     { L"C:",                    L"C:",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
55c2c66affSColin Finck     { L"C:/test/",              L"C:/test/",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
56c2c66affSColin Finck     { L"C:\\",                  L"C:\\",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
57c2c66affSColin Finck     { L"C:\\",                  L"C:\\",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
58c2c66affSColin Finck     { L"C:\\\\test",            L"C:\\\\test",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
59c2c66affSColin Finck     { L"C:\\test",              L"C:\\test",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
60c2c66affSColin Finck     { L"C:\\test",              L"C:\\test",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
61c2c66affSColin Finck     { L"C:\\test",              L"C:\\test",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
62c2c66affSColin Finck     { L"C:\\test\\",            L"C:\\test\\",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
63c2c66affSColin Finck     { L"C:\\test\\",            L"C:\\test\\",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
64c2c66affSColin Finck     { L"C:\\test\\",            L"C:\\test\\",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
65c2c66affSColin Finck     { L"\\.",                   L"\\.",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
66c2c66affSColin Finck     { L"\\.\\",                 L"\\.\\",                       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
67c2c66affSColin Finck     { L"\\??\\",                L"",                            RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
68c2c66affSColin Finck     { L"\\??\\C:",              L"C:",                          RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
69c2c66affSColin Finck     { L"\\??\\C:\\",            L"C:\\",                        RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
70c2c66affSColin Finck     { L"\\??\\C:\\test",        L"C:\\test",                    RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
71c2c66affSColin Finck     { L"\\??\\C:\\test\\",      L"C:\\test\\",                  RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
72c2c66affSColin Finck     { L"\\\\.",                 L"\\\\.",                       RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
73c2c66affSColin Finck     { L"\\\\.\\",               L"\\\\.\\",                     RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
74c2c66affSColin Finck     { L"\\\\.\\",               L"\\\\.\\",                     RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
75c2c66affSColin Finck     { L"\\\\.\\",               L"\\\\.\\",                     RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
76c2c66affSColin Finck     { L"\\\\.\\Something\\",    L"\\\\.\\Something\\",          RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
77c2c66affSColin Finck     { L"\\\\.\\Something\\",    L"\\\\.\\Something\\",          RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
78c2c66affSColin Finck     { L"\\\\??\\",              L"\\\\??\\",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
79c2c66affSColin Finck     { L"\\\\??\\",              L"\\\\??\\",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
80c2c66affSColin Finck     { L"\\\\??\\C:",            L"\\\\??\\C:",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
81c2c66affSColin Finck     { L"\\\\??\\C:",            L"\\\\??\\C:",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
82c2c66affSColin Finck     { L"\\\\??\\C:\\",          L"\\\\??\\C:\\",                RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
83c2c66affSColin Finck     { L"\\\\??\\C:\\",          L"\\\\??\\C:\\",                RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
84c2c66affSColin Finck     { L"\\\\??\\C:\\test",      L"\\\\??\\C:\\test",            RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
85c2c66affSColin Finck     { L"\\\\??\\C:\\test",      L"\\\\??\\C:\\test",            RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
86c2c66affSColin Finck     { L"\\\\??\\C:\\test\\",    L"\\\\??\\C:\\test\\",          RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
87c2c66affSColin Finck     { L"\\\\??\\C:\\test\\",    L"\\\\??\\C:\\test\\",          RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
88c2c66affSColin Finck     { L"\\test",                L"\\test",                      RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
89c2c66affSColin Finck     { L"\\test",                L"\\test",                      RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
90c2c66affSColin Finck     { L"\\test",                L"\\test",                      RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
91c2c66affSColin Finck     { L"test",                  L"test",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
92c2c66affSColin Finck     { L"test",                  L"test",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
93c2c66affSColin Finck     { L"test",                  L"test",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
94c2c66affSColin Finck 
95c2c66affSColin Finck     /* Originally from RtlDetermineDosPathNameType.c (edited) */
96c2c66affSColin Finck     { L"",                      L"",                            RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
97c2c66affSColin Finck     { L" ",                     L" ",                           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
98c2c66affSColin Finck     { L"xyz",                   L"xyz",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
99c2c66affSColin Finck     { L"CON",                   L"CON",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
100c2c66affSColin Finck     { L"NUL",                   L"NUL",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
101c2c66affSColin Finck     { L":",                     L":",                           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
102c2c66affSColin Finck     { L"::",                    L"::",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
103c2c66affSColin Finck     { L":::",                   L":::",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
104c2c66affSColin Finck     { L"::::",                  L"::::",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
105c2c66affSColin Finck     { L"::\\",                  L"::\\",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
106c2c66affSColin Finck     { L"\\",                    L"\\",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
107c2c66affSColin Finck     { L"\\:",                   L"\\:",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
108c2c66affSColin Finck     { L"\\C:",                  L"\\C:",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
109c2c66affSColin Finck     { L"\\C:\\",                L"\\C:\\",                      RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
110c2c66affSColin Finck     { L"/",                     L"/",                           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
111c2c66affSColin Finck     { L"/:",                    L"/:",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
112c2c66affSColin Finck     { L"/C:",                   L"/C:",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
113c2c66affSColin Finck     { L"/C:/",                  L"/C:/",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
114c2c66affSColin Finck     { L"C",                     L"C",                           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
115c2c66affSColin Finck     { L"C:",                    L"C:",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
116c2c66affSColin Finck     { L"C:a",                   L"C:a",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
117c2c66affSColin Finck     { L"C:a\\",                 L"C:a\\",                       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
118c2c66affSColin Finck     { L"C:\\",                  L"C:\\",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
119c2c66affSColin Finck     { L"C:/",                   L"C:/",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
120c2c66affSColin Finck     { L"C:\\a",                 L"C:\\a",                       RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
121c2c66affSColin Finck     { L"C:/a",                  L"C:/a",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
122c2c66affSColin Finck     { L"C:\\\\",                L"C:\\\\",                      RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
123c2c66affSColin Finck     { L"\\\\",                  L"\\\\",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
124c2c66affSColin Finck     { L"\\\\\\",                L"\\\\\\",                      RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
125c2c66affSColin Finck     { L"\\\\;",                 L"\\\\;",                       RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
126c2c66affSColin Finck     { L"\\\\f\\b\\",            L"\\\\f\\b\\",                  RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
127c2c66affSColin Finck     { L"\\\\f\\b",              L"\\\\f\\b",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
128c2c66affSColin Finck     { L"\\\\f\\",               L"\\\\f\\",                     RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
129c2c66affSColin Finck     { L"\\\\f",                 L"\\\\f",                       RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
130c2c66affSColin Finck     { L"\\??\\UNC",             L"UNC",                         RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
131c2c66affSColin Finck     { L"\\??\\UNC\\",           L"\\\\",                        RTL_CONVERTED_UNC_PATH,         __FILE__, __LINE__ },
132c2c66affSColin Finck     { L"\\??\\UNC\\pth1\\pth2", L"\\\\pth1\\pth2",              RTL_CONVERTED_UNC_PATH,         __FILE__, __LINE__ },
133c2c66affSColin Finck     { L"\\??\\UNC\\path1",      L"\\\\path1",                   RTL_CONVERTED_UNC_PATH,         __FILE__, __LINE__ },
134c2c66affSColin Finck     { L"\\?",                   L"\\?",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
135c2c66affSColin Finck     { L"\\?\\",                 L"\\?\\",                       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
136c2c66affSColin Finck     { L"\\?\\UNC",              L"\\?\\UNC",                    RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
137c2c66affSColin Finck     { L"\\?\\UNC\\",            L"\\?\\UNC\\",                  RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
138c2c66affSColin Finck     { L"\\\\?\\UNC\\",          L"\\\\?\\UNC\\",                RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
139c2c66affSColin Finck     { L"\\??\\unc",             L"unc",                         RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
140c2c66affSColin Finck     { L"\\??\\unc\\",           L"\\\\",                        RTL_CONVERTED_UNC_PATH,         __FILE__, __LINE__ },
141c2c66affSColin Finck     { L"\\??\\unc\\pth1\\pth2", L"\\\\pth1\\pth2",              RTL_CONVERTED_UNC_PATH,         __FILE__, __LINE__ },
142c2c66affSColin Finck     { L"\\??\\unc\\path1",      L"\\\\path1",                   RTL_CONVERTED_UNC_PATH,         __FILE__, __LINE__ },
143c2c66affSColin Finck     { L"\\?",                   L"\\?",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
144c2c66affSColin Finck     { L"\\?\\",                 L"\\?\\",                       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
145c2c66affSColin Finck     { L"\\?\\unc",              L"\\?\\unc",                    RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
146c2c66affSColin Finck     { L"\\?\\unc\\",            L"\\?\\unc\\",                  RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
147c2c66affSColin Finck     { L"\\\\?\\unc\\",          L"\\\\?\\unc\\",                RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
148c2c66affSColin Finck     { L"\\\\?",                 L"\\\\?",                       RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
149c2c66affSColin Finck     { L"\\\\??",                L"\\\\??",                      RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
150c2c66affSColin Finck     { L"\\\\??\\",              L"\\\\??\\",                    RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
151c2c66affSColin Finck     { L"\\\\??\\C:\\",          L"\\\\??\\C:\\",                RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
152c2c66affSColin Finck     { L"\\\\.",                 L"\\\\.",                       RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
153c2c66affSColin Finck     { L"\\\\.\\",               L"\\\\.\\",                     RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
154c2c66affSColin Finck     { L"\\\\.\\C:\\",           L"\\\\.\\C:\\",                 RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
155c2c66affSColin Finck     { L"\\/",                   L"\\/",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
156c2c66affSColin Finck     { L"/\\",                   L"/\\",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
157c2c66affSColin Finck     { L"//",                    L"//",                          RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
158c2c66affSColin Finck     { L"///",                   L"///",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
159c2c66affSColin Finck     { L"//;",                   L"//;",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
160c2c66affSColin Finck     { L"//?",                   L"//?",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
161c2c66affSColin Finck     { L"/\\?",                  L"/\\?",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
162c2c66affSColin Finck     { L"\\/?",                  L"\\/?",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
163c2c66affSColin Finck     { L"//??",                  L"//??",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
164c2c66affSColin Finck     { L"//?" L"?/",             L"//?" L"?/",                   RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
165c2c66affSColin Finck     { L"//?" L"?/C:/",          L"//?" L"?/C:/",                RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
166c2c66affSColin Finck     { L"//.",                   L"//.",                         RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
167c2c66affSColin Finck     { L"\\/.",                  L"\\/.",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
168c2c66affSColin Finck     { L"/\\.",                  L"/\\.",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
169c2c66affSColin Finck     { L"//./",                  L"//./",                        RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
170c2c66affSColin Finck     { L"//./C:/",               L"//./C:/",                     RTL_UNCHANGED_DOS_PATH,         __FILE__, __LINE__ },
171c2c66affSColin Finck     { L"%SystemRoot%",          L"%SystemRoot%",                RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
172c2c66affSColin Finck 
173c2c66affSColin Finck 
174c2c66affSColin Finck     /* Tests from RtlGetLengthWithoutTrailingPathSeperators.c */
175c2c66affSColin Finck     { L"",                      L"",                            RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
176c2c66affSColin Finck     { L"T",                     L"T",                           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
177c2c66affSColin Finck     { L"Te",                    L"Te",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
178c2c66affSColin Finck     { L"Tes",                   L"Tes",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
179c2c66affSColin Finck     { L"Test",                  L"Test",                        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
180c2c66affSColin Finck 
181c2c66affSColin Finck     /* Separators tests */
182c2c66affSColin Finck     { L"\\.",                   L"\\.",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
183c2c66affSColin Finck     { L"\\.",                   L"\\.",                         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
184c2c66affSColin Finck     { L"\\.\\",                 L"\\.\\",                       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
185c2c66affSColin Finck     { L"\\.\\T",                L"\\.\\T",                      RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
186c2c66affSColin Finck     { L"\\.\\Te",               L"\\.\\Te",                     RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
187c2c66affSColin Finck     { L"\\.\\Tes",              L"\\.\\Tes",                    RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
188c2c66affSColin Finck     { L"\\.\\Test",             L"\\.\\Test",                   RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
189c2c66affSColin Finck     { L"\\.\\Test\\",           L"\\.\\Test\\",                 RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
190c2c66affSColin Finck     { L"\\.\\Test\\s",          L"\\.\\Test\\s",                RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
191c2c66affSColin Finck     { L"\\.\\T\\est",           L"\\.\\T\\est",                 RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
192c2c66affSColin Finck     { L"\\.\\T\\e\\st",         L"\\.\\T\\e\\st",               RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
193c2c66affSColin Finck     { L"\\.\\T\\e\\s\\t",       L"\\.\\T\\e\\s\\t",             RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
194c2c66affSColin Finck     { L"\\.\\T\\e\\s\\t\\",     L"\\.\\T\\e\\s\\t\\",           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
195c2c66affSColin Finck     { L"\\Tests\\String\\",     L"\\Tests\\String\\",           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
196c2c66affSColin Finck     { L"\\.\\Test\\String\\",   L"\\.\\Test\\String\\",         RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
197c2c66affSColin Finck     { L"\\.\\Tests\\String\\",  L"\\.\\Tests\\String\\",        RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
198c2c66affSColin Finck     { L"\\.\\Tests\\String\\s", L"\\.\\Tests\\String\\s",       RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
199c2c66affSColin Finck 
200c2c66affSColin Finck     /* Separator-only tests */
201c2c66affSColin Finck     { L"\\",                    L"\\",                          RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
202c2c66affSColin Finck     { L"/",                     L"/",                           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
203c2c66affSColin Finck 
204c2c66affSColin Finck     /* Mixed separators tests */
205c2c66affSColin Finck     { L"/Test/String",          L"/Test/String",                RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
206c2c66affSColin Finck     { L"\\Test/String",         L"\\Test/String",               RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
207c2c66affSColin Finck     { L"/Test\\String",         L"/Test\\String",               RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
208c2c66affSColin Finck     { L"\\Test/String",         L"\\Test/String",               RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
209c2c66affSColin Finck     { L"/Test/String\\",        L"/Test/String\\",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
210c2c66affSColin Finck     { L"\\Test/String\\",       L"\\Test/String\\",             RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
211c2c66affSColin Finck     { L"/Test\\String\\",       L"/Test\\String\\",             RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
212c2c66affSColin Finck     { L"\\Test/String\\",       L"\\Test/String\\",             RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
213c2c66affSColin Finck     { L"/Test/String/",         L"/Test/String/",               RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
214c2c66affSColin Finck     { L"\\Test/String/",        L"\\Test/String/",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
215c2c66affSColin Finck     { L"/Test\\String/",        L"/Test\\String/",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
216c2c66affSColin Finck     { L"\\Test/String/",        L"\\Test/String/",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
217c2c66affSColin Finck     { L"\\Test/String/",        L"\\Test/String/",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
218c2c66affSColin Finck     { L"\\Test\\\\String/",     L"\\Test\\\\String/",           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
219c2c66affSColin Finck 
220c2c66affSColin Finck     /* Common path formats tests */
221c2c66affSColin Finck     { L"Test\\String",          L"Test\\String",                RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
222c2c66affSColin Finck     { L"\\Test\\String",        L"\\Test\\String",              RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
223c2c66affSColin Finck     { L".\\Test\\String",       L".\\Test\\String",             RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
224c2c66affSColin Finck     { L"\\.\\Test\\String",     L"\\.\\Test\\String",           RTL_UNCHANGED_UNK_PATH,         __FILE__, __LINE__ },
225c2c66affSColin Finck     { L"\\??\\Test\\String",    L"Test\\String",                RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
226c2c66affSColin Finck 
227c2c66affSColin Finck     /* Redundant trailing tests */
228c2c66affSColin Finck     { L"\\??\\Test\\String\\",  L"Test\\String\\",              RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
229c2c66affSColin Finck     { L"\\??\\Test\\String\\\\",L"Test\\String\\\\",            RTL_CONVERTED_NT_PATH,          __FILE__, __LINE__ },
230c2c66affSColin Finck     { L"\\??\\Test\\String\\\\\\\\\\", L"Test\\String\\\\\\\\\\",RTL_CONVERTED_NT_PATH,         __FILE__, __LINE__ },
231c2c66affSColin Finck };
232c2c66affSColin Finck 
233c2c66affSColin Finck 
test_specialhandling()234c2c66affSColin Finck static void test_specialhandling()
235c2c66affSColin Finck {
236c2c66affSColin Finck     RTL_UNICODE_STRING_BUFFER Buffer;
237c2c66affSColin Finck     const WCHAR TestString[] = L"\\??\\C:\\Test";
238c2c66affSColin Finck     WCHAR StaticBuffer[_countof(TestString)];
239c2c66affSColin Finck     ULONG Type;
240c2c66affSColin Finck     //PUCHAR Ptr;
241c2c66affSColin Finck 
242c2c66affSColin Finck     /* Just initializing the ByteBuffer does not work */
243c2c66affSColin Finck     memset(&Buffer, 0, sizeof(Buffer));
244c2c66affSColin Finck     RtlInitBuffer(&Buffer.ByteBuffer, (PUCHAR)StaticBuffer, sizeof(StaticBuffer));
245c2c66affSColin Finck     memcpy(StaticBuffer, TestString, sizeof(TestString));
246c2c66affSColin Finck     Type = 0x12345;
247c2c66affSColin Finck 
248c2c66affSColin Finck     ok_hex(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
249c2c66affSColin Finck     ok_hex(Type, RTL_UNCHANGED_UNK_PATH);
250c2c66affSColin Finck     ok_ptr(Buffer.String.Buffer, NULL);
251c2c66affSColin Finck     ok_int(Buffer.String.Length, 0);
252c2c66affSColin Finck     ok_int(Buffer.String.MaximumLength, 0);
253c2c66affSColin Finck     ok_ptr(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer);
254c2c66affSColin Finck     ok_int(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize);
255c2c66affSColin Finck     RtlFreeBuffer(&Buffer.ByteBuffer);
256c2c66affSColin Finck 
257c2c66affSColin Finck     /* Different strings in the String and ByteBuffer part */
258c2c66affSColin Finck     memset(&Buffer, 0, sizeof(Buffer));
259c2c66affSColin Finck     RtlInitBuffer(&Buffer.ByteBuffer, (PUCHAR)StaticBuffer, sizeof(StaticBuffer));
260c2c66affSColin Finck     memcpy(StaticBuffer, TestString, sizeof(TestString));
261c2c66affSColin Finck     Type = 0x12345;
262c2c66affSColin Finck 
263c2c66affSColin Finck     RtlInitUnicodeString(&Buffer.String, L"\\??\\D:\\1234");
264c2c66affSColin Finck 
265c2c66affSColin Finck     ok_hex(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
266c2c66affSColin Finck     ok_hex(Type, RTL_CONVERTED_NT_PATH);
267c2c66affSColin Finck     ok_wstr(Buffer.String.Buffer, L"C:\\Test");
268c2c66affSColin Finck     ok_int(Buffer.String.Length, 14);
269c2c66affSColin Finck     ok_int(Buffer.String.MaximumLength, 24);
270c2c66affSColin Finck     ok_ptr(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer);
271c2c66affSColin Finck     ok_int(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize);
272c2c66affSColin Finck     RtlFreeBuffer(&Buffer.ByteBuffer);
273c2c66affSColin Finck 
274c2c66affSColin Finck 
275c2c66affSColin Finck     /* Different strings, Buffer.String is not prefixed with \??\ */
276c2c66affSColin Finck     memset(&Buffer, 0, sizeof(Buffer));
277c2c66affSColin Finck     RtlInitBuffer(&Buffer.ByteBuffer, (PUCHAR)StaticBuffer, sizeof(StaticBuffer));
278c2c66affSColin Finck     memcpy(StaticBuffer, TestString, sizeof(TestString));
279c2c66affSColin Finck     Type = 0x12345;
280c2c66affSColin Finck 
281c2c66affSColin Finck     RtlInitUnicodeString(&Buffer.String, L"D:\\1234");
282c2c66affSColin Finck 
283c2c66affSColin Finck     ok_hex(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
284c2c66affSColin Finck     ok_hex(Type, RTL_UNCHANGED_DOS_PATH);
285c2c66affSColin Finck     ok_wstr(Buffer.String.Buffer, L"D:\\1234");
286c2c66affSColin Finck     ok_int(Buffer.String.Length, 14);
287c2c66affSColin Finck     ok_int(Buffer.String.MaximumLength, 16);
288c2c66affSColin Finck     ok_ptr(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer);
289c2c66affSColin Finck     ok_int(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize);
290c2c66affSColin Finck     RtlFreeBuffer(&Buffer.ByteBuffer);
291c2c66affSColin Finck 
292c2c66affSColin Finck 
293c2c66affSColin Finck     /* Different strings, smaller ByteBuffer */
294c2c66affSColin Finck     memset(&Buffer, 0, sizeof(Buffer));
295c2c66affSColin Finck     RtlInitBuffer(&Buffer.ByteBuffer, (PUCHAR)StaticBuffer, sizeof(StaticBuffer));
296c2c66affSColin Finck     memcpy(StaticBuffer, TestString, sizeof(TestString));
297c2c66affSColin Finck     Type = 0x12345;
298c2c66affSColin Finck 
299c2c66affSColin Finck     RtlInitUnicodeString(&Buffer.String, L"\\??\\D:\\1234");
300c2c66affSColin Finck     Buffer.ByteBuffer.Size -= 4 * sizeof(WCHAR);
301c2c66affSColin Finck 
302c2c66affSColin Finck     ok_hex(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
303c2c66affSColin Finck     ok_hex(Type, RTL_CONVERTED_NT_PATH);
304c2c66affSColin Finck     ok_wstr(Buffer.String.Buffer, L"C:\\Test");
305c2c66affSColin Finck     ok_int(Buffer.String.Length, 14);
306c2c66affSColin Finck     ok_ptr(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer);
307c2c66affSColin Finck     ok_int(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize - 4 * sizeof(WCHAR));
308c2c66affSColin Finck     RtlFreeBuffer(&Buffer.ByteBuffer);
309c2c66affSColin Finck 
310c2c66affSColin Finck 
311c2c66affSColin Finck     /* These tests show that the size of the ByteBuffer should
312c2c66affSColin Finck         at least equal the size of the string (minus 4, in case of \??\)!
313c2c66affSColin Finck         The results are all over the place, and are most likely the result of implementation details.. */
314c2c66affSColin Finck 
315c2c66affSColin Finck #if 0
316c2c66affSColin Finck     /* Different strings, too small ByteBuffer
317c2c66affSColin Finck         --> corrupt buffer, but none of the output params suggests so? */
318c2c66affSColin Finck     memset(&Buffer, 0, sizeof(Buffer));
319c2c66affSColin Finck     Buffer.ByteBuffer.Size = wcslen(TestString) * sizeof(WCHAR) + sizeof(UNICODE_NULL);
320c2c66affSColin Finck     Buffer.ByteBuffer.Buffer = Ptr = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, Buffer.ByteBuffer.Size);
321c2c66affSColin Finck     memcpy(Buffer.ByteBuffer.Buffer, TestString, Buffer.ByteBuffer.Size);
322c2c66affSColin Finck     Type = 0x12345;
323c2c66affSColin Finck 
324c2c66affSColin Finck     RtlInitUnicodeString(&Buffer.String, L"\\??\\D:\\1234");
325c2c66affSColin Finck     Buffer.ByteBuffer.Size -= 5 * sizeof(WCHAR);
326c2c66affSColin Finck 
327c2c66affSColin Finck     ok_hex(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
328c2c66affSColin Finck     ok_hex(Type, RTL_CONVERTED_NT_PATH);
329c2c66affSColin Finck     //ok_wstr(Buffer.String.Buffer, L"C:\\");
330c2c66affSColin Finck     ok_int(Buffer.String.Length, 14);
331c2c66affSColin Finck     ok_int(Buffer.String.MaximumLength, 16);
332c2c66affSColin Finck     //ok_ptr(Buffer.ByteBuffer.Buffer, Ptr);    // An attempt is made at allocating a buffer, but the move fails because the size of ByteBuffer seems to be used??
333c2c66affSColin Finck     ok_int(Buffer.ByteBuffer.Size, 16);
334c2c66affSColin Finck 
335c2c66affSColin Finck     RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer.ByteBuffer.Buffer);
336c2c66affSColin Finck 
337c2c66affSColin Finck     /* Different strings, too small ByteBuffer, different path separators
338c2c66affSColin Finck         --> corrupt buffer, but none of the output params suggests so? */
339c2c66affSColin Finck     memset(&Buffer, 0, sizeof(Buffer));
340c2c66affSColin Finck     Buffer.ByteBuffer.Size = wcslen(L"\\??\\C://Test") * sizeof(WCHAR) + sizeof(UNICODE_NULL);
341c2c66affSColin Finck     Buffer.ByteBuffer.Buffer = Ptr = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, Buffer.ByteBuffer.Size);
342c2c66affSColin Finck     memcpy(Buffer.ByteBuffer.Buffer, L"\\??\\C://Test", Buffer.ByteBuffer.Size);
343c2c66affSColin Finck     Type = 0x12345;
344c2c66affSColin Finck 
345c2c66affSColin Finck     RtlInitUnicodeString(&Buffer.String, L"\\??\\D:\\1234");
346c2c66affSColin Finck     Buffer.ByteBuffer.Size -= 5 * sizeof(WCHAR);
347c2c66affSColin Finck 
348c2c66affSColin Finck     ok_hex(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
349c2c66affSColin Finck     ok_hex(Type, RTL_CONVERTED_NT_PATH);
350c2c66affSColin Finck     //ok_wstr(Buffer.String.Buffer, L"C:\\");
351c2c66affSColin Finck     ok_int(Buffer.String.Length, 14);
352c2c66affSColin Finck     ok_int(Buffer.String.MaximumLength, 16);
353c2c66affSColin Finck     ok_ptr(Buffer.ByteBuffer.Buffer, Ptr);
354c2c66affSColin Finck     ok_int(Buffer.ByteBuffer.Size, 16);
355c2c66affSColin Finck 
356c2c66affSColin Finck     RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer.ByteBuffer.Buffer);
357c2c66affSColin Finck #endif
358c2c66affSColin Finck }
359c2c66affSColin Finck 
test_table(struct test_entry * Entry)360c2c66affSColin Finck static void test_table(struct test_entry* Entry)
361c2c66affSColin Finck {
362c2c66affSColin Finck     RTL_UNICODE_STRING_BUFFER Buffer = { { 0 } };
363c2c66affSColin Finck     WCHAR StaticBuffer[MAX_PATH];
364c2c66affSColin Finck     ULONG Type = 0x12345;
365c2c66affSColin Finck 
366c2c66affSColin Finck     RtlInitBuffer(&Buffer.ByteBuffer, (PUCHAR)StaticBuffer, sizeof(StaticBuffer));
367c2c66affSColin Finck 
368c2c66affSColin Finck     RtlInitUnicodeString(&Buffer.String, Entry->InputPath);
369c2c66affSColin Finck     RtlEnsureBufferSize(RTL_SKIP_BUFFER_COPY, &Buffer.ByteBuffer, Buffer.String.MaximumLength);
370c2c66affSColin Finck     memcpy(Buffer.ByteBuffer.Buffer, Buffer.String.Buffer, Buffer.String.MaximumLength);
371c2c66affSColin Finck 
372*2eb96f0cSMark Jansen     ok_hex2(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
373c2c66affSColin Finck 
374*2eb96f0cSMark Jansen     ok_hex2(Type, Entry->Type);
375*2eb96f0cSMark Jansen     ok_wstr2(Buffer.String.Buffer, Entry->OutputPath);
376c2c66affSColin Finck     /* If there is no change in the path, the pointer is unchanged */
377c2c66affSColin Finck     if (!wcscmp(Entry->InputPath, Entry->OutputPath))
378c2c66affSColin Finck     {
379*2eb96f0cSMark Jansen         ok_ptr2(Buffer.String.Buffer, Entry->InputPath);
380c2c66affSColin Finck     }
381c2c66affSColin Finck     else
382c2c66affSColin Finck     {
383c2c66affSColin Finck         /* If there is a change in the path, the 'ByteBuffer' is used */
384c2c66affSColin Finck         winetest_ok((PUCHAR)Buffer.String.Buffer >= Buffer.ByteBuffer.StaticBuffer &&
385c2c66affSColin Finck                     (PUCHAR)Buffer.String.Buffer <= (Buffer.ByteBuffer.StaticBuffer + Buffer.ByteBuffer.StaticSize),
386c2c66affSColin Finck                     "Expected Buffer to point inside StaticBuffer\n");
387c2c66affSColin Finck     }
388*2eb96f0cSMark Jansen     ok_wstr2((const WCHAR *)Buffer.ByteBuffer.Buffer, Entry->OutputPath);
389c2c66affSColin Finck 
390*2eb96f0cSMark Jansen     ok_hex2(Buffer.MinimumStaticBufferForTerminalNul, 0);
391c2c66affSColin Finck 
392c2c66affSColin Finck     /* For none of our tests should we exceed the StaticBuffer size! */
393*2eb96f0cSMark Jansen     ok_ptr2(Buffer.ByteBuffer.Buffer, Buffer.ByteBuffer.StaticBuffer);
394*2eb96f0cSMark Jansen     ok_hex2(Buffer.ByteBuffer.Size, Buffer.ByteBuffer.StaticSize);
395c2c66affSColin Finck 
396*2eb96f0cSMark Jansen     ok_hex2(Buffer.ByteBuffer.ReservedForAllocatedSize, 0);
397*2eb96f0cSMark Jansen     ok_ptr2(Buffer.ByteBuffer.ReservedForIMalloc, NULL);
398c2c66affSColin Finck 
399c2c66affSColin Finck     RtlFreeBuffer(&Buffer.ByteBuffer);
400c2c66affSColin Finck }
401c2c66affSColin Finck 
402c2c66affSColin Finck 
START_TEST(RtlNtPathNameToDosPathName)403c2c66affSColin Finck START_TEST(RtlNtPathNameToDosPathName)
404c2c66affSColin Finck {
405c2c66affSColin Finck     RTL_UNICODE_STRING_BUFFER Buffer = { { 0 } };
406c2c66affSColin Finck     ULONG Type;
407c2c66affSColin Finck     size_t n;
408c2c66affSColin Finck 
409c2c66affSColin Finck     HMODULE ntdll = GetModuleHandleW(L"ntdll.dll");
410c2c66affSColin Finck     pRtlNtPathNameToDosPathName = (void *)GetProcAddress(ntdll, "RtlNtPathNameToDosPathName");
411c2c66affSColin Finck 
412c2c66affSColin Finck     if (!pRtlNtPathNameToDosPathName)
413c2c66affSColin Finck     {
414c2c66affSColin Finck         skip("RtlNtPathNameToDosPathName not found?\n");
415c2c66affSColin Finck         return;
416c2c66affSColin Finck     }
417c2c66affSColin Finck 
418c2c66affSColin Finck     ok_ntstatus(pRtlNtPathNameToDosPathName(0, NULL, NULL, NULL), STATUS_INVALID_PARAMETER);
419c2c66affSColin Finck     ok_ntstatus(pRtlNtPathNameToDosPathName(0, &Buffer, NULL, NULL), STATUS_SUCCESS);
420c2c66affSColin Finck     ok_ntstatus(pRtlNtPathNameToDosPathName(1, &Buffer, NULL, NULL), STATUS_INVALID_PARAMETER);
421c2c66affSColin Finck 
422c2c66affSColin Finck     Type = 0x12345;
423c2c66affSColin Finck     ok_ntstatus(pRtlNtPathNameToDosPathName(0, NULL, &Type, NULL), STATUS_INVALID_PARAMETER);
424c2c66affSColin Finck     ok_int(Type, 0);
425c2c66affSColin Finck     Type = 0x12345;
426c2c66affSColin Finck     ok_ntstatus(pRtlNtPathNameToDosPathName(0, &Buffer, &Type, NULL), STATUS_SUCCESS);
427c2c66affSColin Finck     ok_int(Type, RTL_UNCHANGED_UNK_PATH);
428c2c66affSColin Finck     Type = 0x12345;
429c2c66affSColin Finck     ok_ntstatus(pRtlNtPathNameToDosPathName(1, &Buffer, &Type, NULL), STATUS_INVALID_PARAMETER);
430c2c66affSColin Finck     ok_int(Type, 0);
431c2c66affSColin Finck 
432c2c66affSColin Finck     test_specialhandling();
433c2c66affSColin Finck 
434c2c66affSColin Finck     for (n = 0; n < _countof(test_data); ++n)
435c2c66affSColin Finck     {
436c2c66affSColin Finck         winetest_set_location(test_data[n].File, test_data[n].Line);
437c2c66affSColin Finck         test_table(test_data + n);
438c2c66affSColin Finck     }
439c2c66affSColin Finck }
440