ReactOS 0.4.16-dev-1489-g8fbbb41
ShellExec_RunDLL.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 ShellExec_RunDLL
5 * COPYRIGHT: Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "shelltest.h"
9#include "closewnd.h"
10#include <undocshell.h>
11
13
15{
16 ShellExec_RunDLL(NULL, NULL, "?0?notepad.exe", SW_SHOWNORMAL);
17}
18
20{
21 ShellExec_RunDLLA(NULL, NULL, "?0?notepad.exe", SW_SHOWNORMAL);
22}
23
25{
26 ShellExec_RunDLLW(NULL, NULL, L"?0?notepad.exe", SW_SHOWNORMAL);
27}
28
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}
47
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 WINDOW_LIST s_List2
static VOID TEST_ShellExec_RunDLL(VOID)
static WINDOW_LIST s_List1
static VOID TEST_ShellExec_RunDLLA(VOID)
static BOOL CloseNotepad(VOID)
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
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
#define NULL
Definition: types.h:112
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define UNICODE_NULL
EXTERN_C VOID WINAPI ShellExec_RunDLLW(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCWSTR pszCmdLine, _In_ INT nCmdShow)
Definition: shlexec.cpp:3259
EXTERN_C VOID WINAPI ShellExec_RunDLLA(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCSTR pszCmdLine, _In_ INT nCmdShow)
Definition: shlexec.cpp:3242
#define _countof(array)
Definition: sndvol32.h:70
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
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
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
__wchar_t WCHAR
Definition: xmlstorage.h:180