1bfcbda22SKatayama Hirofumi MZ /*
2bfcbda22SKatayama Hirofumi MZ * PROJECT: ReactOS API tests
3bfcbda22SKatayama Hirofumi MZ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4bfcbda22SKatayama Hirofumi MZ * PURPOSE: Test for ShellExecCmdLine
5bfcbda22SKatayama Hirofumi MZ * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6bfcbda22SKatayama Hirofumi MZ */
7bfcbda22SKatayama Hirofumi MZ #include "shelltest.h"
8bfcbda22SKatayama Hirofumi MZ #include <shlwapi.h>
9bfcbda22SKatayama Hirofumi MZ #include <strsafe.h>
10465745b6STimo Kreuzer #include <versionhelpers.h>
1160b89da3SKatayama Hirofumi MZ #include "shell32_apitest_sub.h"
12bfcbda22SKatayama Hirofumi MZ
13bfcbda22SKatayama Hirofumi MZ #define NDEBUG
14bfcbda22SKatayama Hirofumi MZ #include <debug.h>
15bfcbda22SKatayama Hirofumi MZ #include <stdio.h>
16bfcbda22SKatayama Hirofumi MZ
17bfcbda22SKatayama Hirofumi MZ #ifndef SECL_NO_UI
18bfcbda22SKatayama Hirofumi MZ #define SECL_NO_UI 0x2
19bfcbda22SKatayama Hirofumi MZ #define SECL_LOG_USAGE 0x8
20bfcbda22SKatayama Hirofumi MZ #define SECL_USE_IDLIST 0x10
21bfcbda22SKatayama Hirofumi MZ #define SECL_ALLOW_NONEXE 0x20
22bfcbda22SKatayama Hirofumi MZ #define SECL_RUNAS 0x40
23bfcbda22SKatayama Hirofumi MZ #endif
24bfcbda22SKatayama Hirofumi MZ
2578edea81SKatayama Hirofumi MZ #define ShellExecCmdLine proxy_ShellExecCmdLine
26bfcbda22SKatayama Hirofumi MZ
27bfcbda22SKatayama Hirofumi MZ #define shell32_hInstance GetModuleHandle(NULL)
28bfcbda22SKatayama Hirofumi MZ #define IDS_FILE_NOT_FOUND (-1)
29bfcbda22SKatayama Hirofumi MZ
30bfcbda22SKatayama Hirofumi MZ static const WCHAR wszOpen[] = L"open";
31bfcbda22SKatayama Hirofumi MZ static const WCHAR wszExe[] = L".exe";
32bfcbda22SKatayama Hirofumi MZ static const WCHAR wszCom[] = L".com";
33bfcbda22SKatayama Hirofumi MZ
__SHCloneStrW(WCHAR ** target,const WCHAR * source)34bfcbda22SKatayama Hirofumi MZ static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source)
35bfcbda22SKatayama Hirofumi MZ {
36bfcbda22SKatayama Hirofumi MZ *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) );
37bfcbda22SKatayama Hirofumi MZ lstrcpyW(*target, source);
38bfcbda22SKatayama Hirofumi MZ }
39bfcbda22SKatayama Hirofumi MZ
4078edea81SKatayama Hirofumi MZ // NOTE: You have to sync the following code to dll/win32/shell32/shlexec.cpp.
41bfcbda22SKatayama Hirofumi MZ static LPCWSTR
SplitParams(LPCWSTR psz,LPWSTR pszArg0,size_t cchArg0)42bfcbda22SKatayama Hirofumi MZ SplitParams(LPCWSTR psz, LPWSTR pszArg0, size_t cchArg0)
43bfcbda22SKatayama Hirofumi MZ {
44bfcbda22SKatayama Hirofumi MZ LPCWSTR pch;
45bfcbda22SKatayama Hirofumi MZ size_t ich = 0;
46bfcbda22SKatayama Hirofumi MZ if (*psz == L'"')
47bfcbda22SKatayama Hirofumi MZ {
48bfcbda22SKatayama Hirofumi MZ // 1st argument is quoted. the string in quotes is quoted 1st argument.
49bfcbda22SKatayama Hirofumi MZ // [pch] --> [pszArg0+ich]
50bfcbda22SKatayama Hirofumi MZ for (pch = psz + 1; *pch && ich + 1 < cchArg0; ++ich, ++pch)
51bfcbda22SKatayama Hirofumi MZ {
52bfcbda22SKatayama Hirofumi MZ if (*pch == L'"' && pch[1] == L'"')
53bfcbda22SKatayama Hirofumi MZ {
54bfcbda22SKatayama Hirofumi MZ // doubled double quotations found!
55bfcbda22SKatayama Hirofumi MZ pszArg0[ich] = L'"';
56bfcbda22SKatayama Hirofumi MZ }
57bfcbda22SKatayama Hirofumi MZ else if (*pch == L'"')
58bfcbda22SKatayama Hirofumi MZ {
59bfcbda22SKatayama Hirofumi MZ // single double quotation found!
60bfcbda22SKatayama Hirofumi MZ ++pch;
61bfcbda22SKatayama Hirofumi MZ break;
62bfcbda22SKatayama Hirofumi MZ }
63bfcbda22SKatayama Hirofumi MZ else
64bfcbda22SKatayama Hirofumi MZ {
65bfcbda22SKatayama Hirofumi MZ // otherwise
66bfcbda22SKatayama Hirofumi MZ pszArg0[ich] = *pch;
67bfcbda22SKatayama Hirofumi MZ }
68bfcbda22SKatayama Hirofumi MZ }
69bfcbda22SKatayama Hirofumi MZ }
70bfcbda22SKatayama Hirofumi MZ else
71bfcbda22SKatayama Hirofumi MZ {
72bfcbda22SKatayama Hirofumi MZ // 1st argument is unquoted. non-space sequence is 1st argument.
73bfcbda22SKatayama Hirofumi MZ // [pch] --> [pszArg0+ich]
74bfcbda22SKatayama Hirofumi MZ for (pch = psz; *pch && !iswspace(*pch) && ich + 1 < cchArg0; ++ich, ++pch)
75bfcbda22SKatayama Hirofumi MZ {
76bfcbda22SKatayama Hirofumi MZ pszArg0[ich] = *pch;
77bfcbda22SKatayama Hirofumi MZ }
78bfcbda22SKatayama Hirofumi MZ }
79bfcbda22SKatayama Hirofumi MZ pszArg0[ich] = 0;
80bfcbda22SKatayama Hirofumi MZ
81bfcbda22SKatayama Hirofumi MZ // skip space
82bfcbda22SKatayama Hirofumi MZ while (iswspace(*pch))
83bfcbda22SKatayama Hirofumi MZ ++pch;
84bfcbda22SKatayama Hirofumi MZ
85bfcbda22SKatayama Hirofumi MZ return pch;
86bfcbda22SKatayama Hirofumi MZ }
87bfcbda22SKatayama Hirofumi MZ
ShellExecCmdLine(HWND hwnd,LPCWSTR pwszCommand,LPCWSTR pwszStartDir,int nShow,LPVOID pUnused,DWORD dwSeclFlags)88bfcbda22SKatayama Hirofumi MZ HRESULT WINAPI ShellExecCmdLine(
89bfcbda22SKatayama Hirofumi MZ HWND hwnd,
90bfcbda22SKatayama Hirofumi MZ LPCWSTR pwszCommand,
91bfcbda22SKatayama Hirofumi MZ LPCWSTR pwszStartDir,
92bfcbda22SKatayama Hirofumi MZ int nShow,
93bfcbda22SKatayama Hirofumi MZ LPVOID pUnused,
94bfcbda22SKatayama Hirofumi MZ DWORD dwSeclFlags)
95bfcbda22SKatayama Hirofumi MZ {
96bfcbda22SKatayama Hirofumi MZ SHELLEXECUTEINFOW info;
97bfcbda22SKatayama Hirofumi MZ DWORD dwSize, dwError, dwType, dwFlags = SEE_MASK_DOENVSUBST | SEE_MASK_NOASYNC;
98bfcbda22SKatayama Hirofumi MZ LPCWSTR pszVerb = NULL;
99bfcbda22SKatayama Hirofumi MZ WCHAR szFile[MAX_PATH], szFile2[MAX_PATH];
100bfcbda22SKatayama Hirofumi MZ HRESULT hr;
101bfcbda22SKatayama Hirofumi MZ LPCWSTR pchParams;
102bfcbda22SKatayama Hirofumi MZ LPWSTR lpCommand = NULL;
103bfcbda22SKatayama Hirofumi MZ
104bfcbda22SKatayama Hirofumi MZ if (pwszCommand == NULL)
105bfcbda22SKatayama Hirofumi MZ RaiseException(EXCEPTION_ACCESS_VIOLATION, EXCEPTION_NONCONTINUABLE,
106bfcbda22SKatayama Hirofumi MZ 1, (ULONG_PTR*)pwszCommand);
107bfcbda22SKatayama Hirofumi MZ
108bfcbda22SKatayama Hirofumi MZ __SHCloneStrW(&lpCommand, pwszCommand);
109bfcbda22SKatayama Hirofumi MZ StrTrimW(lpCommand, L" \t");
110bfcbda22SKatayama Hirofumi MZ
111bfcbda22SKatayama Hirofumi MZ if (dwSeclFlags & SECL_NO_UI)
112bfcbda22SKatayama Hirofumi MZ dwFlags |= SEE_MASK_FLAG_NO_UI;
113bfcbda22SKatayama Hirofumi MZ if (dwSeclFlags & SECL_LOG_USAGE)
114bfcbda22SKatayama Hirofumi MZ dwFlags |= SEE_MASK_FLAG_LOG_USAGE;
115bfcbda22SKatayama Hirofumi MZ if (dwSeclFlags & SECL_USE_IDLIST)
116bfcbda22SKatayama Hirofumi MZ dwFlags |= SEE_MASK_INVOKEIDLIST;
117bfcbda22SKatayama Hirofumi MZ
118bfcbda22SKatayama Hirofumi MZ if (dwSeclFlags & SECL_RUNAS)
119bfcbda22SKatayama Hirofumi MZ {
120bfcbda22SKatayama Hirofumi MZ dwSize = 0;
121bfcbda22SKatayama Hirofumi MZ hr = AssocQueryStringW(0, ASSOCSTR_COMMAND, lpCommand, L"RunAs", NULL, &dwSize);
122bfcbda22SKatayama Hirofumi MZ if (SUCCEEDED(hr) && dwSize != 0)
123bfcbda22SKatayama Hirofumi MZ {
124bfcbda22SKatayama Hirofumi MZ pszVerb = L"runas";
125bfcbda22SKatayama Hirofumi MZ }
126bfcbda22SKatayama Hirofumi MZ }
127bfcbda22SKatayama Hirofumi MZ
128bfcbda22SKatayama Hirofumi MZ if (UrlIsFileUrlW(lpCommand))
129bfcbda22SKatayama Hirofumi MZ {
130bfcbda22SKatayama Hirofumi MZ StringCchCopyW(szFile, _countof(szFile), lpCommand);
131bfcbda22SKatayama Hirofumi MZ pchParams = NULL;
132bfcbda22SKatayama Hirofumi MZ }
133bfcbda22SKatayama Hirofumi MZ else
134bfcbda22SKatayama Hirofumi MZ {
135bfcbda22SKatayama Hirofumi MZ pchParams = SplitParams(lpCommand, szFile, _countof(szFile));
136fc11cf78SKatayama Hirofumi MZ if (szFile[0] != UNICODE_NULL && szFile[1] == L':' &&
137fc11cf78SKatayama Hirofumi MZ szFile[2] == UNICODE_NULL)
138fc11cf78SKatayama Hirofumi MZ {
139fc11cf78SKatayama Hirofumi MZ PathAddBackslashW(szFile);
140fc11cf78SKatayama Hirofumi MZ }
141fc11cf78SKatayama Hirofumi MZ
142fc11cf78SKatayama Hirofumi MZ WCHAR szCurDir[MAX_PATH];
143fc11cf78SKatayama Hirofumi MZ GetCurrentDirectoryW(_countof(szCurDir), szCurDir);
144fc11cf78SKatayama Hirofumi MZ if (pwszStartDir)
145fc11cf78SKatayama Hirofumi MZ {
146fc11cf78SKatayama Hirofumi MZ SetCurrentDirectoryW(pwszStartDir);
147fc11cf78SKatayama Hirofumi MZ }
148fc11cf78SKatayama Hirofumi MZ
149fc11cf78SKatayama Hirofumi MZ if (PathIsRelativeW(szFile) &&
150fc11cf78SKatayama Hirofumi MZ GetFullPathNameW(szFile, _countof(szFile2), szFile2, NULL) &&
151fc11cf78SKatayama Hirofumi MZ PathFileExistsW(szFile2))
152fc11cf78SKatayama Hirofumi MZ {
153fc11cf78SKatayama Hirofumi MZ StringCchCopyW(szFile, _countof(szFile), szFile2);
154fc11cf78SKatayama Hirofumi MZ }
155fc11cf78SKatayama Hirofumi MZ else if (SearchPathW(NULL, szFile, NULL, _countof(szFile2), szFile2, NULL) ||
156bfcbda22SKatayama Hirofumi MZ SearchPathW(NULL, szFile, wszExe, _countof(szFile2), szFile2, NULL) ||
157bfcbda22SKatayama Hirofumi MZ SearchPathW(NULL, szFile, wszCom, _countof(szFile2), szFile2, NULL) ||
158bfcbda22SKatayama Hirofumi MZ SearchPathW(pwszStartDir, szFile, NULL, _countof(szFile2), szFile2, NULL) ||
159bfcbda22SKatayama Hirofumi MZ SearchPathW(pwszStartDir, szFile, wszExe, _countof(szFile2), szFile2, NULL) ||
160bfcbda22SKatayama Hirofumi MZ SearchPathW(pwszStartDir, szFile, wszCom, _countof(szFile2), szFile2, NULL))
161bfcbda22SKatayama Hirofumi MZ {
162bfcbda22SKatayama Hirofumi MZ StringCchCopyW(szFile, _countof(szFile), szFile2);
163bfcbda22SKatayama Hirofumi MZ }
164bfcbda22SKatayama Hirofumi MZ else if (SearchPathW(NULL, lpCommand, NULL, _countof(szFile2), szFile2, NULL) ||
165bfcbda22SKatayama Hirofumi MZ SearchPathW(NULL, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) ||
166bfcbda22SKatayama Hirofumi MZ SearchPathW(NULL, lpCommand, wszCom, _countof(szFile2), szFile2, NULL) ||
167bfcbda22SKatayama Hirofumi MZ SearchPathW(pwszStartDir, lpCommand, NULL, _countof(szFile2), szFile2, NULL) ||
168bfcbda22SKatayama Hirofumi MZ SearchPathW(pwszStartDir, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) ||
169bfcbda22SKatayama Hirofumi MZ SearchPathW(pwszStartDir, lpCommand, wszCom, _countof(szFile2), szFile2, NULL))
170bfcbda22SKatayama Hirofumi MZ {
171bfcbda22SKatayama Hirofumi MZ StringCchCopyW(szFile, _countof(szFile), szFile2);
172bfcbda22SKatayama Hirofumi MZ pchParams = NULL;
173bfcbda22SKatayama Hirofumi MZ }
174bfcbda22SKatayama Hirofumi MZ
175fc11cf78SKatayama Hirofumi MZ if (pwszStartDir)
176fc11cf78SKatayama Hirofumi MZ {
177fc11cf78SKatayama Hirofumi MZ SetCurrentDirectoryW(szCurDir);
178fc11cf78SKatayama Hirofumi MZ }
179fc11cf78SKatayama Hirofumi MZ
180bfcbda22SKatayama Hirofumi MZ if (!(dwSeclFlags & SECL_ALLOW_NONEXE))
181bfcbda22SKatayama Hirofumi MZ {
182bfcbda22SKatayama Hirofumi MZ if (!GetBinaryTypeW(szFile, &dwType))
183bfcbda22SKatayama Hirofumi MZ {
184bfcbda22SKatayama Hirofumi MZ SHFree(lpCommand);
185bfcbda22SKatayama Hirofumi MZ
186bfcbda22SKatayama Hirofumi MZ if (!(dwSeclFlags & SECL_NO_UI))
187bfcbda22SKatayama Hirofumi MZ {
188bfcbda22SKatayama Hirofumi MZ WCHAR szText[128 + MAX_PATH], szFormat[128];
189bfcbda22SKatayama Hirofumi MZ LoadStringW(shell32_hInstance, IDS_FILE_NOT_FOUND, szFormat, _countof(szFormat));
190bfcbda22SKatayama Hirofumi MZ StringCchPrintfW(szText, _countof(szText), szFormat, szFile);
191bfcbda22SKatayama Hirofumi MZ MessageBoxW(hwnd, szText, NULL, MB_ICONERROR);
192bfcbda22SKatayama Hirofumi MZ }
193bfcbda22SKatayama Hirofumi MZ return CO_E_APPNOTFOUND;
194bfcbda22SKatayama Hirofumi MZ }
195bfcbda22SKatayama Hirofumi MZ }
196bfcbda22SKatayama Hirofumi MZ else
197bfcbda22SKatayama Hirofumi MZ {
198bfcbda22SKatayama Hirofumi MZ if (GetFileAttributesW(szFile) == INVALID_FILE_ATTRIBUTES)
199bfcbda22SKatayama Hirofumi MZ {
200bfcbda22SKatayama Hirofumi MZ SHFree(lpCommand);
201bfcbda22SKatayama Hirofumi MZ
202bfcbda22SKatayama Hirofumi MZ if (!(dwSeclFlags & SECL_NO_UI))
203bfcbda22SKatayama Hirofumi MZ {
204bfcbda22SKatayama Hirofumi MZ WCHAR szText[128 + MAX_PATH], szFormat[128];
205bfcbda22SKatayama Hirofumi MZ LoadStringW(shell32_hInstance, IDS_FILE_NOT_FOUND, szFormat, _countof(szFormat));
206bfcbda22SKatayama Hirofumi MZ StringCchPrintfW(szText, _countof(szText), szFormat, szFile);
207bfcbda22SKatayama Hirofumi MZ MessageBoxW(hwnd, szText, NULL, MB_ICONERROR);
208bfcbda22SKatayama Hirofumi MZ }
209bfcbda22SKatayama Hirofumi MZ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
210bfcbda22SKatayama Hirofumi MZ }
211bfcbda22SKatayama Hirofumi MZ }
212bfcbda22SKatayama Hirofumi MZ }
213bfcbda22SKatayama Hirofumi MZ
214bfcbda22SKatayama Hirofumi MZ ZeroMemory(&info, sizeof(info));
215bfcbda22SKatayama Hirofumi MZ info.cbSize = sizeof(info);
216bfcbda22SKatayama Hirofumi MZ info.fMask = dwFlags;
217bfcbda22SKatayama Hirofumi MZ info.hwnd = hwnd;
218bfcbda22SKatayama Hirofumi MZ info.lpVerb = pszVerb;
219bfcbda22SKatayama Hirofumi MZ info.lpFile = szFile;
220bfcbda22SKatayama Hirofumi MZ info.lpParameters = (pchParams && *pchParams) ? pchParams : NULL;
221bfcbda22SKatayama Hirofumi MZ info.lpDirectory = pwszStartDir;
222bfcbda22SKatayama Hirofumi MZ info.nShow = nShow;
223bfcbda22SKatayama Hirofumi MZ if (ShellExecuteExW(&info))
224bfcbda22SKatayama Hirofumi MZ {
225bfcbda22SKatayama Hirofumi MZ if (info.lpIDList)
226bfcbda22SKatayama Hirofumi MZ CoTaskMemFree(info.lpIDList);
227bfcbda22SKatayama Hirofumi MZ
228bfcbda22SKatayama Hirofumi MZ SHFree(lpCommand);
229bfcbda22SKatayama Hirofumi MZ
230bfcbda22SKatayama Hirofumi MZ return S_OK;
231bfcbda22SKatayama Hirofumi MZ }
232bfcbda22SKatayama Hirofumi MZ
233bfcbda22SKatayama Hirofumi MZ dwError = GetLastError();
234bfcbda22SKatayama Hirofumi MZ
235bfcbda22SKatayama Hirofumi MZ SHFree(lpCommand);
236bfcbda22SKatayama Hirofumi MZ
237bfcbda22SKatayama Hirofumi MZ return HRESULT_FROM_WIN32(dwError);
238bfcbda22SKatayama Hirofumi MZ }
23978edea81SKatayama Hirofumi MZ
24078edea81SKatayama Hirofumi MZ #undef ShellExecCmdLine
24178edea81SKatayama Hirofumi MZ
242bfcbda22SKatayama Hirofumi MZ typedef HRESULT (WINAPI *SHELLEXECCMDLINE)(HWND, LPCWSTR, LPCWSTR, INT, LPVOID, DWORD);
243bfcbda22SKatayama Hirofumi MZ SHELLEXECCMDLINE g_pShellExecCmdLine = NULL;
244bfcbda22SKatayama Hirofumi MZ
245bfcbda22SKatayama Hirofumi MZ typedef struct TEST_ENTRY
246bfcbda22SKatayama Hirofumi MZ {
247bfcbda22SKatayama Hirofumi MZ INT lineno;
248afd349a9SKatayama Hirofumi MZ BOOL result;
249bfcbda22SKatayama Hirofumi MZ BOOL bAllowNonExe;
250bfcbda22SKatayama Hirofumi MZ LPCWSTR pwszCommand;
251bfcbda22SKatayama Hirofumi MZ LPCWSTR pwszStartDir;
252bfcbda22SKatayama Hirofumi MZ } TEST_ENTRY;
253bfcbda22SKatayama Hirofumi MZ
254afd349a9SKatayama Hirofumi MZ static WCHAR s_sub_program[MAX_PATH];
255afd349a9SKatayama Hirofumi MZ static WCHAR s_win_test_exe[MAX_PATH];
256afd349a9SKatayama Hirofumi MZ static WCHAR s_sys_bat_file[MAX_PATH];
257afd349a9SKatayama Hirofumi MZ static WCHAR s_cur_dir[MAX_PATH];
258bfcbda22SKatayama Hirofumi MZ
259afd349a9SKatayama Hirofumi MZ static const TEST_ENTRY s_entries_1[] =
260bfcbda22SKatayama Hirofumi MZ {
261bfcbda22SKatayama Hirofumi MZ // NULL
262afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, FALSE, NULL, NULL },
263afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, FALSE, NULL, L"." },
264afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, FALSE, NULL, L"system32" },
265afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, FALSE, NULL, L"C:\\Program Files" },
266afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, TRUE, NULL, NULL },
267afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, TRUE, NULL, L"." },
268afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, TRUE, NULL, L"system32" },
269afd349a9SKatayama Hirofumi MZ { __LINE__, 0xBADFACE, TRUE, NULL, L"C:\\Program Files" },
270bfcbda22SKatayama Hirofumi MZ // notepad
271afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad", NULL },
272afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad", L"." },
273afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad", L"system32" },
274afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad", L"C:\\Program Files" },
275afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad \"Test File.txt\"", NULL },
276afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad \"Test File.txt\"", L"." },
277afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad", NULL },
278afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad", L"." },
279afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad", L"system32" },
280afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad", L"C:\\Program Files" },
281afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad \"Test File.txt\"", NULL },
282afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad \"Test File.txt\"", L"." },
283bfcbda22SKatayama Hirofumi MZ // notepad.exe
284afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad.exe", NULL },
285afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad.exe", L"." },
286afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad.exe", L"system32" },
287afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad.exe", L"C:\\Program Files" },
288afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad.exe \"Test File.txt\"", NULL },
289afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"notepad.exe \"Test File.txt\"", L"." },
290afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad.exe", NULL },
291afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad.exe", L"." },
292afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad.exe", L"system32" },
293afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad.exe", L"C:\\Program Files" },
294afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad.exe \"Test File.txt\"", NULL },
295afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"notepad.exe \"Test File.txt\"", L"." },
296bfcbda22SKatayama Hirofumi MZ // C:\notepad.exe
297afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"C:\\notepad.exe", NULL },
298afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"C:\\notepad.exe", L"." },
299afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"C:\\notepad.exe", L"system32" },
300afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"C:\\notepad.exe", L"C:\\Program Files" },
301afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"C:\\notepad.exe \"Test File.txt\"", NULL },
302afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"C:\\notepad.exe \"Test File.txt\"", L"." },
303afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"C:\\notepad.exe", NULL },
304afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"C:\\notepad.exe", L"." },
305afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"C:\\notepad.exe", L"system32" },
306afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"C:\\notepad.exe", L"C:\\Program Files" },
307afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"C:\\notepad.exe \"Test File.txt\"", NULL },
308afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"C:\\notepad.exe \"Test File.txt\"", L"." },
309bfcbda22SKatayama Hirofumi MZ // "notepad"
310afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad\"", NULL },
311afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad\"", L"." },
312afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad\"", L"system32" },
313afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad\"", L"C:\\Program Files" },
314afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad\" \"Test File.txt\"", NULL },
315afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad\" \"Test File.txt\"", L"." },
316afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad\"", NULL },
317afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad\"", L"." },
318afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad\"", L"system32" },
319afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad\"", L"C:\\Program Files" },
320afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad\" \"Test File.txt\"", NULL },
321afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad\" \"Test File.txt\"", L"." },
322bfcbda22SKatayama Hirofumi MZ // "notepad.exe"
323afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad.exe\"", NULL },
324afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad.exe\"", L"." },
325afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad.exe\"", L"system32" },
326afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad.exe\"", L"C:\\Program Files" },
327afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad.exe\" \"Test File.txt\"", NULL },
328afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"notepad.exe\" \"Test File.txt\"", L"." },
329afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad.exe\"", NULL },
330afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad.exe\"", L"." },
331afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad.exe\"", L"system32" },
332afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad.exe\"", L"C:\\Program Files" },
333afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad.exe\" \"Test File.txt\"", NULL },
334afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"notepad.exe\" \"Test File.txt\"", L"." },
335afd349a9SKatayama Hirofumi MZ // test program
336afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program", NULL },
337afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program", L"." },
338afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program", L"system32" },
339afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program", L"C:\\Program Files" },
340afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program \"Test File.txt\"", NULL },
341afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program \"Test File.txt\"", L"." },
342afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program", NULL },
343afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program", L"." },
344afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program", L"system32" },
345afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program", L"C:\\Program Files" },
346afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program \"Test File.txt\"", NULL },
347afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program \"Test File.txt\"", L"." },
348bfcbda22SKatayama Hirofumi MZ // test program.exe
349afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.exe", NULL },
350afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.exe", L"." },
351afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.exe", L"system32" },
352afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.exe", L"C:\\Program Files" },
353afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.exe \"Test File.txt\"", NULL },
354afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.exe \"Test File.txt\"", L"." },
355afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.exe", NULL },
356afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.exe", L"." },
357afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.exe", L"system32" },
358afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.exe", L"C:\\Program Files" },
359afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.exe \"Test File.txt\"", NULL },
360afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.exe \"Test File.txt\"", L"." },
361afd349a9SKatayama Hirofumi MZ // test program.bat
362afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.bat", NULL },
363afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.bat", L"." },
364afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.bat", L"system32" },
365afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.bat", L"C:\\Program Files" },
366afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.bat \"Test File.txt\"", NULL },
367afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"test program.bat \"Test File.txt\"", L"." },
368afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.bat", NULL },
369afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.bat", L"." },
370afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.bat", L"system32" },
371afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.bat", L"C:\\Program Files" },
372afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.bat \"Test File.txt\"", NULL },
373afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"test program.bat \"Test File.txt\"", L"." },
374bfcbda22SKatayama Hirofumi MZ // "test program"
375afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program\"", NULL },
376afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program\"", L"." },
377afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program\"", L"system32" },
378afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program\"", L"C:\\Program Files" },
379afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program\" \"Test File.txt\"", NULL },
380afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program\" \"Test File.txt\"", L"." },
381afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program\"", NULL },
382afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program\"", L"." },
383afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program\"", L"system32" },
384afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program\"", L"C:\\Program Files" },
385afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program\" \"Test File.txt\"", NULL },
386afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program\" \"Test File.txt\"", L"." },
387bfcbda22SKatayama Hirofumi MZ // "test program.exe"
388afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"test program.exe\"", NULL },
389afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"test program.exe\"", L"." },
390afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"test program.exe\"", L"system32" },
391afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"test program.exe\"", L"C:\\Program Files" },
392afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"test program.exe\" \"Test File.txt\"", NULL },
393afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"\"test program.exe\" \"Test File.txt\"", L"." },
394afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"test program.exe\"", NULL },
395afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"test program.exe\"", L"." },
396afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"test program.exe\"", L"system32" },
397afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"test program.exe\"", L"C:\\Program Files" },
398afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"test program.exe\" \"Test File.txt\"", NULL },
399afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"test program.exe\" \"Test File.txt\"", L"." },
400afd349a9SKatayama Hirofumi MZ // "test program.bat"
401afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program.bat\"", NULL },
402afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program.bat\"", L"." },
403afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program.bat\"", L"system32" },
404afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program.bat\"", L"C:\\Program Files" },
405afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program.bat\" \"Test File.txt\"", NULL },
406afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"test program.bat\" \"Test File.txt\"", L"." },
407afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program.bat\"", NULL },
408afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program.bat\"", L"." },
409afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program.bat\"", L"system32" },
410afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program.bat\"", L"C:\\Program Files" },
411afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program.bat\" \"Test File.txt\"", NULL },
412afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"test program.bat\" \"Test File.txt\"", L"." },
413bfcbda22SKatayama Hirofumi MZ // invalid program
414afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"invalid program", NULL },
415afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"invalid program", L"." },
416afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"invalid program", L"system32" },
417afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"invalid program", L"C:\\Program Files" },
418afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"invalid program \"Test File.txt\"", NULL },
419afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"invalid program \"Test File.txt\"", L"." },
420afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"invalid program", NULL },
421afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"invalid program", L"." },
422afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"invalid program", L"system32" },
423afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"invalid program", L"C:\\Program Files" },
424afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"invalid program \"Test File.txt\"", NULL },
425afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"invalid program \"Test File.txt\"", L"." },
426bfcbda22SKatayama Hirofumi MZ // \"invalid program.exe\"
427afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"invalid program.exe\"", NULL },
428afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"invalid program.exe\"", L"." },
429afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"invalid program.exe\"", L"system32" },
430afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"invalid program.exe\"", L"C:\\Program Files" },
431afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"invalid program.exe\" \"Test File.txt\"", NULL },
432afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"invalid program.exe\" \"Test File.txt\"", L"." },
433afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"invalid program.exe\"", NULL },
434afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"invalid program.exe\"", L"." },
435afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"invalid program.exe\"", L"system32" },
436afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"invalid program.exe\"", L"C:\\Program Files" },
437afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"invalid program.exe\" \"Test File.txt\"", NULL },
438afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"invalid program.exe\" \"Test File.txt\"", L"." },
43978edea81SKatayama Hirofumi MZ // My Documents
440afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"::{450d8fba-ad25-11d0-98a8-0800361b1103}", NULL },
441afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"shell:::{450d8fba-ad25-11d0-98a8-0800361b1103}", NULL },
44255345930SKatayama Hirofumi MZ // shell:sendto
443afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"shell:sendto", NULL },
444afd349a9SKatayama Hirofumi MZ // https://google.com
445afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, FALSE, L"https://google.com", NULL },
446afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"https://google.com", NULL },
447afd349a9SKatayama Hirofumi MZ // Test File 1.txt
448afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", NULL },
449afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", L"." },
450afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", L"system32" },
451afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", s_cur_dir },
452afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", NULL },
453afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", L"." },
454afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", L"system32" },
455afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", s_cur_dir },
456afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", NULL },
457afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", L"." },
458afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", L"system32" },
459afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 1.txt", NULL },
460afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"Test File 1.txt", L"." },
461afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 1.txt", L"system32" },
462afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"Test File 1.txt", s_cur_dir },
463afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 1.txt\"", NULL },
464afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", L"." },
465afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", L"system32" },
466afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", s_cur_dir },
467afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", NULL },
468afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", L"." },
469afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", L"system32" },
470afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", s_cur_dir },
471afd349a9SKatayama Hirofumi MZ // Test File 2.bat
472afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", NULL },
473afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", L"." },
474afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", L"system32" },
475afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", s_cur_dir },
476afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", NULL },
477afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", L"." },
478afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", L"system32" },
479afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", s_cur_dir },
480afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", NULL },
481afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", L"." },
482afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", L"system32" },
483afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", s_cur_dir },
484afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", NULL },
485afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", L"." },
486afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", L"system32" },
487afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", s_cur_dir },
488afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", NULL },
489afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", L"." },
490afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", L"system32" },
491afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", s_cur_dir },
492afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", NULL },
493afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", L"." },
494afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", L"system32" },
495afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", s_cur_dir },
496bfcbda22SKatayama Hirofumi MZ };
497bfcbda22SKatayama Hirofumi MZ
498afd349a9SKatayama Hirofumi MZ static const TEST_ENTRY s_entries_2[] =
499f37b94baSKatayama Hirofumi MZ {
500afd349a9SKatayama Hirofumi MZ // Test File 1.txt (with setting path)
501afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", NULL },
502afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", L"." },
503afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", L"system32" },
504afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 1.txt", s_cur_dir },
505afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", NULL },
506afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", L"." },
507afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", L"system32" },
508afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\"", s_cur_dir },
509afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", NULL },
510afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", L"." },
511afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", L"system32" },
512afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 1.txt\" \"Test File.txt\"", s_cur_dir },
513afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 1.txt", NULL },
514afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"Test File 1.txt", L"." },
515afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 1.txt", L"system32" },
516afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"Test File 1.txt", s_cur_dir },
517afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", NULL },
518afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", L"." },
519afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", L"system32" },
520afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\"", s_cur_dir },
521afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", NULL },
522afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", L"." },
523afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", L"system32" },
524afd349a9SKatayama Hirofumi MZ { __LINE__, TRUE, TRUE, L"\"Test File 1.txt\" \"Test File.txt\"", s_cur_dir },
525afd349a9SKatayama Hirofumi MZ // Test File 2.bat (with setting path)
526afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", NULL },
527afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", L"." },
528afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", L"system32" },
529afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"Test File 2.bat", s_cur_dir },
530afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", NULL },
531afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", L"." },
532afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", L"system32" },
533afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\"", s_cur_dir },
534afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", NULL },
535afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", L"." },
536afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", L"system32" },
537afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, FALSE, L"\"Test File 2.bat\" \"Test File.txt\"", s_cur_dir },
538afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", NULL },
539afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", L"." },
540afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", L"system32" },
541afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"Test File 2.bat", s_cur_dir },
542afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", NULL },
543afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", L"." },
544afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", L"system32" },
545afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\"", s_cur_dir },
546afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", NULL },
547afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", L"." },
548afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", L"system32" },
549afd349a9SKatayama Hirofumi MZ { __LINE__, FALSE, TRUE, L"\"Test File 2.bat\" \"Test File.txt\"", s_cur_dir },
550afd349a9SKatayama Hirofumi MZ };
551afd349a9SKatayama Hirofumi MZ
552afd349a9SKatayama Hirofumi MZ typedef struct OPENWNDS
553f37b94baSKatayama Hirofumi MZ {
554afd349a9SKatayama Hirofumi MZ UINT count;
555afd349a9SKatayama Hirofumi MZ HWND *phwnd;
556afd349a9SKatayama Hirofumi MZ } OPENWNDS;
557afd349a9SKatayama Hirofumi MZ
558afd349a9SKatayama Hirofumi MZ static OPENWNDS s_wi0 = { 0 }, s_wi1 = { 0 };
559afd349a9SKatayama Hirofumi MZ
EnumWindowsProc(HWND hwnd,LPARAM lParam)560afd349a9SKatayama Hirofumi MZ static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
561f37b94baSKatayama Hirofumi MZ {
562afd349a9SKatayama Hirofumi MZ OPENWNDS *info = (OPENWNDS *)lParam;
563afd349a9SKatayama Hirofumi MZ info->phwnd = (HWND *)realloc(info->phwnd, (info->count + 1) * sizeof(HWND));
564afd349a9SKatayama Hirofumi MZ if (!info->phwnd)
565afd349a9SKatayama Hirofumi MZ return FALSE;
566afd349a9SKatayama Hirofumi MZ info->phwnd[info->count] = hwnd;
567afd349a9SKatayama Hirofumi MZ ++(info->count);
568afd349a9SKatayama Hirofumi MZ return TRUE;
569f37b94baSKatayama Hirofumi MZ }
570f37b94baSKatayama Hirofumi MZ
CleanupNewlyCreatedWindows(void)571418edcd2SKatayama Hirofumi MZ static void CleanupNewlyCreatedWindows(void)
572418edcd2SKatayama Hirofumi MZ {
573418edcd2SKatayama Hirofumi MZ EnumWindows(EnumWindowsProc, (LPARAM)&s_wi1);
574418edcd2SKatayama Hirofumi MZ for (UINT i1 = 0; i1 < s_wi1.count; ++i1)
575418edcd2SKatayama Hirofumi MZ {
576418edcd2SKatayama Hirofumi MZ BOOL bFound = FALSE;
577418edcd2SKatayama Hirofumi MZ for (UINT i0 = 0; i0 < s_wi0.count; ++i0)
578418edcd2SKatayama Hirofumi MZ {
579418edcd2SKatayama Hirofumi MZ if (s_wi1.phwnd[i1] == s_wi0.phwnd[i0])
580418edcd2SKatayama Hirofumi MZ {
581418edcd2SKatayama Hirofumi MZ bFound = TRUE;
582418edcd2SKatayama Hirofumi MZ break;
583418edcd2SKatayama Hirofumi MZ }
584418edcd2SKatayama Hirofumi MZ }
585418edcd2SKatayama Hirofumi MZ if (!bFound)
5864bf32102SHermès Bélusca-Maïto PostMessageW(s_wi1.phwnd[i1], WM_CLOSE, 0, 0);
587418edcd2SKatayama Hirofumi MZ }
588418edcd2SKatayama Hirofumi MZ free(s_wi1.phwnd);
589418edcd2SKatayama Hirofumi MZ ZeroMemory(&s_wi1, sizeof(s_wi1));
590418edcd2SKatayama Hirofumi MZ }
591418edcd2SKatayama Hirofumi MZ
DoEntry(const TEST_ENTRY * pEntry)592bfcbda22SKatayama Hirofumi MZ static void DoEntry(const TEST_ENTRY *pEntry)
593bfcbda22SKatayama Hirofumi MZ {
594bfcbda22SKatayama Hirofumi MZ HRESULT hr;
595bfcbda22SKatayama Hirofumi MZ DWORD dwSeclFlags;
596afd349a9SKatayama Hirofumi MZ BOOL result;
597bfcbda22SKatayama Hirofumi MZ
598bfcbda22SKatayama Hirofumi MZ if (pEntry->bAllowNonExe)
599bfcbda22SKatayama Hirofumi MZ dwSeclFlags = SECL_NO_UI | SECL_ALLOW_NONEXE;
600bfcbda22SKatayama Hirofumi MZ else
601bfcbda22SKatayama Hirofumi MZ dwSeclFlags = SECL_NO_UI;
602bfcbda22SKatayama Hirofumi MZ
603bfcbda22SKatayama Hirofumi MZ _SEH2_TRY
604bfcbda22SKatayama Hirofumi MZ {
60578edea81SKatayama Hirofumi MZ if (IsReactOS())
60678edea81SKatayama Hirofumi MZ {
60778edea81SKatayama Hirofumi MZ hr = proxy_ShellExecCmdLine(NULL, pEntry->pwszCommand, pEntry->pwszStartDir,
608bfcbda22SKatayama Hirofumi MZ SW_SHOWNORMAL, NULL, dwSeclFlags);
60978edea81SKatayama Hirofumi MZ }
61078edea81SKatayama Hirofumi MZ else
61178edea81SKatayama Hirofumi MZ {
612bfcbda22SKatayama Hirofumi MZ hr = (*g_pShellExecCmdLine)(NULL, pEntry->pwszCommand, pEntry->pwszStartDir,
613bfcbda22SKatayama Hirofumi MZ SW_SHOWNORMAL, NULL, dwSeclFlags);
61478edea81SKatayama Hirofumi MZ }
615bfcbda22SKatayama Hirofumi MZ }
616bfcbda22SKatayama Hirofumi MZ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
617bfcbda22SKatayama Hirofumi MZ {
618afd349a9SKatayama Hirofumi MZ hr = 0xBADFACE;
619bfcbda22SKatayama Hirofumi MZ }
620bfcbda22SKatayama Hirofumi MZ _SEH2_END;
621bfcbda22SKatayama Hirofumi MZ
622afd349a9SKatayama Hirofumi MZ if (hr == 0xBADFACE)
623afd349a9SKatayama Hirofumi MZ result = hr;
624afd349a9SKatayama Hirofumi MZ else
625afd349a9SKatayama Hirofumi MZ result = (hr == S_OK);
626bfcbda22SKatayama Hirofumi MZ
627afd349a9SKatayama Hirofumi MZ ok(result == pEntry->result, "Line %d: result expected %d, was %d\n",
628afd349a9SKatayama Hirofumi MZ pEntry->lineno, pEntry->result, result);
629afd349a9SKatayama Hirofumi MZ
630418edcd2SKatayama Hirofumi MZ CleanupNewlyCreatedWindows();
631afd349a9SKatayama Hirofumi MZ }
632bfcbda22SKatayama Hirofumi MZ
START_TEST(ShellExecCmdLine)633bfcbda22SKatayama Hirofumi MZ START_TEST(ShellExecCmdLine)
634bfcbda22SKatayama Hirofumi MZ {
635bfcbda22SKatayama Hirofumi MZ using namespace std;
636bfcbda22SKatayama Hirofumi MZ
63778edea81SKatayama Hirofumi MZ if (!IsReactOS())
63878edea81SKatayama Hirofumi MZ {
639465745b6STimo Kreuzer if (!IsWindowsVistaOrGreater())
640465745b6STimo Kreuzer {
641465745b6STimo Kreuzer skip("ShellExecCmdLine is not available on this platform\n");
642465745b6STimo Kreuzer return;
643465745b6STimo Kreuzer }
644465745b6STimo Kreuzer
645bfcbda22SKatayama Hirofumi MZ HMODULE hShell32 = GetModuleHandleA("shell32");
646bfcbda22SKatayama Hirofumi MZ g_pShellExecCmdLine = (SHELLEXECCMDLINE)GetProcAddress(hShell32, (LPCSTR)(INT_PTR)265);
647bfcbda22SKatayama Hirofumi MZ if (!g_pShellExecCmdLine)
648bfcbda22SKatayama Hirofumi MZ {
649bfcbda22SKatayama Hirofumi MZ skip("ShellExecCmdLine is not found\n");
650bfcbda22SKatayama Hirofumi MZ return;
651bfcbda22SKatayama Hirofumi MZ }
65278edea81SKatayama Hirofumi MZ }
653bfcbda22SKatayama Hirofumi MZ
654*75cc5b2bSKatayama Hirofumi MZ if (!FindSubProgram(s_sub_program, _countof(s_sub_program)))
655afd349a9SKatayama Hirofumi MZ {
656afd349a9SKatayama Hirofumi MZ skip("shell32_apitest_sub.exe is not found\n");
657afd349a9SKatayama Hirofumi MZ return;
658afd349a9SKatayama Hirofumi MZ }
659f37b94baSKatayama Hirofumi MZ
660afd349a9SKatayama Hirofumi MZ // record open windows
661afd349a9SKatayama Hirofumi MZ if (!EnumWindows(EnumWindowsProc, (LPARAM)&s_wi0))
662afd349a9SKatayama Hirofumi MZ {
663afd349a9SKatayama Hirofumi MZ skip("EnumWindows failed\n");
664afd349a9SKatayama Hirofumi MZ free(s_wi0.phwnd);
665afd349a9SKatayama Hirofumi MZ return;
666afd349a9SKatayama Hirofumi MZ }
667afd349a9SKatayama Hirofumi MZ
668afd349a9SKatayama Hirofumi MZ // s_win_test_exe
669afd349a9SKatayama Hirofumi MZ GetWindowsDirectoryW(s_win_test_exe, _countof(s_win_test_exe));
670afd349a9SKatayama Hirofumi MZ PathAppendW(s_win_test_exe, L"test program.exe");
671afd349a9SKatayama Hirofumi MZ BOOL ret = CopyFileW(s_sub_program, s_win_test_exe, FALSE);
672afd349a9SKatayama Hirofumi MZ if (!ret)
673afd349a9SKatayama Hirofumi MZ {
674afd349a9SKatayama Hirofumi MZ skip("Please retry with admin rights\n");
675afd349a9SKatayama Hirofumi MZ free(s_wi0.phwnd);
676afd349a9SKatayama Hirofumi MZ return;
677afd349a9SKatayama Hirofumi MZ }
678afd349a9SKatayama Hirofumi MZ
679afd349a9SKatayama Hirofumi MZ FILE *fp;
680afd349a9SKatayama Hirofumi MZ
681afd349a9SKatayama Hirofumi MZ // s_sys_bat_file
682afd349a9SKatayama Hirofumi MZ GetSystemDirectoryW(s_sys_bat_file, _countof(s_sys_bat_file));
683afd349a9SKatayama Hirofumi MZ PathAppendW(s_sys_bat_file, L"test program.bat");
684afd349a9SKatayama Hirofumi MZ fp = _wfopen(s_sys_bat_file, L"wb");
685afd349a9SKatayama Hirofumi MZ fclose(fp);
686afd349a9SKatayama Hirofumi MZ ok_int(PathFileExistsW(s_sys_bat_file), TRUE);
687afd349a9SKatayama Hirofumi MZ
688afd349a9SKatayama Hirofumi MZ // "Test File 1.txt"
689afd349a9SKatayama Hirofumi MZ fp = fopen("Test File 1.txt", "wb");
690bfcbda22SKatayama Hirofumi MZ ok(fp != NULL, "failed to create a test file\n");
691bfcbda22SKatayama Hirofumi MZ fclose(fp);
692afd349a9SKatayama Hirofumi MZ ok_int(PathFileExistsA("Test File 1.txt"), TRUE);
693bfcbda22SKatayama Hirofumi MZ
694afd349a9SKatayama Hirofumi MZ // "Test File 2.bat"
695afd349a9SKatayama Hirofumi MZ fp = fopen("Test File 2.bat", "wb");
696bfcbda22SKatayama Hirofumi MZ ok(fp != NULL, "failed to create a test file\n");
697bfcbda22SKatayama Hirofumi MZ fclose(fp);
698afd349a9SKatayama Hirofumi MZ ok_int(PathFileExistsA("Test File 2.bat"), TRUE);
699bfcbda22SKatayama Hirofumi MZ
700afd349a9SKatayama Hirofumi MZ // s_cur_dir
701afd349a9SKatayama Hirofumi MZ GetCurrentDirectoryW(_countof(s_cur_dir), s_cur_dir);
702afd349a9SKatayama Hirofumi MZ
703afd349a9SKatayama Hirofumi MZ // do tests
704afd349a9SKatayama Hirofumi MZ for (size_t i = 0; i < _countof(s_entries_1); ++i)
705bfcbda22SKatayama Hirofumi MZ {
706afd349a9SKatayama Hirofumi MZ DoEntry(&s_entries_1[i]);
707bfcbda22SKatayama Hirofumi MZ }
708afd349a9SKatayama Hirofumi MZ SetEnvironmentVariableW(L"PATH", s_cur_dir);
709afd349a9SKatayama Hirofumi MZ for (size_t i = 0; i < _countof(s_entries_2); ++i)
710bfcbda22SKatayama Hirofumi MZ {
711afd349a9SKatayama Hirofumi MZ DoEntry(&s_entries_2[i]);
712bfcbda22SKatayama Hirofumi MZ }
713bfcbda22SKatayama Hirofumi MZ
714418edcd2SKatayama Hirofumi MZ Sleep(2000);
715418edcd2SKatayama Hirofumi MZ CleanupNewlyCreatedWindows();
716418edcd2SKatayama Hirofumi MZ
717bfcbda22SKatayama Hirofumi MZ // clean up
718afd349a9SKatayama Hirofumi MZ ok(DeleteFileW(s_win_test_exe), "failed to delete the test file\n");
719afd349a9SKatayama Hirofumi MZ ok(DeleteFileW(s_sys_bat_file), "failed to delete the test file\n");
720afd349a9SKatayama Hirofumi MZ ok(DeleteFileA("Test File 1.txt"), "failed to delete the test file\n");
721afd349a9SKatayama Hirofumi MZ ok(DeleteFileA("Test File 2.bat"), "failed to delete the test file\n");
722afd349a9SKatayama Hirofumi MZ free(s_wi0.phwnd);
72360b89da3SKatayama Hirofumi MZ
72425e2f5f2SKatayama Hirofumi MZ DoWaitForWindow(SUB_CLASSNAME, SUB_CLASSNAME, TRUE, TRUE);
72560b89da3SKatayama Hirofumi MZ Sleep(100);
726bfcbda22SKatayama Hirofumi MZ }
727