ReactOS 0.4.16-dev-1489-g8fbbb41
RealShellExecuteEx.cpp File Reference
#include "shelltest.h"
#include "closewnd.h"
#include <versionhelpers.h>
Include dependency graph for RealShellExecuteEx.cpp:

Go to the source code of this file.

Typedefs

typedef HINSTANCE(WINAPIFN_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)
 
typedef HINSTANCE(WINAPIFN_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)
 

Functions

BOOL IsWindowsServer2003SP2OrGreater (void)
 
static void TEST_Start (void)
 
static void TEST_End (void)
 
static void TEST_RealShellExecuteExA (void)
 
static void TEST_RealShellExecuteExW (void)
 
 START_TEST (RealShellExecuteEx)
 

Variables

static HINSTANCE s_hSHELL32 = NULL
 
static FN_RealShellExecuteExA s_fnRealShellExecuteExA = NULL
 
static FN_RealShellExecuteExW s_fnRealShellExecuteExW = NULL
 
static WINDOW_LIST s_List1
 
static WINDOW_LIST s_List2
 

Typedef Documentation

◆ FN_RealShellExecuteExA

typedef 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)

Definition at line 17 of file RealShellExecuteEx.cpp.

◆ FN_RealShellExecuteExW

typedef 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)

Definition at line 30 of file RealShellExecuteEx.cpp.

Function Documentation

◆ IsWindowsServer2003SP2OrGreater()

BOOL IsWindowsServer2003SP2OrGreater ( void  )

Definition at line 12 of file RealShellExecuteEx.cpp.

13{
14 return IsWindowsVersionOrGreater(5, 2, 2);
15}
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)

Referenced by START_TEST(), and TEST_RealShellExecuteExA().

◆ START_TEST()

START_TEST ( RealShellExecuteEx  )

Definition at line 107 of file RealShellExecuteEx.cpp.

108{
110 {
111 skip("Vista+\n");
112 return;
113 }
114
115 s_hSHELL32 = LoadLibraryW(L"shell32.dll");
116
119
121 {
122 skip("RealShellExecuteExA/W not found: %p, %p\n",
124 return;
125 }
126
127 TEST_Start();
128
131
132 TEST_End();
133
135}
static void TEST_RealShellExecuteExW(void)
static void TEST_Start(void)
static FN_RealShellExecuteExA s_fnRealShellExecuteExA
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 skip(...)
Definition: atltest.h:64
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
#define L(x)
Definition: resources.c:13
VERSIONHELPERAPI IsWindowsVistaOrGreater()
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581

◆ TEST_End()

static void TEST_End ( void  )
static

Definition at line 54 of file RealShellExecuteEx.cpp.

55{
56 // Execution can be asynchronous; you have to wait for it to finish.
57 Sleep(2000);
58
59 // Close newly-opened window(s)
64}
static WINDOW_LIST s_List2
static WINDOW_LIST s_List1
static VOID FreeWindowList(PWINDOW_LIST pList)
Definition: closewnd.h:32
static VOID CloseNewWindows(PWINDOW_LIST pExisting, PWINDOW_LIST pNew)
Definition: closewnd.h:101
static VOID GetWindowList(PWINDOW_LIST pList)
Definition: closewnd.h:54
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790

Referenced by START_TEST().

◆ TEST_RealShellExecuteExA()

static void TEST_RealShellExecuteExA ( void  )
static

Definition at line 66 of file RealShellExecuteEx.cpp.

67{
69
71 NULL,
72 NULL,
73 "notepad.exe",
74 NULL,
75 NULL,
76 NULL,
77 NULL,
78 NULL,
80 NULL,
81 0);
83 ok_long((LONG)ret, 42);
84 else
85 ok_long((LONG)ret, 2);
86}
BOOL IsWindowsServer2003SP2OrGreater(void)
#define ok_long(expression, result)
Definition: atltest.h:133
#define NULL
Definition: types.h:112
return ret
Definition: mutex.c:146
long LONG
Definition: pedump.c:60
int32_t INT_PTR
Definition: typedefs.h:64
#define SW_SHOWDEFAULT
Definition: winuser.h:791

Referenced by START_TEST().

◆ TEST_RealShellExecuteExW()

static void TEST_RealShellExecuteExW ( void  )
static

Definition at line 88 of file RealShellExecuteEx.cpp.

89{
91
93 NULL,
94 NULL,
95 L"notepad.exe",
96 NULL,
97 NULL,
98 NULL,
99 NULL,
100 NULL,
102 NULL,
103 0);
104 ok_long((LONG)ret, 42);
105}

Referenced by START_TEST().

◆ TEST_Start()

static void TEST_Start ( void  )
static

Definition at line 49 of file RealShellExecuteEx.cpp.

50{
52}

Referenced by START_TEST().

Variable Documentation

◆ s_fnRealShellExecuteExA

FN_RealShellExecuteExA s_fnRealShellExecuteExA = NULL
static

Definition at line 44 of file RealShellExecuteEx.cpp.

Referenced by START_TEST(), and TEST_RealShellExecuteExA().

◆ s_fnRealShellExecuteExW

FN_RealShellExecuteExW s_fnRealShellExecuteExW = NULL
static

Definition at line 45 of file RealShellExecuteEx.cpp.

Referenced by START_TEST(), and TEST_RealShellExecuteExW().

◆ s_hSHELL32

HINSTANCE s_hSHELL32 = NULL
static

Definition at line 43 of file RealShellExecuteEx.cpp.

Referenced by START_TEST().

◆ s_List1

WINDOW_LIST s_List1
static

Definition at line 47 of file RealShellExecuteEx.cpp.

Referenced by TEST_End(), and TEST_Start().

◆ s_List2

WINDOW_LIST s_List2
static

Definition at line 47 of file RealShellExecuteEx.cpp.

Referenced by TEST_End().