ReactOS  0.4.13-dev-99-g7e18b6d
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 873 of file control.c.

874 {
875  CPanel panel;
876 
877  TRACE("(%p, %p, %s, 0x%08x)\n",
878  hWnd, hInst, debugstr_w(cmd), nCmdShow);
879 
880 #ifndef __REACTOS__
881  memset(&panel, 0, sizeof(panel));
882  list_init( &panel.applets );
883 #endif
884 
885  if (!cmd || !*cmd) {
886  Control_DoWindow(&panel, hWnd, hInst);
887  } else {
888  Control_DoLaunch(&panel, hWnd, cmd);
889  }
890 }
Definition: ftp_var.h:139
HWND hWnd
Definition: settings.c:17
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:742
struct list applets
Definition: cpanel.h:57
Definition: cpanel.h:56
HINSTANCE hInst
Definition: dxdiag.c:13
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:698
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define memset(x, y, z)
Definition: compat.h:39

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;
73  case CPL_STARTWPARMSW:
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 }
#define TRUE
Definition: types.h:120
Definition: cpl.h:24
struct tagNEWCPLINFOW * LPNEWCPLINFOW
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define INT
Definition: polytest.cpp:20
int idInfo
Definition: cpl.h:27
WCHAR g_wstrParams[MAX_PATH]
#define IDI_APPLICATION
Definition: winuser.h:699
int32_t INT
Definition: typedefs.h:56
struct tagNEWCPLINFOW NEWCPLINFOW
int g_iClk
int idIcon
Definition: cpl.h:25
#define CPL_DBLCLK
Definition: cpl.h:16
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 CPL_DYNAMIC_RES
Definition: cpl.h:11
#define ok(value,...)
#define CPL_NEWINQUIRE
Definition: cpl.h:19
smooth NULL
Definition: ftsmooth.c:416
WCHAR szHelpFile[128]
Definition: cpl.h:48
DWORD dwSize
Definition: cpl.h:41
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define CPL_INIT
Definition: cpl.h:12
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CPL_INQUIRE
Definition: cpl.h:14
static const WCHAR L[]
Definition: oid.c:1250
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
HICON hIcon
Definition: cpl.h:45
WCHAR szInfo[64]
Definition: cpl.h:47
int g_iParams
WCHAR szName[32]
Definition: cpl.h:46
#define LoadIcon
Definition: winuser.h:5679
#define memset(x, y, z)
Definition: compat.h:39
#define CPL_GETCOUNT
Definition: cpl.h:13

◆ 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 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:607
struct param_test tests[]
Definition: ftp_var.h:139
#define _countof(array)
Definition: fontsub.cpp:30
WCHAR g_wstrParams[MAX_PATH]
GLuint buffer
Definition: glext.h:5915
int g_iClk
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
GLenum const GLfloat * params
Definition: glext.h:5645
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const WCHAR L[]
Definition: oid.c:1250
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:873
int g_iParams
unsigned int UINT
Definition: ndis.h:50
#define MSG_NOT_CALLED

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