1c2c66affSColin Finck /*
2c2c66affSColin Finck * PROJECT: ReactOS api tests
3c2c66affSColin Finck * LICENSE: GPLv2+ - See COPYING in the top level directory
4c2c66affSColin Finck * PURPOSE: Test for SHExplorerParseCmdLine
594a413aeSKatayama Hirofumi MZ * PROGRAMMERS: Thomas Faber <thomas.faber@reactos.org>
694a413aeSKatayama Hirofumi MZ * Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7c2c66affSColin Finck */
8c2c66affSColin Finck
9c2c66affSColin Finck #include <apitest.h>
10c2c66affSColin Finck
11c2c66affSColin Finck //#define UNICODE
12c2c66affSColin Finck #include <strsafe.h>
13c2c66affSColin Finck #include <shlobj.h>
147e22dc05SSerge Gautherie #include <browseui_undoc.h>
15c2c66affSColin Finck
16c2c66affSColin Finck // Macro parameters are only expanded in the second nesting...
17c2c66affSColin Finck #define _WIDEN(x) L##x
18c2c66affSColin Finck #define WIDEN(x) _WIDEN(x)
19c2c66affSColin Finck
20c2c66affSColin Finck #define TEST_FILENAMEA "SHExplorerParseCmdLine.test"
21c2c66affSColin Finck #define TEST_FILENAMEW WIDEN(TEST_FILENAMEA)
22c2c66affSColin Finck
23c2c66affSColin Finck #define TEST_PATHA "C:\\SHExplorerParseCmdLine.test"
24c2c66affSColin Finck #define TEST_PATHW WIDEN(TEST_PATHA)
25c2c66affSColin Finck
267e22dc05SSerge Gautherie typedef UINT_PTR (WINAPI *SHExplorerParseCmdLine_Type)(PEXPLORER_CMDLINE_PARSE_RESULTS);
277e22dc05SSerge Gautherie static SHExplorerParseCmdLine_Type pSHExplorerParseCmdLine;
28c2c66affSColin Finck
29c2c66affSColin Finck #define PIDL_IS_UNTOUCHED -1
30c2c66affSColin Finck #define PIDL_IS_NULL -2
31c2c66affSColin Finck #define PIDL_IS_PATH -3
32c2c66affSColin Finck #define PIDL_IS_EMPTY -4
33c2c66affSColin Finck #define PIDL_PATH_EQUALS_PATH -5
34c2c66affSColin Finck
35c2c66affSColin Finck #define InvalidPointer ((PVOID)0x5555555555555555ULL)
36c2c66affSColin Finck
377e22dc05SSerge Gautherie static
ReplaceSubstr(_Out_ PWCHAR OutputStr,_In_ DWORD OutputLen,_In_ PCWSTR InputStr,_In_ PCWSTR ReplaceStr,_In_ PCWSTR ReplaceWith)385dade730SStanislav Motylkov DWORD ReplaceSubstr(
395dade730SStanislav Motylkov _Out_ PWCHAR OutputStr,
405dade730SStanislav Motylkov _In_ DWORD OutputLen,
415dade730SStanislav Motylkov _In_ PCWSTR InputStr,
425dade730SStanislav Motylkov _In_ PCWSTR ReplaceStr,
435dade730SStanislav Motylkov _In_ PCWSTR ReplaceWith)
445dade730SStanislav Motylkov {
455dade730SStanislav Motylkov DWORD result = 0;
465dade730SStanislav Motylkov PCWSTR pos;
475dade730SStanislav Motylkov PCWSTR pwc;
485dade730SStanislav Motylkov
495dade730SStanislav Motylkov if (!OutputLen)
505dade730SStanislav Motylkov return result;
515dade730SStanislav Motylkov
525dade730SStanislav Motylkov OutputStr[0] = 0;
535dade730SStanislav Motylkov pos = InputStr;
545dade730SStanislav Motylkov pwc = wcsstr(pos, ReplaceStr);
555dade730SStanislav Motylkov while (pwc)
565dade730SStanislav Motylkov {
575dade730SStanislav Motylkov if (StringCchCatNW(OutputStr, OutputLen, pos, pwc - pos) == STRSAFE_E_INSUFFICIENT_BUFFER)
585dade730SStanislav Motylkov break;
595dade730SStanislav Motylkov if (StringCchCatW(OutputStr, OutputLen, ReplaceWith) == STRSAFE_E_INSUFFICIENT_BUFFER)
605dade730SStanislav Motylkov break;
615dade730SStanislav Motylkov result++;
625dade730SStanislav Motylkov pos = pwc + wcslen(ReplaceStr);
635dade730SStanislav Motylkov pwc = wcsstr(pos, ReplaceStr);
645dade730SStanislav Motylkov }
655dade730SStanislav Motylkov StringCchCatW(OutputStr, OutputLen, pos);
665dade730SStanislav Motylkov return result;
675dade730SStanislav Motylkov }
685dade730SStanislav Motylkov
69c2c66affSColin Finck static
70c2c66affSColin Finck VOID
TestCommandLine(_In_ ULONG TestLine,_In_ UINT_PTR ExpectedRet,_In_ INT ExpectedCsidl,_In_ DWORD ExpectedFlags,_In_ PCWSTR ExpectedFileName,_In_ PCWSTR PidlPath,_In_ PCWSTR pclsid,_Out_opt_ PUINT PWriteEnd)71c2c66affSColin Finck TestCommandLine(
72465745b6STimo Kreuzer _In_ ULONG TestLine,
737e22dc05SSerge Gautherie _In_ UINT_PTR ExpectedRet,
74c2c66affSColin Finck _In_ INT ExpectedCsidl,
75c2c66affSColin Finck _In_ DWORD ExpectedFlags,
76c2c66affSColin Finck _In_ PCWSTR ExpectedFileName,
77c2c66affSColin Finck _In_ PCWSTR PidlPath,
7894a413aeSKatayama Hirofumi MZ _In_ PCWSTR pclsid,
79c2c66affSColin Finck _Out_opt_ PUINT PWriteEnd)
80c2c66affSColin Finck {
817e22dc05SSerge Gautherie EXPLORER_CMDLINE_PARSE_RESULTS Info;
827cf7b27aSTimo Kreuzer UINT_PTR Ret;
83c2c66affSColin Finck ULONG i;
84c2c66affSColin Finck PDWORD InfoWords = (PDWORD) &Info;
85c2c66affSColin Finck
86c2c66affSColin Finck FillMemory(&Info, sizeof(Info), 0x55);
87c2c66affSColin Finck Info.dwFlags = 0x00000000;
887e22dc05SSerge Gautherie Ret = pSHExplorerParseCmdLine(&Info);
89c2c66affSColin Finck
90c2c66affSColin Finck // Special case for empty cmdline: Ret is the PIDL for the selected folder.
91c2c66affSColin Finck if (ExpectedRet == -1)
927e22dc05SSerge Gautherie {
937e22dc05SSerge Gautherie ok(Ret == (UINT_PTR)Info.pidlPath, "Line %lu: Ret = %p, expected %p\n", TestLine, (PVOID)Ret, Info.pidlPath);
947e22dc05SSerge Gautherie }
95c2c66affSColin Finck else
967e22dc05SSerge Gautherie {
977e22dc05SSerge Gautherie ok(Ret == ExpectedRet, "Line %lu: Ret = 0x%Ix, expected 0x%Ix\n", TestLine, Ret, ExpectedRet);
987e22dc05SSerge Gautherie }
99c2c66affSColin Finck
100c2c66affSColin Finck if (ExpectedFileName == NULL)
1017e22dc05SSerge Gautherie {
1027e22dc05SSerge Gautherie ok(Info.strPath == InvalidPointer, "Line %lu: strPath = %p\n", TestLine, Info.strPath);
1037e22dc05SSerge Gautherie }
104c2c66affSColin Finck else
105c2c66affSColin Finck {
1067e22dc05SSerge Gautherie ok(Info.strPath != InvalidPointer, "Line %lu: strPath = InvalidPointer\n", TestLine);
1077e22dc05SSerge Gautherie ok(Info.strPath != NULL, "Line %lu: strPath = NULL\n", TestLine);
1087e22dc05SSerge Gautherie if (Info.strPath != NULL && Info.strPath != InvalidPointer)
109c2c66affSColin Finck {
1107e22dc05SSerge Gautherie ok(!wcscmp(Info.strPath, ExpectedFileName), "Line %lu: strPath = %ls, expected %ls\n", TestLine, Info.strPath, ExpectedFileName);
1117e22dc05SSerge Gautherie LocalFree(Info.strPath);
112c2c66affSColin Finck }
113c2c66affSColin Finck }
114c2c66affSColin Finck
115465745b6STimo Kreuzer ok(Info.dwFlags == ExpectedFlags, "Line %lu: dwFlags = %08lx, expected %08lx\n", TestLine, Info.dwFlags, ExpectedFlags);
116c2c66affSColin Finck
117c2c66affSColin Finck if (ExpectedCsidl == PIDL_IS_UNTOUCHED)
1187e22dc05SSerge Gautherie {
1197e22dc05SSerge Gautherie ok(Info.pidlPath == InvalidPointer, "Line %lu: pidlPath = %p\n", TestLine, Info.pidlPath);
1207e22dc05SSerge Gautherie }
121c2c66affSColin Finck else if (ExpectedCsidl == PIDL_IS_NULL)
1227e22dc05SSerge Gautherie {
1237e22dc05SSerge Gautherie ok(Info.pidlPath == NULL, "Line %lu: pidlPath = %p\n", TestLine, Info.pidlPath);
1247e22dc05SSerge Gautherie }
125c2c66affSColin Finck else
126c2c66affSColin Finck {
127c2c66affSColin Finck PIDLIST_ABSOLUTE ExpectedPidl;
128c2c66affSColin Finck HRESULT hr;
129c2c66affSColin Finck
1307e22dc05SSerge Gautherie ok(Info.pidlPath != InvalidPointer, "Line %lu: pidlPath = InvalidPointer\n", TestLine);
1317e22dc05SSerge Gautherie ok(Info.pidlPath != NULL, "Line %lu: pidlPath = NULL\n", TestLine);
1327e22dc05SSerge Gautherie if (Info.pidlPath != NULL && Info.pidlPath != InvalidPointer)
133c2c66affSColin Finck {
134c2c66affSColin Finck WCHAR pidlPathName[MAX_PATH] = L"";
1355dade730SStanislav Motylkov WCHAR pidlPathTest[MAX_PATH] = L"";
1365dade730SStanislav Motylkov WCHAR rootDir[MAX_PATH] = L"";
1375dade730SStanislav Motylkov WCHAR curDir[MAX_PATH] = L"";
1385dade730SStanislav Motylkov WCHAR replaceName[MAX_PATH];
1395dade730SStanislav Motylkov
1405dade730SStanislav Motylkov GetFullPathNameW(L"\\", _countof(rootDir), rootDir, NULL);
1415dade730SStanislav Motylkov
1425dade730SStanislav Motylkov GetCurrentDirectoryW(_countof(curDir), curDir);
1435dade730SStanislav Motylkov if (wcslen(curDir) != 0 && curDir[wcslen(curDir) - 1] != L'\\')
1445dade730SStanislav Motylkov StringCchCatW(curDir, _countof(curDir), L"\\");
1455dade730SStanislav Motylkov
1465dade730SStanislav Motylkov if (PidlPath)
1475dade730SStanislav Motylkov {
1485dade730SStanislav Motylkov StringCchCopyW(pidlPathTest, _countof(pidlPathTest), PidlPath);
1495dade730SStanislav Motylkov
1505dade730SStanislav Motylkov if (wcsstr(pidlPathTest, L"::ROOT::") != NULL && wcslen(rootDir) > 0)
1515dade730SStanislav Motylkov {
1525dade730SStanislav Motylkov if (ReplaceSubstr(replaceName, _countof(replaceName), pidlPathTest, L"::ROOT::", rootDir))
1535dade730SStanislav Motylkov StringCchCopyW(pidlPathTest, _countof(pidlPathTest), replaceName);
1545dade730SStanislav Motylkov }
1555dade730SStanislav Motylkov
1565dade730SStanislav Motylkov if (wcsstr(pidlPathTest, L"::CURDIR::") != NULL && wcslen(curDir) > 0)
1575dade730SStanislav Motylkov {
1585dade730SStanislav Motylkov if (ReplaceSubstr(replaceName, _countof(replaceName), pidlPathTest, L"::CURDIR::", curDir))
1595dade730SStanislav Motylkov StringCchCopyW(pidlPathTest, _countof(pidlPathTest), replaceName);
1605dade730SStanislav Motylkov }
1615dade730SStanislav Motylkov }
162c2c66affSColin Finck
1637e22dc05SSerge Gautherie SHGetPathFromIDListW(Info.pidlPath, pidlPathName);
164c2c66affSColin Finck
165c2c66affSColin Finck if (ExpectedCsidl == PIDL_PATH_EQUALS_PATH)
166c2c66affSColin Finck {
167*e4930be4STimo Kreuzer ok(_wcsicmp(pidlPathName, pidlPathTest) == 0, "Line %lu: Path from pidl does not match; pidlPathName=%S\n", TestLine, pidlPathName);
168c2c66affSColin Finck }
169c2c66affSColin Finck else if (ExpectedCsidl == PIDL_IS_EMPTY)
170c2c66affSColin Finck {
171465745b6STimo Kreuzer ok(wcslen(pidlPathName) == 0, "Line %lu: Unexpected non-empty path from pidl; pidlPathName=%S\n", TestLine, pidlPathName);
172c2c66affSColin Finck }
173c2c66affSColin Finck else
174c2c66affSColin Finck {
175c2c66affSColin Finck if (ExpectedCsidl == PIDL_IS_PATH)
176c2c66affSColin Finck {
1775dade730SStanislav Motylkov ExpectedPidl = SHSimpleIDListFromPath(pidlPathTest);
178c2c66affSColin Finck hr = ExpectedPidl == NULL ? E_FAIL : S_OK;
179465745b6STimo Kreuzer ok(ExpectedPidl != NULL, "Line %lu: SHSimpleIDListFromPath(%S) failed. pidlPathName=%S\n", TestLine, pidlPathTest, pidlPathName);
180c2c66affSColin Finck if (SUCCEEDED(hr))
181c2c66affSColin Finck {
1827e22dc05SSerge Gautherie ok(ILIsEqual(Info.pidlPath, ExpectedPidl), "Line %lu: Unexpected pidlPath value %p; pidlPathName=%S pidlPathTest=%S\n", TestLine, Info.pidlPath, pidlPathName, pidlPathTest);
183c2c66affSColin Finck ILFree(ExpectedPidl);
184c2c66affSColin Finck }
185c2c66affSColin Finck }
186c2c66affSColin Finck else
187c2c66affSColin Finck {
188c2c66affSColin Finck hr = SHGetFolderLocation(NULL, ExpectedCsidl, NULL, 0, &ExpectedPidl);
189465745b6STimo Kreuzer ok(hr == S_OK, "Line %lu: SHGetFolderLocation returned %08lx\n", TestLine, hr);
190c2c66affSColin Finck if (SUCCEEDED(hr))
191c2c66affSColin Finck {
1927e22dc05SSerge Gautherie BOOL eq = ILIsEqual(Info.pidlPath, ExpectedPidl);
193c2c66affSColin Finck ILFree(ExpectedPidl);
194c2c66affSColin Finck
1957e22dc05SSerge Gautherie ok(eq, "Line %lu: Unexpected pidlPath value %p; pidlPathName=%S CSIDL=%d\n", TestLine, Info.pidlPath, pidlPathName, ExpectedCsidl);
196c2c66affSColin Finck }
197c2c66affSColin Finck }
198c2c66affSColin Finck }
199c2c66affSColin Finck
2007e22dc05SSerge Gautherie ILFree(Info.pidlPath);
201c2c66affSColin Finck }
202c2c66affSColin Finck }
203c2c66affSColin Finck
204c2c66affSColin Finck for (i = 0; i < sizeof(Info) / sizeof(DWORD); i++)
205c2c66affSColin Finck {
2067e22dc05SSerge Gautherie switch (i * sizeof(DWORD))
207c2c66affSColin Finck {
2087e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, strPath):
2097e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, pidlPath):
2107e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, dwFlags):
2117e22dc05SSerge Gautherie // TODO: 'case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, nCmdShow):'?
2127e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, pidlRoot):
2137e22dc05SSerge Gautherie // TODO: 'case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, clsid):'?
2147e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, guidInproc) + (0 * sizeof(DWORD)):
2157e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, guidInproc) + (1 * sizeof(DWORD)):
2167e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, guidInproc) + (2 * sizeof(DWORD)):
2177e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, guidInproc) + (3 * sizeof(DWORD)):
2187e22dc05SSerge Gautherie #ifdef _WIN64
2197e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, strPath) + sizeof(DWORD):
2207e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, pidlPath) + sizeof(DWORD):
2217e22dc05SSerge Gautherie case FIELD_OFFSET(EXPLORER_CMDLINE_PARSE_RESULTS, pidlRoot) + sizeof(DWORD):
2227e22dc05SSerge Gautherie #endif
223c2c66affSColin Finck break;
224c2c66affSColin Finck default:
2257e22dc05SSerge Gautherie ok(InfoWords[i] == 0x55555555, "Line %lu: Word 0x%02lx has been set to 0x%08lx\n", TestLine, i * sizeof(DWORD), InfoWords[i]);
226c2c66affSColin Finck }
227c2c66affSColin Finck }
228c2c66affSColin Finck
22994a413aeSKatayama Hirofumi MZ {
23094a413aeSKatayama Hirofumi MZ LPOLESTR psz;
23194a413aeSKatayama Hirofumi MZ BYTE ab[sizeof(CLSID)];
23294a413aeSKatayama Hirofumi MZ
23394a413aeSKatayama Hirofumi MZ StringFromCLSID(&Info.clsid, &psz);
23494a413aeSKatayama Hirofumi MZ if (pclsid == NULL)
23594a413aeSKatayama Hirofumi MZ {
23694a413aeSKatayama Hirofumi MZ FillMemory(ab, sizeof(ab), 0x55);
23794a413aeSKatayama Hirofumi MZ ok(memcmp(ab, &Info.clsid, sizeof(ab)) == 0, "Line %lu: CLSID was %ls.\n", TestLine, psz);
23894a413aeSKatayama Hirofumi MZ }
23994a413aeSKatayama Hirofumi MZ else
24094a413aeSKatayama Hirofumi MZ {
24194a413aeSKatayama Hirofumi MZ ok(lstrcmpiW(psz, pclsid) == 0, "Line %lu: CLSID was %ls.\n", TestLine, psz);
24294a413aeSKatayama Hirofumi MZ }
24394a413aeSKatayama Hirofumi MZ CoTaskMemFree(psz);
24494a413aeSKatayama Hirofumi MZ }
24594a413aeSKatayama Hirofumi MZ
246c2c66affSColin Finck if (PWriteEnd)
247c2c66affSColin Finck {
248c2c66affSColin Finck PBYTE data = (PBYTE)&Info;
249c2c66affSColin Finck
250c2c66affSColin Finck *PWriteEnd = 0;
251c2c66affSColin Finck
252c2c66affSColin Finck for (i = sizeof(Info); i > 0; i--)
253c2c66affSColin Finck {
254c2c66affSColin Finck if (data[i - 1] != 0x55)
255c2c66affSColin Finck {
256c2c66affSColin Finck *PWriteEnd = i;
257c2c66affSColin Finck break;
258c2c66affSColin Finck }
259c2c66affSColin Finck }
260c2c66affSColin Finck }
261c2c66affSColin Finck }
262c2c66affSColin Finck
START_TEST(SHExplorerParseCmdLine)263c2c66affSColin Finck START_TEST(SHExplorerParseCmdLine)
264c2c66affSColin Finck {
265c2c66affSColin Finck static struct
266c2c66affSColin Finck {
267c2c66affSColin Finck INT TestLine;
268c2c66affSColin Finck PCWSTR CommandLine;
2697e22dc05SSerge Gautherie UINT_PTR ExpectedRet;
270c2c66affSColin Finck INT ExpectedCsidl;
271c2c66affSColin Finck DWORD ExpectedFlags;
272c2c66affSColin Finck PCWSTR ExpectedFileName;
273c2c66affSColin Finck PCWSTR PidlPath;
27494a413aeSKatayama Hirofumi MZ PCWSTR pclsid;
275c2c66affSColin Finck } Tests [] =
276c2c66affSColin Finck {
277c2c66affSColin Finck { __LINE__, L"", -1, CSIDL_MYDOCUMENTS, 0x00000009 },
278c2c66affSColin Finck { __LINE__, L"/e", TRUE, PIDL_IS_UNTOUCHED, 0x00000008 },
279c2c66affSColin Finck { __LINE__, L"/n", TRUE, PIDL_IS_UNTOUCHED, 0x00004001 },
280c2c66affSColin Finck { __LINE__, L"/x", TRUE, PIDL_IS_NULL, 0x02000000, L"/x" },
281c2c66affSColin Finck { __LINE__, L"-e", TRUE, PIDL_IS_NULL, 0x02000000, L"-e" },
282c2c66affSColin Finck { __LINE__, L"C:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
283c2c66affSColin Finck { __LINE__, L"/e,C:\\", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"C:\\" },
284c2c66affSColin Finck { __LINE__, L"/select,C:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
285c2c66affSColin Finck { __LINE__, L"/e,::{20d04fe0-3aea-1069-a2d8-08002b30309d}", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}" },
286c2c66affSColin Finck { __LINE__, L"::{645ff040-5081-101b-9f08-00aa002f954e}", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::{645ff040-5081-101b-9f08-00aa002f954e}" },
287c2c66affSColin Finck { __LINE__, L"/select,::{450d8fba-ad25-11d0-98a8-0800361b1103}", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"::{450d8fba-ad25-11d0-98a8-0800361b1103}" },
288c2c66affSColin Finck { __LINE__, L"=", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}" },
289465745b6STimo Kreuzer // { __LINE__, L".", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings\\gigaherz\\Desktop" },
290465745b6STimo Kreuzer // { __LINE__, L"..", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings\\gigaherz" },
291c2c66affSColin Finck { __LINE__, L"wrongpath", TRUE, PIDL_IS_NULL, 0x02000000, L"wrongpath"},
292c2c66affSColin Finck { __LINE__, L"%wrongdir%", TRUE, PIDL_IS_NULL, 0x02000000, L"%wrongdir%"},
293c2c66affSColin Finck { __LINE__, L"%programfiles#", TRUE, PIDL_IS_NULL, 0x02000000, L"%programfiles#"},
294c2c66affSColin Finck { __LINE__, L",", TRUE, PIDL_IS_EMPTY, 0x00000200},
2955dade730SStanislav Motylkov { __LINE__, L"\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::ROOT::" }, // disk letter depends on current directory
296c2c66affSColin Finck { __LINE__, L"c:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
297c2c66affSColin Finck { __LINE__, L"c:", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
298c2c66affSColin Finck { __LINE__, L"c", TRUE, PIDL_IS_NULL, 0x02000000, L"c"},
299c2c66affSColin Finck { __LINE__, L"c:\\Program Files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
300c2c66affSColin Finck { __LINE__, L"c:\\Program Files\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
301c2c66affSColin Finck { __LINE__, L"c:\\Program Files/", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\Program Files/"},
302c2c66affSColin Finck { __LINE__, L"c:/Program Files/", TRUE, PIDL_IS_NULL, 0x02000000, L"c:/Program Files/"},
3035dade730SStanislav Motylkov { __LINE__, L"fonts", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::CURDIR::fonts" }, // this would not fail if we are in Windows directory
3045dade730SStanislav Motylkov { __LINE__, L"winsxs", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::CURDIR::winsxs" },
3055dade730SStanislav Motylkov { __LINE__, L"system32", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::CURDIR::system32" },
3065dade730SStanislav Motylkov { __LINE__, L"drivers", TRUE, PIDL_IS_NULL, 0x02000000, L"drivers" }, // this would fail since we are not in system32 directory
3075dade730SStanislav Motylkov { __LINE__, L"spool", TRUE, PIDL_IS_NULL, 0x02000000, L"spool" },
308465745b6STimo Kreuzer // { __LINE__, L"wbem", TRUE, PIDL_IS_NULL, 0x02000000, L"wbem" },
309c2c66affSColin Finck { __LINE__, TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000200, NULL, TEST_PATHW },
310c2c66affSColin Finck { __LINE__, L"\"c:\\\"\"program files\"", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\\"program files"},
311c2c66affSColin Finck { __LINE__, L"\"c:\\\"program files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
312c2c66affSColin Finck { __LINE__, L"\"c:\\ \"program files", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\ program files"},
313c2c66affSColin Finck { __LINE__, L"\"c:\\\" program files", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\ program files"},
314c2c66affSColin Finck { __LINE__, L"\"c:\\\", \"c:\\program files\"", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
315c2c66affSColin Finck { __LINE__, L"c:\\,c:\\program files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
3167e22dc05SSerge Gautherie { __LINE__, L"/root", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
3177e22dc05SSerge Gautherie { __LINE__, L"\"/root\"", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
3187e22dc05SSerge Gautherie { __LINE__, L"/root,", TRUE, PIDL_IS_UNTOUCHED, 0x00000000 },
3197e22dc05SSerge Gautherie { __LINE__, L"/root,c", TRUE, PIDL_IS_UNTOUCHED, 0x00000000 },
3207e22dc05SSerge Gautherie { __LINE__, L"/root,\"\"", TRUE, PIDL_IS_UNTOUCHED, 0x00000000 },
3217e22dc05SSerge Gautherie { __LINE__, L"/root,wrong", TRUE, PIDL_IS_UNTOUCHED, 0x00000000 },
3227e22dc05SSerge Gautherie { __LINE__, L"/root,0", TRUE, PIDL_IS_UNTOUCHED, 0x00000000 },
323c2c66affSColin Finck { __LINE__, L"/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000000, NULL, L"c:\\" },
324c2c66affSColin Finck { __LINE__, L"/root,\"c:\\\"", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000000, NULL, L"c:\\" },
325c2c66affSColin Finck { __LINE__, L"/root \"c:\\\"", TRUE, PIDL_IS_NULL, 0x02000000, L"/root c:\\"},
3267e22dc05SSerge Gautherie { __LINE__, L"/root,\"c:\\\"\"program files\"", TRUE, PIDL_IS_UNTOUCHED, 0x00000000 },
327c2c66affSColin Finck { __LINE__, L"/root,\"c:\\\"program files", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000000, NULL, L"c:\\Program Files" },
328c2c66affSColin Finck { __LINE__, L"/root,c:\\,c:\\Program Files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
329c2c66affSColin Finck { __LINE__, L"/root,c:\\,Program Files", TRUE, PIDL_IS_NULL, 0x02000000, L"Program Files"},
330c2c66affSColin Finck { __LINE__, L"/root,\"c:\\\"", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000000, NULL, L"c:\\" },
331c2c66affSColin Finck { __LINE__, L"c:\\Program Files,/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000200, NULL, L"c:\\" },
332465745b6STimo Kreuzer // { __LINE__, L"a:\\,/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000200, NULL, L"c:\\" },
333465745b6STimo Kreuzer // { __LINE__, L"a:\\,/root,c", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"A:\\" },
334c2c66affSColin Finck { __LINE__, L"c:\\,/root,c", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
3357e22dc05SSerge Gautherie { __LINE__, L"/select", TRUE, PIDL_IS_UNTOUCHED, 0x00000040 },
336c2c66affSColin Finck { __LINE__, L"/select,", TRUE, CSIDL_DRIVES, 0x00000240 },
337c2c66affSColin Finck { __LINE__, L"/select,c", TRUE, PIDL_IS_NULL, 0x02000040, L"c"},
338c2c66affSColin Finck { __LINE__, L"/select,0", TRUE, PIDL_IS_NULL, 0x02000040, L"0"},
339c2c66affSColin Finck { __LINE__, L"/select,c:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
340c2c66affSColin Finck { __LINE__, L"c:\\,/select", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
341c2c66affSColin Finck { __LINE__, L"/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
342c2c66affSColin Finck { __LINE__, L"/select,c:\\Program Files,c:\\Documents and settings", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\Documents and Settings" },
343c2c66affSColin Finck { __LINE__, L"c:\\,/select," TEST_FILENAMEW, TRUE, PIDL_IS_NULL, 0x02000240, TEST_FILENAMEW },
344c2c66affSColin Finck { __LINE__, L"c:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
345465745b6STimo Kreuzer // { __LINE__, L"a:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
346c2c66affSColin Finck { __LINE__, L"z:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x02000240, L"z:\\", TEST_PATHW },
347c2c66affSColin Finck { __LINE__, L"select,c:\\ ", TRUE, PIDL_IS_PATH, 0x02000200, L"select", L"C:\\" },
348c2c66affSColin Finck { __LINE__, L"/select c:\\ ", TRUE, PIDL_IS_NULL, 0x02000000, L"/select c:\\"},
349465745b6STimo Kreuzer // { __LINE__, L"a:\\,/select,c:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
350465745b6STimo Kreuzer { __LINE__, L"a:\\,/select,c", TRUE, PIDL_IS_NULL, 0x02000040, L"c"},
351c2c66affSColin Finck { __LINE__, L"c:\\,/select,c", TRUE, PIDL_IS_NULL, 0x02000240, L"c"},
3527e22dc05SSerge Gautherie { __LINE__, L"/e", TRUE, PIDL_IS_UNTOUCHED, 0x00000008 },
353c2c66affSColin Finck { __LINE__, L"/e,", TRUE, CSIDL_DRIVES, 0x00000208 },
354c2c66affSColin Finck { __LINE__, L"/e,\"", TRUE, CSIDL_DRIVES, 0x00000208 },
355c2c66affSColin Finck { __LINE__, L"/e,\"\"", TRUE, CSIDL_DRIVES, 0x00000208 },
356c2c66affSColin Finck { __LINE__, L"/e,c:\\", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"C:\\" },
357c2c66affSColin Finck { __LINE__, L"c:\\,/e", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"C:\\" },
358c2c66affSColin Finck { __LINE__, L"/e,c", TRUE, PIDL_IS_NULL, 0x02000008, L"c"},
359c2c66affSColin Finck { __LINE__, L"/root,c:\\,/select," TEST_FILENAMEW, TRUE, PIDL_IS_NULL, 0x02000040, TEST_FILENAMEW },
360c2c66affSColin Finck { __LINE__, L"/select," TEST_FILENAMEW L",/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x02000040, TEST_FILENAMEW, L"c:\\" },
361c2c66affSColin Finck { __LINE__, L"/root,c:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
362c2c66affSColin Finck { __LINE__, L"/select," TEST_PATHW L",/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000240, NULL, L"c:\\" },
363c2c66affSColin Finck { __LINE__, L"/e,/select," TEST_FILENAMEW L",/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x02000048, TEST_FILENAMEW, L"c:\\" },
364c2c66affSColin Finck { __LINE__, L"/e,/root,c:\\,/select," TEST_FILENAMEW, TRUE, PIDL_IS_NULL, 0x02000048, TEST_FILENAMEW },
365c2c66affSColin Finck { __LINE__, L"/e,/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000008, NULL, L"c:\\" },
366c2c66affSColin Finck { __LINE__, L"/e,c:\\,/select," TEST_FILENAMEW, TRUE, PIDL_IS_NULL, 0x02000248, TEST_FILENAMEW },
367c2c66affSColin Finck { __LINE__, L"c:\\,/e,/select," TEST_FILENAMEW, TRUE, PIDL_IS_NULL, 0x02000248, TEST_FILENAMEW },
368c2c66affSColin Finck { __LINE__, L"c:\\,/select," TEST_FILENAMEW L",/e", TRUE, PIDL_IS_NULL, 0x02000248, TEST_FILENAMEW },
369c2c66affSColin Finck { __LINE__, L"http:\\\\www.reactos.org", TRUE, PIDL_IS_NULL, 0x02000000, L"http:\\\\www.reactos.org"},
370c2c66affSColin Finck { __LINE__, L"/e,http:\\\\www.reactos.org", TRUE, PIDL_IS_NULL, 0x02000008, L"http:\\\\www.reactos.org"},
371c2c66affSColin Finck { __LINE__, L"/root,c:\\,http:\\\\www.reactos.org", TRUE, PIDL_IS_NULL, 0x02000000, L"http:\\\\www.reactos.org"},
3727e22dc05SSerge Gautherie { __LINE__, L"/separate ", TRUE, PIDL_IS_UNTOUCHED, 0x00020000 },
373c2c66affSColin Finck { __LINE__, L"/separate,c:\\ program files", TRUE, PIDL_IS_NULL, 0x02020000, L"c:\\ program files"},
374c2c66affSColin Finck { __LINE__, L"/separate, c:\\program files", TRUE, PIDL_IS_PATH, 0x00020200, NULL, L"C:\\Program Files" },
375c2c66affSColin Finck { __LINE__, L"/separate, c:\\program files ,/e", TRUE, PIDL_IS_PATH, 0x00020208, NULL, L"C:\\Program Files" },
376c2c66affSColin Finck { __LINE__, L"/separate, c:\\program files ,\\e", TRUE, PIDL_IS_NULL, 0x02020200, L"\\e"},
377c2c66affSColin Finck { __LINE__, L"c:\\Documents and settings,/separate,/n,/e,/root,c:\\,/select,c:\\Program files,", TRUE, CSIDL_DRIVES, 0x00024249 },
378c2c66affSColin Finck { __LINE__, L"c:\\Documents and settings,/separate,/n,/e,/root,{450D8FBA-AD25-11D0-98A8-0800361B1103, 0},test,/select,c:\\Program files,", TRUE, CSIDL_DRIVES, 0x02024249, L"test" },
379c2c66affSColin Finck { __LINE__, L"c:\\Documents and settings,/inproc,/noui,/s,/separate,/n,/e,/root,{450D8FBA-AD25-11D0-98A8-0800361B1103, 0},test,/select,c:\\Program files,", FALSE, PIDL_PATH_EQUALS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings" },
380c2c66affSColin Finck { __LINE__, L"=", TRUE, CSIDL_DRIVES, 0x00000200 },
381c2c66affSColin Finck { __LINE__, L"=c:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
382c2c66affSColin Finck { __LINE__, L"=" TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000200, NULL, TEST_PATHW },
383c2c66affSColin Finck { __LINE__, L"/root,=", TRUE, CSIDL_DRIVES, 0x00000200 },
384c2c66affSColin Finck { __LINE__, L"/root=c:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
385c2c66affSColin Finck { __LINE__, L"/root=c:\\Program files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
386c2c66affSColin Finck { __LINE__, L"/root=\"c:\\Program files\"", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
387c2c66affSColin Finck { __LINE__, L"/root=\"\"c:\\Program files\"\"", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
388c2c66affSColin Finck { __LINE__, L"c:\\=/root=\"c:\\Program files\"", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000000, NULL, L"C:\\Program Files" },
389c2c66affSColin Finck { __LINE__, L"/select=c:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
390c2c66affSColin Finck { __LINE__, L"/select=c:\\Program files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
391c2c66affSColin Finck { __LINE__, L"=,/select,c:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
392c2c66affSColin Finck { __LINE__, L"/select,c:\\,=", TRUE, CSIDL_DRIVES, 0x00000240 },
393c2c66affSColin Finck { __LINE__, L"c:\\=/select=c:\\windows\\system32", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\WINDOWS\\system32" },
394c2c66affSColin Finck { __LINE__, L"/select=c:\\windows\\system32", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\WINDOWS\\system32" },
395c2c66affSColin Finck { __LINE__, L"=/select=c:\\windows\\system32", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\WINDOWS\\system32" },
396c2c66affSColin Finck { __LINE__, L"/e,=", TRUE, CSIDL_DRIVES, 0x00000208 },
397c2c66affSColin Finck { __LINE__, L"/e=", TRUE, CSIDL_DRIVES, 0x00000200 },
398c2c66affSColin Finck { __LINE__, L"/e=\"", TRUE, CSIDL_DRIVES, 0x00000200 },
399c2c66affSColin Finck { __LINE__, L"/e=\"\"", TRUE, CSIDL_DRIVES, 0x00000200 },
400c2c66affSColin Finck { __LINE__, L"=\"=\"", TRUE, PIDL_IS_NULL, 0x02000000, L"="},
401c2c66affSColin Finck { __LINE__, L"==\"=\"", TRUE, PIDL_IS_NULL, 0x02000200, L"="},
402c2c66affSColin Finck { __LINE__, L"===\"=\"", TRUE, PIDL_IS_NULL, 0x02000200, L"="},
403c2c66affSColin Finck { __LINE__, L"=\"=\"", TRUE, PIDL_IS_NULL, 0x02000000, L"="},
404c2c66affSColin Finck { __LINE__, L"==\"==\"", TRUE, PIDL_IS_NULL, 0x02000200, L"=="},
405c2c66affSColin Finck { __LINE__, L"===\"===\"", TRUE, PIDL_IS_NULL, 0x02000200, L"==="},
406c2c66affSColin Finck { __LINE__, L"=\"=a\"", TRUE, PIDL_IS_NULL, 0x02000000, L"=a"},
407c2c66affSColin Finck { __LINE__, L"==\"=a=\"", TRUE, PIDL_IS_NULL, 0x02000200, L"=a="},
408c2c66affSColin Finck { __LINE__, L"===\"=a=a=\"", TRUE, PIDL_IS_NULL, 0x02000200, L"=a=a="},
409c2c66affSColin Finck { __LINE__, L"=\"=a\"==", TRUE, CSIDL_DRIVES, 0x02000200, L"=a" },
410c2c66affSColin Finck { __LINE__, L"==\"=a=\"=", TRUE, CSIDL_DRIVES, 0x02000200, L"=a=" },
411c2c66affSColin Finck { __LINE__, L"===\"=a=a=\"===", TRUE, CSIDL_DRIVES, 0x02000200, L"=a=a=" },
412c2c66affSColin Finck { __LINE__, L"=,=,=,\"=a=a=\",=,=,=", TRUE, CSIDL_DRIVES, 0x02000200, L"=a=a=" },
413c2c66affSColin Finck { __LINE__, L"\"", TRUE, CSIDL_DRIVES, 0x00000200 },
414c2c66affSColin Finck { __LINE__, L"\"\"", TRUE, CSIDL_DRIVES, 0x00000200 },
415c2c66affSColin Finck { __LINE__, L"\"\"\"", TRUE, PIDL_IS_NULL, 0x02000000, L"\""},
416c2c66affSColin Finck { __LINE__, L"\"\"\"\"", TRUE, PIDL_IS_NULL, 0x02000000, L"\""},
417c2c66affSColin Finck { __LINE__, L"\"\"\"\"\"", TRUE, PIDL_IS_NULL, 0x02000000, L"\"\""},
4187e22dc05SSerge Gautherie { __LINE__, L"/s", TRUE, PIDL_IS_UNTOUCHED, 0x00000002 },
4197e22dc05SSerge Gautherie { __LINE__, L"/noui", TRUE, PIDL_IS_UNTOUCHED, 0x00001000 },
420c2c66affSColin Finck { __LINE__, L"/idlist", TRUE, PIDL_IS_UNTOUCHED, 0x00000000},
4217e22dc05SSerge Gautherie { __LINE__, L"-embedding", TRUE, PIDL_IS_UNTOUCHED, 0x00000080 },
422c2c66affSColin Finck { __LINE__, L"/inproc", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
423c2c66affSColin Finck { __LINE__, L"/inproc,1", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
424c2c66affSColin Finck { __LINE__, L"/inproc,a", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
425c2c66affSColin Finck { __LINE__, L"/inproc,c:\\", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
426c2c66affSColin Finck { __LINE__, L"/inproc,\"c:\\\"", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 },
427c2c66affSColin Finck { __LINE__, L"/inproc,{20d04fe0-3aea-1069-a2d8-08002b30309d}", TRUE, PIDL_IS_UNTOUCHED, 0x00000400 },
42894a413aeSKatayama Hirofumi MZ { __LINE__, L"shell:::{450D8FBA-AD25-11D0-98A8-0800361B1103}", TRUE, CSIDL_MYDOCUMENTS, 0x00000200 },
429e7430a86SKatayama Hirofumi MZ { __LINE__, L"::{450d8fba-ad25-11d0-98a8-0800361b1103}", TRUE, CSIDL_MYDOCUMENTS, 0x00000200 },
430c2c66affSColin Finck };
431c2c66affSColin Finck const int TestCount = sizeof(Tests) / sizeof(Tests[0]);
432c2c66affSColin Finck PWSTR CommandLine;
433c2c66affSColin Finck WCHAR OriginalCommandLine[1024];
434c2c66affSColin Finck int i;
435c2c66affSColin Finck UINT maxWrite = 0;
436c2c66affSColin Finck FILE * ff;
4375dade730SStanislav Motylkov WCHAR winDir[MAX_PATH];
438c2c66affSColin Finck
439c2c66affSColin Finck HMODULE browseui = LoadLibraryA("browseui.dll");
4407e22dc05SSerge Gautherie pSHExplorerParseCmdLine = (SHExplorerParseCmdLine_Type)GetProcAddress(browseui, MAKEINTRESOURCEA(107));
4417e22dc05SSerge Gautherie if (!pSHExplorerParseCmdLine)
442c2c66affSColin Finck {
4437e22dc05SSerge Gautherie skip("SHExplorerParseCmdLine not found, as on NT6+\n");
444c2c66affSColin Finck return;
445c2c66affSColin Finck }
446c2c66affSColin Finck
447c2c66affSColin Finck CommandLine = GetCommandLineW();
448c2c66affSColin Finck StringCbCopyW(OriginalCommandLine, sizeof(OriginalCommandLine), CommandLine);
449c2c66affSColin Finck
450c2c66affSColin Finck ff = fopen(TEST_PATHA, "wb");
451c2c66affSColin Finck fclose(ff);
452c2c66affSColin Finck
4535dade730SStanislav Motylkov GetWindowsDirectoryW(winDir, _countof(winDir));
4545dade730SStanislav Motylkov SetCurrentDirectoryW(winDir);
4555dade730SStanislav Motylkov
456c2c66affSColin Finck for (i = 0; i < TestCount; i++)
457c2c66affSColin Finck {
458c2c66affSColin Finck UINT cWrite;
459c2c66affSColin Finck
460c2c66affSColin Finck wcscpy(CommandLine, L"browseui_apitest.exe ");
461c2c66affSColin Finck wcscat(CommandLine, Tests[i].CommandLine);
462c2c66affSColin Finck trace("Command line (%d): %ls\n", Tests[i].TestLine, CommandLine);
463465745b6STimo Kreuzer TestCommandLine(Tests[i].TestLine,
464465745b6STimo Kreuzer Tests[i].ExpectedRet,
465c2c66affSColin Finck Tests[i].ExpectedCsidl,
466c2c66affSColin Finck Tests[i].ExpectedFlags,
467c2c66affSColin Finck Tests[i].ExpectedFileName,
468c2c66affSColin Finck Tests[i].PidlPath,
46994a413aeSKatayama Hirofumi MZ Tests[i].pclsid,
470c2c66affSColin Finck &cWrite);
471c2c66affSColin Finck
472c2c66affSColin Finck if (cWrite > maxWrite)
473c2c66affSColin Finck maxWrite = cWrite;
474c2c66affSColin Finck }
475c2c66affSColin Finck
476c2c66affSColin Finck trace("Writes reached the byte right before 0x%08x\n", maxWrite);
477c2c66affSColin Finck
478c2c66affSColin Finck wcscpy(CommandLine, OriginalCommandLine);
479c2c66affSColin Finck
480c2c66affSColin Finck remove(TEST_PATHA);
481c2c66affSColin Finck }
482