ReactOS 0.4.17-dev-683-g0dafdc5
ShellExecuteEx.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Testing ShellExecuteEx
5 * PROGRAMMER: Yaroslav Veremenko <yaroslav@veremenko.info>
6 * Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 */
8
9#include "shelltest.h"
10#include "closewnd.h"
11#include <pstypes.h>
12#include <psfuncs.h>
13#include <stdlib.h>
14#include <stdio.h>
15#include <strsafe.h>
16#include <versionhelpers.h>
17#include <shellutils.h>
18#include "shell32_apitest_sub.h"
19
20static void RunTest(LPTHREAD_START_ROUTINE TestFunc, UINT TimeOut = 1000 * 30)
21{
22 // These tests have a tendency to hang, kill it if it takes too long
24 if (hThread)
25 {
29 }
30}
31
32template<class T> static T& Reset(T &sei, UINT flags = SEE_MASK_FLAG_NO_UI)
33{
34 ZeroMemory(&sei, sizeof(T));
35 sei.cbSize = sizeof(T);
36 sei.fMask = flags;
37 sei.nShow = SW_SHOW;
38 return sei;
39}
40
56
57#define REG_APPPATHS L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
58
59typedef enum TEST_RESULT
60{
65
66typedef struct TEST_ENTRY
67{
68 INT line;
73
74static void
76
77static void TEST_DoTestEntries(void)
78{
81 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"This is an invalid path.");
94 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_WITH_PROCESS, L"\"test program.exe\"", s_sys_test_exe_cmdline);
97 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"shell:ThisIsAnInvalidName");
98 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"); // My Computer
99 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"); // My Computer (with shell:)
100
102 {
103 WCHAR szCurDir[MAX_PATH];
104 GetCurrentDirectoryW(_countof(szCurDir), szCurDir);
106 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); // Control Panel (without path)
107 SetCurrentDirectoryW(szCurDir);
108 }
109
110 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); // Control Panel (with path)
111 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); // Control Panel (with path and shell:)
112 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:AppData");
113 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common Desktop");
114 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common Programs");
115 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common Start Menu");
116 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common StartUp");
117 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:ControlPanelFolder");
118 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Desktop");
119 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Favorites");
120 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Fonts");
121 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Local AppData");
122 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:My Pictures");
123 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Personal");
124 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Programs");
125 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Recent");
126 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:RecycleBinFolder");
127 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:SendTo");
128 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Start Menu");
129 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:StartUp");
130}
131
132static LPWSTR
134{
135 PEB peb;
139 BOOL ret;
140
143
144 ret = ReadProcessMemory(hProcess, info.PebBaseAddress, &peb, sizeof(peb), NULL);
145 if (!ret)
146 trace("ReadProcessMemory failed (%ld)\n", GetLastError());
147
149 if (!ret)
150 trace("ReadProcessMemory failed (%ld)\n", GetLastError());
151
152 LPWSTR cmdline = Params.CommandLine.Buffer;
153 if (!cmdline)
154 trace("!cmdline\n");
155
156 SIZE_T cbCmdLine = Params.CommandLine.Length;
157 if (!cbCmdLine)
158 trace("!cbCmdLine\n");
159
160 LPWSTR pszBuffer = (LPWSTR)calloc(cbCmdLine + sizeof(WCHAR), 1);
161 if (!pszBuffer)
162 trace("!pszBuffer\n");
163
164 ret = ReadProcessMemory(hProcess, cmdline, pszBuffer, cbCmdLine, NULL);
165 if (!ret)
166 trace("ReadProcessMemory failed (%ld)\n", GetLastError());
167
168 pszBuffer[cbCmdLine / sizeof(WCHAR)] = UNICODE_NULL;
169
170 return pszBuffer; // needs free()
171}
172
174{
175 SHELLEXECUTEINFOW info = { sizeof(info) };
178 info.hwnd = NULL;
179 info.lpVerb = NULL;
180 info.lpFile = pEntry->lpFile;
181 info.nShow = SW_SHOWNORMAL;
182
184
186 if (ret && info.hProcess)
188 else if (ret && !info.hProcess)
190 else
192
193 ok(pEntry->result == result,
194 "Line %d: result: %d vs %d\n", pEntry->line, pEntry->result, result);
195
197 WaitForInputIdle(info.hProcess, 2000);
198
199 if (pEntry->result == TEST_SUCCESS_WITH_PROCESS && pEntry->cmdline && !s_bWow64)
200 {
202 if (!cmdline)
203 {
204 skip("!cmdline\n");
205 }
206 else
207 {
208 ok(lstrcmpiW(pEntry->cmdline, cmdline) == 0,
209 "Line %d: cmdline: '%ls' vs '%ls'\n", pEntry->line,
210 pEntry->cmdline, cmdline);
211 }
212
213 TerminateProcess(info.hProcess, 0xDEADFACE);
214 free(cmdline);
215 }
216
217 CloseHandle(info.hProcess);
218 return result;
219}
220
221static void
223{
224 WINDOW_LIST existingwindows;
225 GetWindowList(&existingwindows);
226 HWND hWndForeground = GetForegroundWindow();
227
228 TEST_ENTRY entry = { line, result, lpFile, cmdline };
230
232 {
233 // Wait a bit for Explorer to open its window
234 for (UINT i = 0; i < 2000 && hWndForeground == GetForegroundWindow(); i += 250)
235 Sleep(250);
236 }
237
238 CloseNewWindows(&existingwindows);
239 FreeWindowList(&existingwindows);
240}
241
242static BOOL
244{
245 HANDLE hToken;
247 return FALSE;
248
249 TOKEN_PRIVILEGES tkp = { 0 };
250 if (!LookupPrivilegeValueW(NULL, pszPrivilege, &tkp.Privileges[0].Luid))
251 return FALSE;
252
253 tkp.PrivilegeCount = 1;
255 return AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL);
256}
257
259
260static BOOL TEST_Start(void)
261{
262 // Check Wow64
263 s_bWow64 = FALSE;
265 if (s_bWow64)
266 skip("Wow64: Command Line check is skipped\n");
267
268 // getCommandLineFromProcess needs this
270
271 // s_win_dir
273
274 // s_sys_dir
276
277 // s_win_notepad
279 PathAppendW(s_win_notepad, L"notepad.exe");
280
281 // s_sys_notepad
283 PathAppendW(s_sys_notepad, L"notepad.exe");
284
285 // s_win_test_exe
287 PathAppendW(s_win_test_exe, L"test program.exe");
289 if (!ret)
290 {
291 skip("Please retry with admin rights\n");
292 return FALSE;
293 }
294
295 // s_sys_test_exe
297 PathAppendW(s_sys_test_exe, L"test program.exe");
299
300 // s_win_bat_file
302 PathAppendW(s_win_bat_file, L"test program.bat");
303 FILE *fp = _wfopen(s_win_bat_file, L"wb");
304 fprintf(fp, "exit /b 3");
305 fclose(fp);
307
308 // s_sys_bat_file
310 PathAppendW(s_sys_bat_file, L"test program.bat");
311 fp = _wfopen(s_sys_bat_file, L"wb");
312 fprintf(fp, "exit /b 4");
313 fclose(fp);
315
316 // s_win_txt_file
318 PathAppendW(s_win_txt_file, L"test_file.txt");
319 fp = _wfopen(s_win_txt_file, L"wb");
320 fclose(fp);
322
323 // s_sys_txt_file
325 PathAppendW(s_sys_txt_file, L"test_file.txt");
326 fp = _wfopen(s_sys_txt_file, L"wb");
327 fclose(fp);
329
330 // Check .txt settings
333 if (lstrcmpiW(PathFindFileNameW(szPath), L"notepad.exe") != 0)
334 {
335 skip("Please associate .txt with notepad.exe before tests\n");
336 return FALSE;
337 }
338
339 // command lines
341 L"\"%s\" ", s_win_notepad);
343 L"\"%s\" ", s_sys_notepad);
345 L"\"%s\" ", s_win_test_exe);
347 L"\"%s\" ", s_sys_test_exe);
348
350
351 return TRUE;
352}
353
354static void TEST_End(void)
355{
362
363 // Execution can be asynchronous; you have to wait for it to finish.
364 INT nCount = GetWindowCount();
365 for (INT i = 0; i < 100; ++i)
366 {
367 INT nOldCount = nCount;
368 Sleep(3000);
369 nCount = GetWindowCount();
370 if (nOldCount == nCount)
371 break;
372 }
373 Sleep(3000);
374
375 // Close newly-opened window(s)
380}
381
382static void test_properties()
383{
384 HRESULT hrCoInit = CoInitialize(NULL);
385
386 WCHAR Buffer[MAX_PATH * 4];
388
389 SHELLEXECUTEINFOW info = { sizeof(info) };
391 info.lpVerb = L"properties";
392 info.lpFile = Buffer;
393 info.nShow = SW_SHOW;
394
395 BOOL bRet = ShellExecuteExW(&info);
396 ok(bRet, "Failed! (GetLastError(): %d)\n", (int)GetLastError());
397 ok_ptr(info.hInstApp, (HINSTANCE)42);
398
400 if (Extension)
401 {
402 // The inclusion of this depends on the file display settings!
404 }
405
406 // Now retry it with the extension cut off
407 bRet = ShellExecuteExW(&info);
408 ok(bRet, "Failed! (GetLastError(): %d)\n", (int)GetLastError());
409 ok_ptr(info.hInstApp, (HINSTANCE)42);
410
411 // Now retry it with complete garabage
412 info.lpFile = L"complete garbage, cannot run this!";
413 bRet = ShellExecuteExW(&info);
414 ok_int(bRet, 0);
415 ok_ptr(info.hInstApp, (HINSTANCE)2);
416
417 if (SUCCEEDED(hrCoInit))
419}
420
421static void test_sei_lpIDList()
422{
423 // Note: SEE_MASK_FLAG_NO_UI prevents the test from blocking with a MessageBox
425
426 /* This tests ShellExecuteEx with lpIDList for explorer C:\ */
430 if (!pidl)
431 {
432 skip("Unable to initialize test\n");
433 return;
434 }
435
436 SHELLEXECUTEINFOW ShellExecInfo = { sizeof(ShellExecInfo) };
437 ShellExecInfo.nShow = SW_SHOWNORMAL;
439 ShellExecInfo.lpIDList = pidl;
440 BOOL ret = ShellExecuteExW(&ShellExecInfo);
441 ok_int(ret, TRUE);
442 ILFree(pidl);
443
444 /* This tests ShellExecuteEx with lpIDList going through IContextMenu */
445 CCoInit ComInit;
447 if (!pidl)
448 {
449 skip("Unable to initialize test\n");
450 return;
451 }
453 ShellExecInfo.lpIDList = pidl;
454 ret = ShellExecuteExW(&ShellExecInfo);
455 ok_int(ret, TRUE);
456 ILFree(pidl);
457}
458
459static BOOL
461{
462 WCHAR szSubKey[MAX_PATH];
463 StringCchPrintfW(szSubKey, _countof(szSubKey), L"%s\\%s", REG_APPPATHS, pszName);
464
466 HKEY hKey;
468 &hKey, NULL);
469 if (error != ERROR_SUCCESS)
470 trace("Could not create test key (%lu)\n", error);
471
472 DWORD cbValue = (lstrlenW(pszValue) + 1) * sizeof(WCHAR);
474 if (error != ERROR_SUCCESS)
475 trace("Could not set value of the test key (%lu)\n", error);
476
478
479 return error == ERROR_SUCCESS;
480}
481
482static VOID
484{
485 WCHAR szSubKey[MAX_PATH];
486 StringCchPrintfW(szSubKey, _countof(szSubKey), L"%s\\%s", REG_APPPATHS, pszName);
487
489 if (error != ERROR_SUCCESS)
490 trace("Could not remove the test key (%lu)\n", error);
491}
492
493static void TEST_AppPath(void)
494{
495 if (CreateAppPath(L"app_path_test.bat", s_win_test_exe))
496 {
497 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_WITH_PROCESS, L"app_path_test.bat");
498 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"app_path_test.bat.exe");
499 DeleteAppPath(L"app_path_test.bat");
500 }
501
502 if (CreateAppPath(L"app_path_test.bat.exe", s_sys_test_exe))
503 {
504 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"app_path_test.bat");
505 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_WITH_PROCESS, L"app_path_test.bat.exe");
506 DeleteAppPath(L"app_path_test.bat.exe");
507 }
508}
509
510static void test_DoInvalidDir(void)
511{
512 WCHAR szSubProgram[MAX_PATH];
513 if (!FindSubProgram(szSubProgram, _countof(szSubProgram)))
514 {
515 skip("shell32_apitest_sub.exe not found\n");
516 return;
517 }
518
519 DWORD dwExitCode;
521 sei.lpFile = szSubProgram;
522 sei.lpParameters = L"TEST";
523 sei.nShow = SW_SHOWNORMAL;
524
525 // Test invalid path on sei.lpDirectory
526 WCHAR szInvalidPath[MAX_PATH] = L"M:\\This is an invalid path\n";
527 sei.lpDirectory = szInvalidPath;
529 WaitForSingleObject(sei.hProcess, 20 * 1000);
530 GetExitCodeProcess(sei.hProcess, &dwExitCode);
531 ok_long(dwExitCode, 0);
533}
534
536{
537 CCoInit ComInit;
538 UINT err, ret;
539 WCHAR Path[MAX_PATH * 2];
540 CComHeapPtr<ITEMIDLIST> pidl;
542
545 PathAppendW(Path, L"cmd.exe");
546 sei.lpParameters = L"/C exit 0";
547 sei.lpIDList = LPITEMIDLIST((pidl.Attach(ILCreateFromPathW(Path)), pidl));
548 if (!pidl)
549 {
550 skip("No exe to test\n");
551 return 0;
552 }
553
554 sei.lpVerb = NULL;
555 ok(ShellExecuteExW(&sei), "Failed with error %lu\n", GetLastError());
556
557 sei.lpVerb = L"open";
558 ok(ShellExecuteExW(&sei), "Failed with error %lu\n", GetLastError());
559
560 sei.lpVerb = L"Shell32_Test_DoesNotExist";
561 ret = ShellExecuteExW(&sei), err = GetLastError();
562 ok(!ret, "Expected failure\n");
564
565 return 0;
566}
567
569{
571
572 // FIXME: These tests are broken (silent skip for now)
573 if (!lstrcmpiW(L"", L""))
574 return;
575
576#ifdef _WIN64
577 skip("Win64 is not supported yet\n");
578 return;
579#endif
580
581 if (!TEST_Start())
582 return;
583
584 TEST_AppPath();
589
590 TEST_End();
591}
static KSTART_ROUTINE RunTest
Definition: NpfsConnect.c:238
PRTL_UNICODE_STRING_BUFFER Path
static WINDOW_LIST s_List2
static WCHAR s_win_dir[MAX_PATH]
static WCHAR s_sys_bat_file[MAX_PATH]
static WCHAR s_sys_test_exe_cmdline[MAX_PATH]
static BOOL enableTokenPrivilege(LPCWSTR pszPrivilege)
TEST_RESULT
@ TEST_FAILED
@ TEST_SUCCESS_NO_PROCESS
@ TEST_SUCCESS_WITH_PROCESS
static WCHAR s_win_txt_file[MAX_PATH]
static WCHAR s_win_test_exe[MAX_PATH]
static WCHAR s_sys_notepad_cmdline[MAX_PATH]
static WCHAR s_win_test_exe_cmdline[MAX_PATH]
static void test_sei_lpIDList()
static WCHAR s_win_bat_file[MAX_PATH]
static void TEST_DoTestEntry(INT line, TEST_RESULT result, LPCWSTR lpFile, LPCWSTR cmdline=NULL)
static BOOL TEST_Start(void)
static TEST_RESULT TEST_DoTestEntryStruct(const TEST_ENTRY *pEntry)
static DWORD CALLBACK Test_InvokeIdList(LPVOID)
static WCHAR s_win_notepad[MAX_PATH]
static WCHAR s_sys_test_exe[MAX_PATH]
static void test_properties()
static void TEST_AppPath(void)
static BOOL s_bWow64
static WCHAR s_win_notepad_cmdline[MAX_PATH]
static WCHAR s_sys_notepad[MAX_PATH]
static WCHAR s_sys_txt_file[MAX_PATH]
static void test_DoInvalidDir(void)
#define REG_APPPATHS
static WINDOW_LIST s_List1
struct TEST_ENTRY TEST_ENTRY
struct TEST_ENTRY * PTEST_ENTRY
static void TEST_DoTestEntries(void)
static void TEST_End(void)
static BOOL CreateAppPath(LPCWSTR pszName, LPCWSTR pszValue)
static T & Reset(T &sei, UINT flags=SEE_MASK_FLAG_NO_UI)
static WCHAR s_sys_dir[MAX_PATH]
static VOID DeleteAppPath(LPCWSTR pszName)
static LPWSTR getCommandLineFromProcess(HANDLE hProcess)
#define ok_ntstatus(status, expected)
Definition: atltest.h:135
#define ok_long(expression, result)
Definition: atltest.h:133
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define ok_ptr(expression, result)
Definition: atltest.h:108
LONG NTSTATUS
Definition: precomp.h:26
#define RegCloseKey(hKey)
Definition: registry.h:49
@ ProcessBasicInformation
Definition: cicbase.cpp:63
Definition: bufpool.h:45
static VOID FreeWindowList(PWINDOW_LIST pList)
Definition: closewnd.h:20
static INT GetWindowCount(VOID)
Definition: closewnd.h:135
static VOID CloseNewWindows(PWINDOW_LIST pExisting, PWINDOW_LIST pNew)
Definition: closewnd.h:78
static VOID GetWindowList(PWINDOW_LIST pList)
Definition: closewnd.h:42
#define free
Definition: debug_ros.c:5
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
#define CloseHandle
Definition: compat.h:739
#define ReadProcessMemory(a, b, c, d, e)
Definition: compat.h:758
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define GetCurrentProcess()
Definition: compat.h:759
#define IsWow64Process
Definition: compat.h:760
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2168
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2232
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2271
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1165
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1375
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:587
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
Definition: path.c:1677
LPWSTR WINAPI PathFindExtensionW(const WCHAR *path)
Definition: path.c:1250
BOOL WINAPI PathStripToRootW(WCHAR *path)
Definition: path.c:1171
BOOL WINAPI PathFileExistsW(const WCHAR *path)
Definition: path.c:2583
int CDECL fclose(FILE *file)
Definition: file.c:3757
int WINAPIV fprintf(FILE *file, const char *format,...)
Definition: file.c:5549
FILE *CDECL _wfopen(const wchar_t *path, const wchar_t *mode)
Definition: file.c:4335
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
int TestFunc(int,...)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
FxAutoRegKey hKey
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
Status
Definition: gdiplustypes.h:24
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:50
uint32_t entry
Definition: isohybrid.c:63
#define REG_SZ
Definition: layer.c:22
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
#define ZeroMemory
Definition: minwinbase.h:31
PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE
Definition: minwinbase.h:124
#define error(str)
Definition: mkdosfs.c:1605
LPCWSTR szPath
Definition: env.c:37
HANDLE hThread
Definition: wizard.c:28
#define KEY_WRITE
Definition: nt_native.h:1034
#define UNICODE_NULL
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_writes_bytes_to_opt_(ProcessInformationLength, *ReturnLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:211
#define PathAppendW
Definition: pathcch.h:310
short WCHAR
Definition: pedump.c:58
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND hwndOwner, int nFolder, BOOL fCreate)
Definition: pidl.c:446
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1108
_In_opt_ LPCSTR _In_opt_ LPCSTR pszValue
Definition: shlwapi.h:783
#define err(...)
#define calloc
Definition: rosglue.h:14
#define T(num)
Definition: thunks.c:311
static BOOL FindSubProgram(LPWSTR pszSubProgram, DWORD cchSubProgram)
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:33
#define ShellExecuteEx
Definition: shellapi.h:747
#define SEE_MASK_IDLIST
Definition: shellapi.h:27
#define SEE_MASK_NOASYNC
Definition: shellapi.h:35
#define SEE_MASK_WAITFORINPUTIDLE
Definition: shellapi.h:52
#define SEE_MASK_FLAG_DDEWAIT
Definition: shellapi.h:36
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
#define SEE_MASK_FLAG_NO_UI
Definition: shellapi.h:38
#define STATUS_SUCCESS
Definition: shellext.h:65
HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
Definition: shlexec.cpp:1581
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2732
#define CSIDL_PROFILE
Definition: shlobj.h:2230
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define _countof(array)
Definition: sndvol32.h:70
TCHAR * cmdline
Definition: stretchblt.cpp:32
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
Definition: cmd.c:13
INT line
Definition: cmd.c:14
LPCWSTR cmdline
TEST_RESULT result
LPCWSTR lpFile
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
Definition: btrfs_drv.h:1913
LPCWSTR lpDirectory
Definition: shellapi.h:340
LPCWSTR lpParameters
Definition: shellapi.h:339
$ULONG PrivilegeCount
Definition: setypes.h:1035
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1036
Definition: parser.c:49
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726
const uint16_t * LPCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
VERSIONHELPERAPI IsWindowsVistaOrGreater()
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define ERROR_NO_ASSOCIATION
Definition: winerror.h:1001
#define ERROR_OPERATION_ABORTED
Definition: winerror.h:899
#define SE_DEBUG_NAME
Definition: winnt_old.h:428
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define SW_HIDE
Definition: winuser.h:779
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
DWORD WINAPI WaitForInputIdle(_In_ HANDLE, _In_ DWORD)
#define SW_SHOW
Definition: winuser.h:786
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:942
#define TOKEN_QUERY
Definition: setypes.h:940
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63