ReactOS 0.4.15-dev-8231-g29a56f3
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 TEST_RealShellExecuteExA().

◆ START_TEST()

START_TEST ( RealShellExecuteEx  )

Definition at line 112 of file RealShellExecuteEx.cpp.

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 void TEST_RealShellExecuteExW(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 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: ntvdm.h:50
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 Sleep(500);
61}
static WINDOW_LIST s_List2
static WINDOW_LIST s_List1
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
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790

Referenced by TEST_RealShellExecuteExA(), and TEST_RealShellExecuteExW().

◆ TEST_RealShellExecuteExA()

static void TEST_RealShellExecuteExA ( void  )
static

Definition at line 63 of file RealShellExecuteEx.cpp.

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}
static void TEST_Start(void)
BOOL IsWindowsServer2003SP2OrGreater(void)
static void TEST_End(void)
#define ok_long(expression, result)
Definition: atltest.h:133
#define NULL
Definition: types.h:112
long LONG
Definition: pedump.c:60
int32_t INT_PTR
Definition: typedefs.h:64
int ret
#define SW_SHOWDEFAULT
Definition: winuser.h:780

Referenced by START_TEST().

◆ TEST_RealShellExecuteExW()

static void TEST_RealShellExecuteExW ( void  )
static

Definition at line 89 of file RealShellExecuteEx.cpp.

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}

Referenced by START_TEST().

◆ TEST_Start()

static void TEST_Start ( void  )
static

Definition at line 49 of file RealShellExecuteEx.cpp.

50{
52}

Referenced by TEST_RealShellExecuteExA(), and TEST_RealShellExecuteExW().

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().