35#define REG_APPPATHS L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
136 trace(
"!cbCmdLine\n");
140 trace(
"!pszBuffer\n");
166 else if (
ret && !
info.hProcess)
184 "Line %d: cmdline: '%ls' vs '%ls'\n",
pEntry->line,
226 skip(
"Wow64: Command Line check is skipped\n");
251 skip(
"Please retry with admin rights\n");
295 skip(
"Please associate .txt with notepad.exe before tests\n");
339 info.lpVerb =
L"properties";
360 info.lpFile =
L"complete garbage, cannot run this!";
380 BYTE lpitemidlist[30] = { 0x14, 0, 0x1f, 0, 0xe0, 0x4f, 0xd0, 0x20, 0xea,
381 0x3a, 0x69, 0x10, 0xa2, 0xd8, 0x08, 0, 0x2b, 0x30, 0x30, 0x9d,
382 0x8, 0, 0x23, 0x43, 0x3a, 0x5c, 0x5c, 0, 0, 0,};
388 ShellExecInfo.
lpIDList = lpitemidlist;
404 trace(
"Could not create test key (%lu)\n",
error);
409 trace(
"Could not set value of the test key (%lu)\n",
error);
424 trace(
"Could not remove the test key (%lu)\n",
error);
449 skip(
"shell32_apitest_sub.exe not found\n");
455 sei.
lpFile = szSubProgram;
472 skip(
"Win64 is not supported yet\n");
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_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 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)
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)
#define ok_long(expression, result)
#define ok_int(expression, result)
#define ok_ptr(expression, result)
#define RegCloseKey(hKey)
void CloseNewWindows(PWINDOW_LIST List1, PWINDOW_LIST List2)
void GetWindowList(PWINDOW_LIST pList)
void FreeWindowList(PWINDOW_LIST pList)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
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)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define ReadProcessMemory(a, b, c, d, e)
#define GetCurrentDirectoryW(x, y)
#define GetCurrentProcess()
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
_Inout_opt_ PUNICODE_STRING Extension
_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
_In_ BOOL _In_ HANDLE hProcess
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
static BOOL FindSubProgram(LPWSTR pszSubProgram, DWORD cchSubProgram)
#define SEE_MASK_NOCLOSEPROCESS
#define SEE_MASK_WAITFORINPUTIDLE
#define SEE_MASK_INVOKEIDLIST
#define SEE_MASK_FLAG_NO_UI
HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
VERSIONHELPERAPI IsWindowsVistaOrGreater()
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED