ReactOS 0.4.15-dev-8227-g32d615f
RealShellExecuteEx.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Test for RealShellExecuteExA/W
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6 */
7
8#include "shelltest.h"
9#include "closewnd.h"
10#include <versionhelpers.h>
11
13{
14 return IsWindowsVersionOrGreater(5, 2, 2);
15}
16
19 _In_opt_ LPCSTR lpOperation,
20 _In_opt_ LPCSTR lpFile,
21 _In_opt_ LPCSTR lpParameters,
23 _In_opt_ LPSTR lpReturn,
25 _In_opt_ LPVOID lpReserved,
26 _In_ INT nCmdShow,
27 _Out_opt_ PHANDLE lphProcess,
29
32 _In_opt_ LPCWSTR lpOperation,
33 _In_opt_ LPCWSTR lpFile,
34 _In_opt_ LPCWSTR lpParameters,
36 _In_opt_ LPWSTR lpReturn,
38 _In_opt_ LPVOID lpReserved,
39 _In_ INT nCmdShow,
40 _Out_opt_ PHANDLE lphProcess,
42
46
48
49static void TEST_Start(void)
50{
52}
53
54static void TEST_End(void)
55{
56 Sleep(500);
61}
62
63static void TEST_RealShellExecuteExA(void)
64{
65 TEST_Start();
66
68
70 NULL,
71 NULL,
72 "notepad.exe",
73 NULL,
74 NULL,
75 NULL,
76 NULL,
77 NULL,
79 NULL,
80 0);
82 ok_long((LONG)ret, 42);
83 else
84 ok_long((LONG)ret, 2);
85
86 TEST_End();
87}
88
89static void TEST_RealShellExecuteExW(void)
90{
91 TEST_Start();
92
94
96 NULL,
97 NULL,
98 L"notepad.exe",
99 NULL,
100 NULL,
101 NULL,
102 NULL,
103 NULL,
105 NULL,
106 0);
107 ok_long((LONG)ret, 42);
108
109 TEST_End();
110}
111
112START_TEST(RealShellExecuteEx)
113{
115 {
116 skip("Vista+\n");
117 return;
118 }
119
120 s_hSHELL32 = LoadLibraryW(L"shell32.dll");
121
124
126 {
127 skip("RealShellExecuteExA/W not found: %p, %p\n",
129 return;
130 }
131
134
136}
static WINDOW_LIST s_List2
static void TEST_RealShellExecuteExW(void)
static void TEST_Start(void)
static FN_RealShellExecuteExA s_fnRealShellExecuteExA
static WINDOW_LIST s_List1
BOOL IsWindowsServer2003SP2OrGreater(void)
HINSTANCE(WINAPI * FN_RealShellExecuteExA)(_In_opt_ HWND hwnd, _In_opt_ LPCSTR lpOperation, _In_opt_ LPCSTR lpFile, _In_opt_ LPCSTR lpParameters, _In_opt_ LPCSTR lpDirectory, _In_opt_ LPSTR lpReturn, _In_opt_ LPCSTR lpTitle, _In_opt_ LPVOID lpReserved, _In_ INT nCmdShow, _Out_opt_ PHANDLE lphProcess, _In_ DWORD dwFlags)
static void TEST_End(void)
static FN_RealShellExecuteExW s_fnRealShellExecuteExW
HINSTANCE(WINAPI * FN_RealShellExecuteExW)(_In_opt_ HWND hwnd, _In_opt_ LPCWSTR lpOperation, _In_opt_ LPCWSTR lpFile, _In_opt_ LPCWSTR lpParameters, _In_opt_ LPCWSTR lpDirectory, _In_opt_ LPWSTR lpReturn, _In_opt_ LPCWSTR lpTitle, _In_opt_ LPVOID lpReserved, _In_ INT nCmdShow, _Out_opt_ PHANDLE lphProcess, _In_ DWORD dwFlags)
static HINSTANCE s_hSHELL32
static void TEST_RealShellExecuteExA(void)
#define ok_long(expression, result)
Definition: atltest.h:133
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
void CloseNewWindows(PWINDOW_LIST List1, PWINDOW_LIST List2)
Definition: closewnd.cpp:66
void GetWindowList(PWINDOW_LIST pList)
Definition: closewnd.cpp:33
void FreeWindowList(PWINDOW_LIST pList)
Definition: closewnd.cpp:11
TCHAR lpTitle[80]
Definition: ctm.c:69
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
_In_opt_ LPCSTR lpDirectory
Definition: shellapi.h:484
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
HANDLE HINSTANCE
Definition: typedefs.h:77
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
VERSIONHELPERAPI IsWindowsVistaOrGreater()
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define SW_SHOWDEFAULT
Definition: winuser.h:780
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185