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 
12 static WINDOW_LIST s_List1, s_List2;
13 
TEST_ShellExec_RunDLL(VOID)14 static VOID TEST_ShellExec_RunDLL(VOID)
15 {
16     ShellExec_RunDLL(NULL, NULL, "?0?notepad.exe", SW_SHOWNORMAL);
17 }
18 
TEST_ShellExec_RunDLLA(VOID)19 static VOID TEST_ShellExec_RunDLLA(VOID)
20 {
21     ShellExec_RunDLLA(NULL, NULL, "?0?notepad.exe", SW_SHOWNORMAL);
22 }
23 
TEST_ShellExec_RunDLLW(VOID)24 static VOID TEST_ShellExec_RunDLLW(VOID)
25 {
26     ShellExec_RunDLLW(NULL, NULL, L"?0?notepad.exe", SW_SHOWNORMAL);
27 }
28 
CleanupWindowList(VOID)29 static VOID CleanupWindowList(VOID)
30 {
31     GetWindowListForClose(&s_List2);
32     CloseNewWindows(&s_List1, &s_List2);
33     FreeWindowList(&s_List1);
34     FreeWindowList(&s_List2);
35 }
36 
START_TEST(ShellExec_RunDLL)37 START_TEST(ShellExec_RunDLL)
38 {
39     HWND hwndNotepad;
40 
41     GetWindowList(&s_List1);
42     TEST_ShellExec_RunDLL();
43     Sleep(1000);
44     hwndNotepad = FindWindowW(L"Notepad", NULL);
45     ok(hwndNotepad != NULL, "Notepad not found\n");
46     CleanupWindowList();
47 
48     GetWindowList(&s_List1);
49     TEST_ShellExec_RunDLLA();
50     Sleep(1000);
51     hwndNotepad = FindWindowW(L"Notepad", NULL);
52     ok(hwndNotepad != NULL, "Notepad not found\n");
53     CleanupWindowList();
54 
55     GetWindowList(&s_List1);
56     TEST_ShellExec_RunDLLW();
57     Sleep(1000);
58     hwndNotepad = FindWindowW(L"Notepad", NULL);
59     ok(hwndNotepad != NULL, "Notepad not found\n");
60     CleanupWindowList();
61 }
62