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

Go to the source code of this file.

Functions

static VOID TEST_ShellExec_RunDLL (VOID)
 
static VOID TEST_ShellExec_RunDLLA (VOID)
 
static VOID TEST_ShellExec_RunDLLW (VOID)
 
static BOOL CloseNotepad (VOID)
 
 START_TEST (ShellExec_RunDLL)
 

Variables

static WINDOW_LIST s_List1
 
static WINDOW_LIST s_List2
 

Function Documentation

◆ CloseNotepad()

static BOOL CloseNotepad ( VOID  )
static

Definition at line 29 of file ShellExec_RunDLL.cpp.

30{
31 HWND hwndNew;
32 WCHAR szClass[64];
33
34 // Execution can be asynchronous; you have to wait for it to finish.
35 Sleep(1000);
36
37 // Close newly-opened window(s)
39 hwndNew = FindNewWindow(&s_List1, &s_List2);
40 if (!GetClassNameW(hwndNew, szClass, _countof(szClass)))
41 szClass[0] = UNICODE_NULL;
45 return lstrcmpiW(szClass, L"Notepad") == 0;
46}
static WINDOW_LIST s_List2
static WINDOW_LIST s_List1
static HWND FindNewWindow(PWINDOW_LIST List1, PWINDOW_LIST List2)
Definition: closewnd.h:141
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
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
#define L(x)
Definition: resources.c:13
#define UNICODE_NULL
#define _countof(array)
Definition: sndvol32.h:70
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( ShellExec_RunDLL  )

Definition at line 48 of file ShellExec_RunDLL.cpp.

49{
50 BOOL ret;
51
54 ret = CloseNotepad();
55 ok(ret, "Notepad not found\n");
56
59 ret = CloseNotepad();
60 ok(ret, "Notepad not found\n");
61
64 ret = CloseNotepad();
65 ok(ret, "Notepad not found\n");
66}
static VOID TEST_ShellExec_RunDLLW(VOID)
static VOID TEST_ShellExec_RunDLL(VOID)
static VOID TEST_ShellExec_RunDLLA(VOID)
static BOOL CloseNotepad(VOID)
#define ok(value,...)
Definition: atltest.h:57
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94

◆ TEST_ShellExec_RunDLL()

static VOID TEST_ShellExec_RunDLL ( VOID  )
static

Definition at line 14 of file ShellExec_RunDLL.cpp.

15{
16 ShellExec_RunDLL(NULL, NULL, "?0?notepad.exe", SW_SHOWNORMAL);
17}
#define NULL
Definition: types.h:112
VOID WINAPI ShellExec_RunDLL(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCSTR pszCmdLine, _In_ INT nCmdShow)
#define SW_SHOWNORMAL
Definition: winuser.h:781

Referenced by START_TEST().

◆ TEST_ShellExec_RunDLLA()

static VOID TEST_ShellExec_RunDLLA ( VOID  )
static

Definition at line 19 of file ShellExec_RunDLL.cpp.

20{
21 ShellExec_RunDLLA(NULL, NULL, "?0?notepad.exe", SW_SHOWNORMAL);
22}
EXTERN_C VOID WINAPI ShellExec_RunDLLA(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCSTR pszCmdLine, _In_ INT nCmdShow)
Definition: shlexec.cpp:3242

Referenced by START_TEST().

◆ TEST_ShellExec_RunDLLW()

static VOID TEST_ShellExec_RunDLLW ( VOID  )
static

Definition at line 24 of file ShellExec_RunDLL.cpp.

25{
26 ShellExec_RunDLLW(NULL, NULL, L"?0?notepad.exe", SW_SHOWNORMAL);
27}
EXTERN_C VOID WINAPI ShellExec_RunDLLW(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCWSTR pszCmdLine, _In_ INT nCmdShow)
Definition: shlexec.cpp:3259

Referenced by START_TEST().

Variable Documentation

◆ s_List1

WINDOW_LIST s_List1
static

Definition at line 12 of file ShellExec_RunDLL.cpp.

Referenced by CloseNotepad(), and START_TEST().

◆ s_List2

WINDOW_LIST s_List2
static

Definition at line 12 of file ShellExec_RunDLL.cpp.

Referenced by CloseNotepad().