ReactOS 0.4.16-dev-470-g91b8923
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
35
36#define REG_APPPATHS L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
37
38typedef enum TEST_RESULT
39{
44
45typedef struct TEST_ENTRY
46{
47 INT line;
52
53static void
55
56static void TEST_DoTestEntries(void)
57{
60 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"This is an invalid path.");
73 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_WITH_PROCESS, L"\"test program.exe\"", s_sys_test_exe_cmdline);
76 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"shell:ThisIsAnInvalidName");
77 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"); // My Computer
78 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"); // My Computer (with shell:)
79
81 {
82 WCHAR szCurDir[MAX_PATH];
83 GetCurrentDirectoryW(_countof(szCurDir), szCurDir);
85 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); // Control Panel (without path)
86 SetCurrentDirectoryW(szCurDir);
87 }
88
89 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); // Control Panel (with path)
90 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:)
91 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:AppData");
92 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common Desktop");
93 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common Programs");
94 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common Start Menu");
95 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Common StartUp");
96 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:ControlPanelFolder");
97 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Desktop");
98 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Favorites");
99 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Fonts");
100 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Local AppData");
101 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:My Pictures");
102 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Personal");
103 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Programs");
104 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Recent");
105 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:RecycleBinFolder");
106 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:SendTo");
107 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:Start Menu");
108 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_NO_PROCESS, L"shell:StartUp");
109}
110
111static LPWSTR
113{
114 PEB peb;
118 BOOL ret;
119
122
123 ret = ReadProcessMemory(hProcess, info.PebBaseAddress, &peb, sizeof(peb), NULL);
124 if (!ret)
125 trace("ReadProcessMemory failed (%ld)\n", GetLastError());
126
128 if (!ret)
129 trace("ReadProcessMemory failed (%ld)\n", GetLastError());
130
131 LPWSTR cmdline = Params.CommandLine.Buffer;
132 if (!cmdline)
133 trace("!cmdline\n");
134
135 SIZE_T cbCmdLine = Params.CommandLine.Length;
136 if (!cbCmdLine)
137 trace("!cbCmdLine\n");
138
139 LPWSTR pszBuffer = (LPWSTR)calloc(cbCmdLine + sizeof(WCHAR), 1);
140 if (!pszBuffer)
141 trace("!pszBuffer\n");
142
143 ret = ReadProcessMemory(hProcess, cmdline, pszBuffer, cbCmdLine, NULL);
144 if (!ret)
145 trace("ReadProcessMemory failed (%ld)\n", GetLastError());
146
147 pszBuffer[cbCmdLine / sizeof(WCHAR)] = UNICODE_NULL;
148
149 return pszBuffer; // needs free()
150}
151
153{
154 SHELLEXECUTEINFOW info = { sizeof(info) };
157 info.hwnd = NULL;
158 info.lpVerb = NULL;
159 info.lpFile = pEntry->lpFile;
160 info.nShow = SW_SHOWNORMAL;
161
163
165 if (ret && info.hProcess)
167 else if (ret && !info.hProcess)
169 else
171
172 ok(pEntry->result == result,
173 "Line %d: result: %d vs %d\n", pEntry->line, pEntry->result, result);
174
175 if (pEntry->result == TEST_SUCCESS_WITH_PROCESS && pEntry->cmdline && !s_bWow64)
176 {
178 if (!cmdline)
179 {
180 skip("!cmdline\n");
181 }
182 else
183 {
184 ok(lstrcmpiW(pEntry->cmdline, cmdline) == 0,
185 "Line %d: cmdline: '%ls' vs '%ls'\n", pEntry->line,
186 pEntry->cmdline, cmdline);
187 }
188
189 TerminateProcess(info.hProcess, 0xDEADFACE);
190 free(cmdline);
191 }
192
193 CloseHandle(info.hProcess);
194}
195
196static void
198{
199 TEST_ENTRY entry = { line, result, lpFile, cmdline };
201}
202
203static BOOL
205{
206 HANDLE hToken;
208 return FALSE;
209
210 TOKEN_PRIVILEGES tkp = { 0 };
211 if (!LookupPrivilegeValueW(NULL, pszPrivilege, &tkp.Privileges[0].Luid))
212 return FALSE;
213
214 tkp.PrivilegeCount = 1;
216 return AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL);
217}
218
220
221static BOOL TEST_Start(void)
222{
223 // Check Wow64
224 s_bWow64 = FALSE;
226 if (s_bWow64)
227 skip("Wow64: Command Line check is skipped\n");
228
229 // getCommandLineFromProcess needs this
231
232 // s_win_dir
234
235 // s_sys_dir
237
238 // s_win_notepad
240 PathAppendW(s_win_notepad, L"notepad.exe");
241
242 // s_sys_notepad
244 PathAppendW(s_sys_notepad, L"notepad.exe");
245
246 // s_win_test_exe
248 PathAppendW(s_win_test_exe, L"test program.exe");
250 if (!ret)
251 {
252 skip("Please retry with admin rights\n");
253 return FALSE;
254 }
255
256 // s_sys_test_exe
258 PathAppendW(s_sys_test_exe, L"test program.exe");
260
261 // s_win_bat_file
263 PathAppendW(s_win_bat_file, L"test program.bat");
264 FILE *fp = _wfopen(s_win_bat_file, L"wb");
265 fprintf(fp, "exit /b 3");
266 fclose(fp);
268
269 // s_sys_bat_file
271 PathAppendW(s_sys_bat_file, L"test program.bat");
272 fp = _wfopen(s_sys_bat_file, L"wb");
273 fprintf(fp, "exit /b 4");
274 fclose(fp);
276
277 // s_win_txt_file
279 PathAppendW(s_win_txt_file, L"test_file.txt");
280 fp = _wfopen(s_win_txt_file, L"wb");
281 fclose(fp);
283
284 // s_sys_txt_file
286 PathAppendW(s_sys_txt_file, L"test_file.txt");
287 fp = _wfopen(s_sys_txt_file, L"wb");
288 fclose(fp);
290
291 // Check .txt settings
294 if (lstrcmpiW(PathFindFileNameW(szPath), L"notepad.exe") != 0)
295 {
296 skip("Please associate .txt with notepad.exe before tests\n");
297 return FALSE;
298 }
299
300 // command lines
302 L"\"%s\" ", s_win_notepad);
304 L"\"%s\" ", s_sys_notepad);
306 L"\"%s\" ", s_win_test_exe);
308 L"\"%s\" ", s_sys_test_exe);
309
311
312 return TRUE;
313}
314
315static void TEST_End(void)
316{
321
328}
329
330static void test_properties()
331{
332 HRESULT hrCoInit = CoInitialize(NULL);
333
334 WCHAR Buffer[MAX_PATH * 4];
336
337 SHELLEXECUTEINFOW info = { sizeof(info) };
339 info.lpVerb = L"properties";
340 info.lpFile = Buffer;
341 info.nShow = SW_SHOW;
342
343 BOOL bRet = ShellExecuteExW(&info);
344 ok(bRet, "Failed! (GetLastError(): %d)\n", (int)GetLastError());
345 ok_ptr(info.hInstApp, (HINSTANCE)42);
346
348 if (Extension)
349 {
350 // The inclusion of this depends on the file display settings!
352 }
353
354 // Now retry it with the extension cut off
355 bRet = ShellExecuteExW(&info);
356 ok(bRet, "Failed! (GetLastError(): %d)\n", (int)GetLastError());
357 ok_ptr(info.hInstApp, (HINSTANCE)42);
358
359 // Now retry it with complete garabage
360 info.lpFile = L"complete garbage, cannot run this!";
361 bRet = ShellExecuteExW(&info);
362 ok_int(bRet, 0);
363 ok_ptr(info.hInstApp, (HINSTANCE)2);
364
365 if (SUCCEEDED(hrCoInit))
367}
368
369static void test_sei_lpIDList()
370{
371 // Note: SEE_MASK_FLAG_NO_UI prevents the test from blocking with a MessageBox
373
374 /* This tests ShellExecuteEx with lpIDList for explorer C:\ */
378 if (!pidl)
379 {
380 skip("Unable to initialize test\n");
381 return;
382 }
383
384 SHELLEXECUTEINFOW ShellExecInfo = { sizeof(ShellExecInfo) };
385 ShellExecInfo.nShow = SW_SHOWNORMAL;
387 ShellExecInfo.lpIDList = pidl;
388 BOOL ret = ShellExecuteExW(&ShellExecInfo);
389 ok_int(ret, TRUE);
390 ILFree(pidl);
391
392 /* This tests ShellExecuteEx with lpIDList going through IContextMenu */
393 CCoInit ComInit;
395 if (!pidl)
396 {
397 skip("Unable to initialize test\n");
398 return;
399 }
401 ShellExecInfo.lpIDList = pidl;
402 ret = ShellExecuteExW(&ShellExecInfo);
403 ok_int(ret, TRUE);
404 ILFree(pidl);
405}
406
407static BOOL
408CreateAppPath(LPCWSTR pszName, LPCWSTR pszValue)
409{
410 WCHAR szSubKey[MAX_PATH];
411 StringCchPrintfW(szSubKey, _countof(szSubKey), L"%s\\%s", REG_APPPATHS, pszName);
412
414 HKEY hKey;
416 &hKey, NULL);
417 if (error != ERROR_SUCCESS)
418 trace("Could not create test key (%lu)\n", error);
419
420 DWORD cbValue = (lstrlenW(pszValue) + 1) * sizeof(WCHAR);
421 error = RegSetValueExW(hKey, NULL, 0, REG_SZ, (LPBYTE)pszValue, cbValue);
422 if (error != ERROR_SUCCESS)
423 trace("Could not set value of the test key (%lu)\n", error);
424
426
427 return error == ERROR_SUCCESS;
428}
429
430static VOID
432{
433 WCHAR szSubKey[MAX_PATH];
434 StringCchPrintfW(szSubKey, _countof(szSubKey), L"%s\\%s", REG_APPPATHS, pszName);
435
437 if (error != ERROR_SUCCESS)
438 trace("Could not remove the test key (%lu)\n", error);
439}
440
441static void TEST_AppPath(void)
442{
443 if (CreateAppPath(L"app_path_test.bat", s_win_test_exe))
444 {
445 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_WITH_PROCESS, L"app_path_test.bat");
446 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"app_path_test.bat.exe");
447 DeleteAppPath(L"app_path_test.bat");
448 }
449
450 if (CreateAppPath(L"app_path_test.bat.exe", s_sys_test_exe))
451 {
452 TEST_DoTestEntry(__LINE__, TEST_FAILED, L"app_path_test.bat");
453 TEST_DoTestEntry(__LINE__, TEST_SUCCESS_WITH_PROCESS, L"app_path_test.bat.exe");
454 DeleteAppPath(L"app_path_test.bat.exe");
455 }
456}
457
458static void test_DoInvalidDir(void)
459{
460 WCHAR szSubProgram[MAX_PATH];
461 if (!FindSubProgram(szSubProgram, _countof(szSubProgram)))
462 {
463 skip("shell32_apitest_sub.exe not found\n");
464 return;
465 }
466
467 DWORD dwExitCode;
469 sei.lpFile = szSubProgram;
470 sei.lpParameters = L"TEST";
471 sei.nShow = SW_SHOWNORMAL;
472
473 // Test invalid path on sei.lpDirectory
474 WCHAR szInvalidPath[MAX_PATH] = L"M:\\This is an invalid path\n";
475 sei.lpDirectory = szInvalidPath;
477 WaitForSingleObject(sei.hProcess, 20 * 1000);
478 GetExitCodeProcess(sei.hProcess, &dwExitCode);
479 ok_long(dwExitCode, 0);
481}
482
484{
485#ifdef _WIN64
486 skip("Win64 is not supported yet\n");
487 return;
488#endif
489
490 if (!TEST_Start())
491 return;
492
493 TEST_AppPath();
498
499 TEST_End();
500}
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 void TEST_DoTestEntryStruct(const TEST_ENTRY *pEntry)
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 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
Definition: bufpool.h:45
void CloseNewWindows(PWINDOW_LIST List1, PWINDOW_LIST List2)
Definition: closewnd.cpp:101
void GetWindowList(PWINDOW_LIST pList)
Definition: closewnd.cpp:33
void GetWindowListForClose(PWINDOW_LIST pList)
Definition: closewnd.cpp:40
void FreeWindowList(PWINDOW_LIST pList)
Definition: closewnd.cpp:11
#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
#define CloseHandle
Definition: compat.h:739
#define ReadProcessMemory(a, b, c, d, e)
Definition: compat.h:758
#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 lstrlenW
Definition: compat.h:750
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
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:2249
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
Definition: path.c:733
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
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:25
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
@ ProcessBasicInformation
Definition: winternl.h:394
#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 error(str)
Definition: mkdosfs.c:1605
LPCWSTR szPath
Definition: env.c:37
#define KEY_WRITE
Definition: nt_native.h:1031
#define UNICODE_NULL
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:59
#define L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND hwndOwner, int nFolder, BOOL fCreate)
Definition: pidl.c:445
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1044
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1101
#define calloc
Definition: rosglue.h:14
static BOOL FindSubProgram(LPWSTR pszSubProgram, DWORD cchSubProgram)
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
#define ShellExecuteEx
Definition: shellapi.h:695
#define SEE_MASK_IDLIST
Definition: shellapi.h:27
#define SEE_MASK_NOASYNC
Definition: shellapi.h:33
#define SEE_MASK_WAITFORINPUTIDLE
Definition: shellapi.h:58
#define SEE_MASK_FLAG_DDEWAIT
Definition: shellapi.h:34
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
#define SEE_MASK_FLAG_NO_UI
Definition: shellapi.h:36
#define STATUS_SUCCESS
Definition: shellext.h:65
HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
Definition: shlexec.cpp:1306
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2463
#define CSIDL_PROFILE
Definition: shlobj.h:2212
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
COM Initialisation.
Definition: shellclasses.h:179
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:335
LPCWSTR lpParameters
Definition: shellapi.h:334
$ULONG PrivilegeCount
Definition: setypes.h:1023
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1024
Definition: parser.c:49
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
VERSIONHELPERAPI IsWindowsVistaOrGreater()
int ret
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SE_DEBUG_NAME
Definition: winnt_old.h:414
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define SW_SHOWNORMAL
Definition: winuser.h:773
#define SW_SHOW
Definition: winuser.h:778
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185