ReactOS 0.4.15-dev-7842-g558ab78
Control_RunDLLW.cpp File Reference
#include "shelltest.h"
#include <cpl.h>
#include <stdio.h>
#include <debug.h>
Include dependency graph for Control_RunDLLW.cpp:

Go to the source code of this file.

Classes

struct  param_test
 

Macros

#define NDEBUG
 
#define MSG_NOT_CALLED   -1
 

Functions

void WINAPI Control_RunDLLW (HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 
LONG CALLBACK CPlApplet (HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
 START_TEST (Control_RunDLLW)
 

Variables

int g_iParams
 
int g_iClk
 
WCHAR g_wstrParams [MAX_PATH]
 
struct param_test tests []
 

Macro Definition Documentation

◆ MSG_NOT_CALLED

#define MSG_NOT_CALLED   -1

Definition at line 85 of file Control_RunDLLW.cpp.

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file Control_RunDLLW.cpp.

Function Documentation

◆ Control_RunDLLW()

void WINAPI Control_RunDLLW ( HWND  hWnd,
HINSTANCE  hInst,
LPCWSTR  cmd,
DWORD  nCmdShow 
)

Definition at line 1043 of file control.c.

1044{
1045 CPanel panel;
1046
1047 TRACE("(%p, %p, %s, 0x%08x)\n",
1048 hWnd, hInst, debugstr_w(cmd), nCmdShow);
1049
1050#ifndef __REACTOS__
1051 memset(&panel, 0, sizeof(panel));
1052 list_init( &panel.applets );
1053#endif
1054
1055 if (!cmd || !*cmd) {
1056 Control_DoWindow(&panel, hWnd, hInst);
1057 } else {
1058 Control_DoLaunch(&panel, hWnd, cmd);
1059 }
1060}
HWND hWnd
Definition: settings.c:17
static void list_init(struct list_entry *head)
Definition: list.h:51
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:703
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:866
HINSTANCE hInst
Definition: dxdiag.c:13
#define debugstr_w
Definition: kernel32.h:32
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cpanel.h:56
struct list applets
Definition: cpanel.h:57
Definition: ftp_var.h:139

Referenced by START_TEST().

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCPl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 25 of file Control_RunDLLW.cpp.

29{
30 INT i = (INT)lParam1;
31
32 switch (uMsg)
33 {
34 case CPL_INIT:
35 return TRUE;
36
37 case CPL_GETCOUNT:
38 return 2;
39
40 case CPL_INQUIRE:
41 {
42 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
43 CPlInfo->lData = 0;
44 CPlInfo->idIcon = CPL_DYNAMIC_RES ;
45 CPlInfo->idName = CPL_DYNAMIC_RES ;
46 CPlInfo->idInfo = CPL_DYNAMIC_RES ;
47 }
48 break;
49 case CPL_NEWINQUIRE:
50 {
51 LPNEWCPLINFOW pinfo = (LPNEWCPLINFOW)lParam2;
52
53 memset(pinfo, 0, sizeof(NEWCPLINFOW));
54 pinfo->dwSize = sizeof(NEWCPLINFOW);
56 if (i == 0)
57 {
58 wcscpy(pinfo->szName, L"name0");
59 wcscpy(pinfo->szInfo, L"info0");
60 wcscpy(pinfo->szHelpFile, L"help0");
61 }
62 else
63 {
64 wcscpy(pinfo->szName, L"name1");
65 wcscpy(pinfo->szInfo, L"info1");
66 wcscpy(pinfo->szHelpFile, L"help1");
67 }
68 break;
69 }
70 case CPL_DBLCLK:
71 g_iClk = i;
72 break;
74 g_iParams = i;
75 ok(lParam2 != NULL, "Got NULL lParam2!\n");
76 if (lParam2)
77 wcscpy(g_wstrParams, (LPCWSTR)lParam2);
78 break;
79 }
80
81 return FALSE;
82}
int g_iParams
WCHAR g_wstrParams[MAX_PATH]
int g_iClk
#define ok(value,...)
Definition: atltest.h:57
#define CPL_INQUIRE
Definition: cpl.h:14
struct tagNEWCPLINFOW * LPNEWCPLINFOW
#define CPL_DYNAMIC_RES
Definition: cpl.h:11
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_STARTWPARMSW
Definition: cpl.h:21
struct tagNEWCPLINFOW NEWCPLINFOW
#define CPL_INIT
Definition: cpl.h:12
#define CPL_GETCOUNT
Definition: cpl.h:13
#define CPL_NEWINQUIRE
Definition: cpl.h:19
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define L(x)
Definition: ntvdm.h:50
#define INT
Definition: polytest.cpp:20
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
Definition: cpl.h:24
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
HICON hIcon
Definition: cpl.h:45
WCHAR szName[32]
Definition: cpl.h:46
WCHAR szInfo[64]
Definition: cpl.h:47
DWORD dwSize
Definition: cpl.h:41
WCHAR szHelpFile[128]
Definition: cpl.h:48
int32_t INT
Definition: typedefs.h:58
#define IDI_APPLICATION
Definition: winuser.h:704
#define LoadIcon
Definition: winuser.h:5813
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ START_TEST()

START_TEST ( Control_RunDLLW  )

Definition at line 144 of file Control_RunDLLW.cpp.

145{
146 WCHAR finename[MAX_PATH];
148
149 GetModuleFileNameW(NULL, finename, MAX_PATH);
150
151 for (UINT i = 0; i < _countof(tests); i++)
152 {
153 swprintf(buffer, L"%s%s", finename, tests[i].cmd);
154
157 g_wstrParams[0] = 0;
159 ok (tests[i].iClick == g_iClk, "%d, CPL_DBLCLK: expected %d got %d\n", tests[i].srcLine, tests[i].iClick, g_iClk);
160 ok (tests[i].iStartParams == g_iParams, "%d, CPL_STARTWPARMSW: expected %d got %d\n", tests[i].srcLine, tests[i].iStartParams, g_iParams);
161 ok (wcscmp(tests[i].params, g_wstrParams) == 0, "%d, CPL_STARTWPARMSW: expected %S got %S\n", tests[i].srcLine, tests[i].params, g_wstrParams);
162 }
163}
#define MSG_NOT_CALLED
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1043
struct param_test tests[]
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
#define swprintf
Definition: precomp.h:40
GLuint buffer
Definition: glext.h:5915
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned int UINT
Definition: ndis.h:50
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define _countof(array)
Definition: sndvol32.h:68
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
__wchar_t WCHAR
Definition: xmlstorage.h:180

Variable Documentation

◆ g_iClk

int g_iClk

Definition at line 20 of file Control_RunDLLW.cpp.

Referenced by CPlApplet(), and START_TEST().

◆ g_iParams

int g_iParams

Definition at line 19 of file Control_RunDLLW.cpp.

Referenced by CPlApplet(), and START_TEST().

◆ g_wstrParams

WCHAR g_wstrParams[MAX_PATH]

Definition at line 21 of file Control_RunDLLW.cpp.

Referenced by CPlApplet(), and START_TEST().

◆ tests

struct param_test tests[]

Definition at line 96 of file Control_RunDLLW.cpp.

Referenced by START_TEST().