97{
98 struct
99 {
106 {
108 {
L"C:\\%ls\\Folder1",
L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
109
110 {
L"",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
111
113 {
L"",
L"C:\\%ls\\Folder1",
NULL,
L"C:\\%ls\\",
L"Folder1" },
114
116 {
L"C:\\%ls\\Folder1",
L"",
NULL,
L"C:\\%ls\\Folder1\\",
NULL },
117
118 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram.exe",
NULL,
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
119 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
121
122 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram",
L".exe",
NULL,
NULL },
123
124 {
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe",
NULL,
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
125 {
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
127 {
L"C:\\%ls\\Folder1\\",
L"SomeProgram",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
128 {
L"C:\\%ls\\Folder1",
L"SomeProgram.exe",
NULL,
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
129 {
L"C:\\%ls\\Folder1",
L"SomeProgram.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
131 {
L"C:\\%ls\\Folder1",
L"SomeProgram",
L".exe",
L"C:\\%ls\\Folder1\\",
L"SomeProgram.exe" },
132
134
135 {
L"C:\\%ls\\Folder1\\SomeProgram.exe",
L"",
L".exe",
NULL,
NULL },
137 {
L"C:\\%ls\\Folder1\\SomeProgram",
L"",
L".exe",
NULL,
NULL },
138
139 {
L"C:\\%ls\\Folder1",
L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
140 {
L"C:\\%ls\\CurrentDirectory",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
146
148
149 {
L"C:\\%ls\\Folder1;C:\\%ls\\CurrentDirectory",
150 L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
151 {
L"C:\\%ls\\CurrentDirectory;C:\\%ls\\Folder1",
152 L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
153 {
L"C:\\%ls\\CurrentDirectory ; C:\\%ls\\Folder1",
155 {
L"C:\\%ls\\CurrentDirectory ;C:\\%ls\\Folder1",
156 L"File1",
NULL,
L"C:\\%ls\\Folder1\\",
L"File1" },
157 {
L"C:\\%ls\\CurrentDirectory; C:\\%ls\\Folder1",
158 L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
159 {
L";C:\\%ls\\Folder1",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
160 {
L";C:\\%ls\\Folder1;",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
161 {
L";C:\\%ls\\Folder1;",
L"File1",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"File1" },
163
164 {
L"",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
165 {
L"",
L"OnlyInCurr ",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
168 {
L";",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
169 {
L"; ",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
172 {
L";C:\\%ls\\Folder1",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
174
175 {
L"C:\\%ls\\Folder1;;",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
176 {
L";C:\\%ls\\Folder1;",
L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
177 {
L"C:\\%ls\\Folder1;C:\\%ls\\Folder2",
179 {
L";C:\\%ls\\Folder1;C:\\%ls\\Folder2",
180 L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
181 {
L"C:\\%ls\\Folder1;;C:\\%ls\\Folder2",
182 L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
183 {
L"C:\\%ls\\Folder1;C:\\%ls\\Folder2;",
185 {
L"C:\\%ls\\Folder1;C:\\%ls\\Folder2;;",
186 L"OnlyInCurr",
NULL,
L"C:\\%ls\\CurrentDirectory\\",
L"OnlyInCurr" },
187
188 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram With Spaces",
190 {
L"",
L"C:\\%ls\\Folder1\\SomeProgram With Spaces.exe",
192 {
L"",
L"C:\\%ls\\Folder1\\Program",
L".exe",
NULL,
NULL },
193
194 {
L"",
L"C:\\%ls\\Folder1\\Program.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program.exe" },
195 {
L"",
L"C:\\%ls\\Folder1\\Program With",
L".exe",
NULL,
NULL },
196 {
L"",
L"C:\\%ls\\Folder1\\Program With.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With.exe" },
197 {
L"",
L"C:\\%ls\\Folder1\\Program With Spaces",
L".exe",
NULL,
NULL },
198 {
L"",
L"C:\\%ls\\Folder1\\Program With Spaces.exe",
199 L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With Spaces.exe" },
200
201 {
L"C:\\%ls\\Folder1",
L"SomeProgram With Spaces",
203 {
L"C:\\%ls\\Folder1",
L"SomeProgram With Spaces.exe",
205 {
L"C:\\%ls\\Folder1",
L"Program",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program.exe" },
206 {
L"C:\\%ls\\Folder1",
L"Program.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program.exe" },
207 {
L"C:\\%ls\\Folder1",
L"Program With",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With.exe" },
208
209 {
L"C:\\%ls\\Folder1",
L"Program With.exe",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With.exe" },
210 {
L"C:\\%ls\\Folder1",
L"Program With Spaces",
L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With Spaces.exe" },
211 {
L"C:\\%ls\\Folder1",
L"Program With Spaces.exe",
212 L".exe",
L"C:\\%ls\\Folder1\\",
L"Program With Spaces.exe" },
213 };
214
223
225 {
230
237 &PartName);
239
241 {
242 swprintf(ResultPath,
Tests[
i].ResultPath, CustomPath, CustomPath, CustomPath, CustomPath);
243 if (
Tests[
i].ResultFileName)
244 {
246 "PartName = %p (%ls), expected %p\n",
249 }
250 else
251 {
253 "PartName = %p (%ls), expected NULL\n",
255 }
257 ok(Okay ==
TRUE,
"CheckStringBuffer failed. Got '%ls', expected '%ls'\n",
Buffer, ResultPath);
258 }
259 else
260 {
262 ok(Okay ==
TRUE,
"CheckBuffer failed\n");
265 "PartName = %p (%ls), expected %p\n",
267 }
268 }
269}
#define PrintablePointer(p)
static BOOLEAN CheckStringBuffer(PCWSTR Buffer, SIZE_T Length, SIZE_T MaximumLength, PCWSTR Expected)
static BOOLEAN CheckBuffer(PVOID Buffer, SIZE_T Size, UCHAR Value)
#define EndSeh(ExpectedStatus)
struct _FileName FileName
_Inout_opt_ PUNICODE_STRING Extension
#define RtlFillMemory(Dest, Length, Fill)
NTSYSAPI ULONG NTAPI RtlDosSearchPath_U(_In_ PCWSTR Path, _In_ PCWSTR FileName, _In_ PCWSTR Extension, _In_ ULONG BufferSize, _Out_ PWSTR Buffer, _Out_ PWSTR *PartName)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList