ReactOS  0.4.14-dev-854-gb9426a3
class.c File Reference
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "commctrl.h"
Include dependency graph for class.c:

Go to the source code of this file.

Classes

struct  class_info
 

Macros

#define _WIN32_WINNT   0x0501
 
#define NUMCLASSWORDS   4
 
#define IS_WNDPROC_HANDLE(x)   (((ULONG_PTR)(x) >> 16) == (~0u >> 16))
 
#define ARCH   "none"
 
#define check_class(inst, name, menu)   check_class_(__LINE__,inst,name,menu)
 
#define check_instance(name, inst, info_inst, gcl_inst)   check_instance_(__LINE__,name,inst,info_inst,gcl_inst)
 

Functions

static LRESULT WINAPI ClassTest_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI ClassTest_WndProc2 (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void ClassTest (HINSTANCE hInstance, BOOL global)
 
static void check_style (const char *name, int must_exist, UINT style, UINT ignore)
 
static void test_styles (void)
 
static void check_class_ (int line, HINSTANCE inst, const char *name, const char *menu_name)
 
static void check_instance_ (int line, const char *name, HINSTANCE inst, HINSTANCE info_inst, HINSTANCE gcl_inst)
 
static DWORD WINAPI thread_proc (void *param)
 
static void check_thread_instance (const char *name, HINSTANCE inst, HINSTANCE info_inst, HINSTANCE gcl_inst)
 
static void test_instances (void)
 
static void test_builtinproc (void)
 
static LRESULT WINAPI TestDlgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL RegisterTestDialog (HINSTANCE hInstance)
 
static void CreateDialogParamTest (HINSTANCE hInstance)
 
static void test_extra_values (void)
 
static void test_GetClassInfo (void)
 
static void test_icons (void)
 
static void create_manifest_file (const char *filename, const char *manifest)
 
static HANDLE create_test_actctx (const char *file)
 
static void test_comctl32_class (const char *name)
 
static void test_comctl32_classes (void)
 
static void test_IME (void)
 
static void test_actctx_classes (void)
 
 START_TEST (class)
 

Variables

static const char comctl32_manifest []
 
struct {
   const char   name [9]
 
   int   value
 
   int   badvalue
 
extra_values []
 

Macro Definition Documentation

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0501

Definition at line 23 of file class.c.

◆ ARCH

#define ARCH   "none"

Definition at line 52 of file class.c.

◆ check_class

#define check_class (   inst,
  name,
  menu 
)    check_class_(__LINE__,inst,name,menu)

Definition at line 294 of file class.c.

◆ check_instance

#define check_instance (   name,
  inst,
  info_inst,
  gcl_inst 
)    check_instance_(__LINE__,name,inst,info_inst,gcl_inst)

Definition at line 319 of file class.c.

◆ IS_WNDPROC_HANDLE

#define IS_WNDPROC_HANDLE (   x)    (((ULONG_PTR)(x) >> 16) == (~0u >> 16))

Definition at line 41 of file class.c.

◆ NUMCLASSWORDS

#define NUMCLASSWORDS   4

Definition at line 39 of file class.c.

Function Documentation

◆ check_class_()

static void check_class_ ( int  line,
HINSTANCE  inst,
const char name,
const char menu_name 
)
static

Definition at line 278 of file class.c.

279 {
280  WNDCLASSA wc;
281  UINT atom = GetClassInfoA(inst,name,&wc);
282  ok_(__FILE__,line)( atom, "Class %s %p not found\n", name, inst );
283  if (atom)
284  {
285  if (wc.lpszMenuName && menu_name)
286  ok_(__FILE__,line)( !strcmp( menu_name, wc.lpszMenuName ),
287  "Wrong name %s/%s for class %s %p\n",
288  wc.lpszMenuName, menu_name, name, inst );
289  else
290  ok_(__FILE__,line)( !menu_name == !wc.lpszMenuName, "Wrong name %p/%p for class %s %p\n",
291  wc.lpszMenuName, menu_name, name, inst );
292  }
293 }
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
LPCSTR lpszMenuName
Definition: winuser.h:3146
Definition: parser.c:48
const char name[9]
Definition: class.c:932
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define ok_(x1, x2)
Definition: atltest.h:61

◆ check_instance_()

static void check_instance_ ( int  line,
const char name,
HINSTANCE  inst,
HINSTANCE  info_inst,
HINSTANCE  gcl_inst 
)
static

Definition at line 296 of file class.c.

298 {
299  WNDCLASSA wc;
300  HWND hwnd;
301 
302  ok_(__FILE__,line)( GetClassInfoA( inst, name, &wc ), "Couldn't find class %s inst %p\n", name, inst );
303  ok_(__FILE__,line)( wc.hInstance == info_inst, "Wrong info instance %p/%p for class %s\n",
304  wc.hInstance, info_inst, name );
305  hwnd = CreateWindowExA( 0, name, "test_window", 0, 0, 0, 0, 0, 0, 0, inst, 0 );
306  ok_(__FILE__,line)( hwnd != NULL, "Couldn't create window for class %s inst %p\n", name, inst );
307  ok_(__FILE__,line)( (HINSTANCE)GetClassLongPtrA( hwnd, GCLP_HMODULE ) == gcl_inst,
308  "Wrong GCL instance %p/%p for class %s\n",
309  (HINSTANCE)GetClassLongPtrA( hwnd, GCLP_HMODULE ), gcl_inst, name );
310  ok_(__FILE__,line)( (HINSTANCE)GetWindowLongPtrA( hwnd, GWLP_HINSTANCE ) == inst,
311  "Wrong GWL instance %p/%p for window %s\n",
313  ok_(__FILE__,line)(!UnregisterClassA(name, inst),
314  "UnregisterClassA should fail while exists a class window\n");
316  "GetLastError() should be set to ERROR_CLASS_HAS_WINDOWS not %d\n", GetLastError());
318 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI DestroyWindow(_In_ HWND)
#define GCLP_HMODULE
Definition: winuser.h:671
#define ERROR_CLASS_HAS_WINDOWS
Definition: winerror.h:893
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define GetWindowLongPtrA
Definition: winuser.h:4803
const char name[9]
Definition: class.c:932
HANDLE HINSTANCE
Definition: typedefs.h:75
HINSTANCE hInstance
Definition: winuser.h:3142
#define GWLP_HINSTANCE
Definition: winuser.h:850
Definition: name.c:38
#define GetClassLongPtrA
Definition: winuser.h:4538
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance)
Definition: class.c:1891
#define ok_(x1, x2)
Definition: atltest.h:61

◆ check_style()

static void check_style ( const char name,
int  must_exist,
UINT  style,
UINT  ignore 
)
static

Definition at line 242 of file class.c.

243 {
244  WNDCLASSA wc;
245 
246  if (GetClassInfoA( 0, name, &wc ))
247  {
248  ok( !(~wc.style & style & ~ignore), "System class %s is missing bits %x (%08x/%08x)\n",
249  name, ~wc.style & style, wc.style, style );
250  ok( !(wc.style & ~style), "System class %s has extra bits %x (%08x/%08x)\n",
251  name, wc.style & ~style, wc.style, style );
252  }
253  else
254  ok( !must_exist, "System class %s does not exist\n", name );
255 }
int ignore(int trapCode, ppc_trap_frame_t *trap)
Definition: mmuobject.c:296
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
UINT style
Definition: winuser.h:3138
#define ok(value,...)
Definition: atltest.h:57
Definition: name.c:38
Arabic default style
Definition: afstyles.h:93

Referenced by test_styles().

◆ check_thread_instance()

static void check_thread_instance ( const char name,
HINSTANCE  inst,
HINSTANCE  info_inst,
HINSTANCE  gcl_inst 
)
static

Definition at line 336 of file class.c.

337 {
338  HANDLE hThread;
339  DWORD tid;
340  struct class_info class_info;
341 
342  class_info.name = name;
343  class_info.inst = inst;
346 
348  ok(hThread != NULL, "CreateThread failed, error %d\n", GetLastError());
349  ok(WaitForSingleObject(hThread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
351 }
#define CloseHandle
Definition: compat.h:406
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
const char name[9]
Definition: class.c:932
#define WAIT_OBJECT_0
Definition: winbase.h:387
HINSTANCE gcl_inst
Definition: class.c:324
unsigned long DWORD
Definition: ntddk_ex.h:95
HINSTANCE info_inst
Definition: class.c:324
HINSTANCE inst
Definition: class.c:324
#define ok(value,...)
Definition: atltest.h:57
HANDLE hThread
Definition: wizard.c:27
static DWORD WINAPI thread_proc(void *param)
Definition: class.c:327
#define INFINITE
Definition: serial.h:102
static TfClientId tid
const char * name
Definition: class.c:323

Referenced by test_instances().

◆ ClassTest()

static void ClassTest ( HINSTANCE  hInstance,
BOOL  global 
)
static

Definition at line 93 of file class.c.

94 {
95  WNDCLASSW cls, wc;
96  static const WCHAR className[] = {'T','e','s','t','C','l','a','s','s',0};
97  static const WCHAR winName[] = {'W','i','n','C','l','a','s','s','T','e','s','t',0};
98  ATOM test_atom;
99  HWND hTestWnd;
100  LONG i;
101  WCHAR str[20];
102  ATOM classatom;
103 
104  cls.style = CS_HREDRAW | CS_VREDRAW | (global?CS_GLOBALCLASS:0);
106  cls.cbClsExtra = NUMCLASSWORDS*sizeof(DWORD);
107  cls.cbWndExtra = 12;
108  cls.hInstance = hInstance;
110  cls.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
112  cls.lpszMenuName = 0;
113  cls.lpszClassName = className;
114 
115  classatom=RegisterClassW(&cls);
116  if (!classatom && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
117  return;
118  ok(classatom, "failed to register class\n");
119 
120  ok(GetClipboardFormatNameW(classatom, str, ARRAY_SIZE(str)) != 0, "atom not found\n");
121 
122  ok(!RegisterClassW (&cls),
123  "RegisterClass of the same class should fail for the second time\n");
124 
125  /* Setup windows */
126  hTestWnd = CreateWindowW (className, winName,
128  CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,
129  0, hInstance, 0);
130 
131  ok(hTestWnd!=0, "Failed to create window\n");
132 
133  /* test initial values of valid classwords */
134  for(i=0; i<NUMCLASSWORDS; i++)
135  {
136  SetLastError(0);
137  ok(!GetClassLongW(hTestWnd,i*sizeof (DWORD)),
138  "GetClassLongW initial value nonzero!\n");
139  ok(!GetLastError(),
140  "GetClassLongW failed!\n");
141  }
142 
143  if (0)
144  {
145  /*
146  * GetClassLongW(hTestWnd, NUMCLASSWORDS*sizeof(DWORD))
147  * does not fail on Win 98, though MSDN says it should
148  */
149  SetLastError(0);
150  GetClassLongW(hTestWnd, NUMCLASSWORDS*sizeof(DWORD));
151  ok(GetLastError(),
152  "GetClassLongW() with invalid offset did not fail\n");
153  }
154 
155  /* set values of valid class words */
156  for(i=0; i<NUMCLASSWORDS; i++)
157  {
158  SetLastError(0);
159  ok(!SetClassLongW(hTestWnd,i*sizeof(DWORD),i+1),
160  "GetClassLongW(%d) initial value nonzero!\n",i);
161  ok(!GetLastError(),
162  "SetClassLongW(%d) failed!\n",i);
163  }
164 
165  /* test values of valid classwords that we set */
166  for(i=0; i<NUMCLASSWORDS; i++)
167  {
168  SetLastError(0);
169  ok( (i+1) == GetClassLongW(hTestWnd,i*sizeof (DWORD)),
170  "GetClassLongW value doesn't match what was set!\n");
171  ok(!GetLastError(),
172  "GetClassLongW failed!\n");
173  }
174 
175  /* check GetClassName */
176  i = GetClassNameW(hTestWnd, str, ARRAY_SIZE(str));
177  ok(i == lstrlenW(className),
178  "GetClassName returned incorrect length\n");
179  ok(!lstrcmpW(className,str),
180  "GetClassName returned incorrect name for this window's class\n");
181 
182  /* check GetClassInfo with our hInstance */
183  if((test_atom = GetClassInfoW(hInstance, str, &wc)))
184  {
185  ok(test_atom == classatom,
186  "class atom did not match\n");
187  ok(wc.cbClsExtra == cls.cbClsExtra,
188  "cbClsExtra did not match\n");
189  ok(wc.cbWndExtra == cls.cbWndExtra,
190  "cbWndExtra did not match\n");
191  ok(wc.hbrBackground == cls.hbrBackground,
192  "hbrBackground did not match\n");
193  ok(wc.hCursor== cls.hCursor,
194  "hCursor did not match\n");
195  ok(wc.hInstance== cls.hInstance,
196  "hInstance did not match\n");
197  }
198  else
199  ok(FALSE,"GetClassInfo (hinstance) failed!\n");
200 
201  /* check GetClassInfo with zero hInstance */
202  if(global)
203  {
204  if((test_atom = GetClassInfoW(0, str, &wc)))
205  {
206  ok(test_atom == classatom,
207  "class atom did not match %x != %x\n", test_atom, classatom);
208  ok(wc.cbClsExtra == cls.cbClsExtra,
209  "cbClsExtra did not match %x!=%x\n",wc.cbClsExtra,cls.cbClsExtra);
210  ok(wc.cbWndExtra == cls.cbWndExtra,
211  "cbWndExtra did not match %x!=%x\n",wc.cbWndExtra,cls.cbWndExtra);
212  ok(wc.hbrBackground == cls.hbrBackground,
213  "hbrBackground did not match %p!=%p\n",wc.hbrBackground,cls.hbrBackground);
214  ok(wc.hCursor== cls.hCursor,
215  "hCursor did not match %p!=%p\n",wc.hCursor,cls.hCursor);
216  ok(!wc.hInstance,
217  "hInstance not zero for global class %p\n",wc.hInstance);
218  }
219  else
220  ok(FALSE,"GetClassInfo (0) failed for global class!\n");
221  }
222  else
223  {
224  ok(!GetClassInfoW(0, str, &wc),
225  "GetClassInfo (0) succeeded for local class!\n");
226  }
227 
228  ok(!UnregisterClassW(className, hInstance),
229  "Unregister class succeeded with window existing\n");
230 
231  ok(DestroyWindow(hTestWnd),
232  "DestroyWindow() failed!\n");
233 
234  ok(UnregisterClassW(className, hInstance),
235  "UnregisterClass() failed\n");
236 
237  ok(GetClipboardFormatNameW(classatom, str, ARRAY_SIZE(str)) == 0,
238  "atom still found\n");
239  return;
240 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
UINT style
Definition: winuser.h:3151
LPCWSTR lpszMenuName
Definition: winuser.h:3159
WORD ATOM
Definition: dimm.idl:113
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
int WINAPI GetClassNameW(HWND hWnd, LPWSTR lpClassName, int nMaxCount)
Definition: class.c:1025
BOOL WINAPI UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance)
Definition: class.c:1938
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define CS_HREDRAW
Definition: winuser.h:648
int cbClsExtra
Definition: winuser.h:3153
#define WHITE_BRUSH
Definition: wingdi.h:901
BOOL WINAPI GetClassInfoW(HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSW lpWndClass)
Definition: class.c:507
#define IDI_APPLICATION
Definition: winuser.h:699
DWORD WINAPI GetClassLongW(HWND hWnd, int nIndex)
Definition: class.c:861
#define lstrlenW
Definition: compat.h:415
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define DWORD
Definition: nt_native.h:44
int WINAPI GetClipboardFormatNameW(_In_ UINT format, _Out_writes_(cchMaxCount) LPWSTR lpszFormatName, _In_ int cchMaxCount)
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
HINSTANCE hInstance
Definition: charmap.c:20
long LONG
Definition: pedump.c:60
WNDPROC lpfnWndProc
Definition: winuser.h:3152
#define CW_USEDEFAULT
Definition: winuser.h:225
const WCHAR * str
LPCWSTR lpszClassName
Definition: winuser.h:3160
#define CS_VREDRAW
Definition: winuser.h:653
int cbWndExtra
Definition: winuser.h:3154
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CS_GLOBALCLASS
Definition: winuser.h:647
unsigned long DWORD
Definition: ntddk_ex.h:95
HICON hIcon
Definition: winuser.h:3156
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define SetLastError(x)
Definition: compat.h:417
static LRESULT WINAPI ClassTest_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: class.c:79
#define WS_HSCROLL
Definition: pedump.c:628
DWORD WINAPI SetClassLongW(HWND hWnd, int nIndex, LONG dwNewLong)
Definition: class.c:1719
HCURSOR hCursor
Definition: winuser.h:3157
#define ARRAY_SIZE(a)
Definition: main.h:24
HBRUSH hbrBackground
Definition: winuser.h:3158
#define ok(value,...)
Definition: atltest.h:57
ATOM WINAPI RegisterClassW(CONST WNDCLASSW *lpWndClass)
Definition: class.c:1621
#define WS_VSCROLL
Definition: pedump.c:627
HINSTANCE hInstance
Definition: winuser.h:3155
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define NUMCLASSWORDS
Definition: class.c:39

Referenced by START_TEST().

◆ ClassTest_WndProc()

static LRESULT WINAPI ClassTest_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 79 of file class.c.

80 {
81  if (msg == WM_NCCREATE) return 1;
82  return DefWindowProcW (hWnd, msg, wParam, lParam);
83 }
HWND hWnd
Definition: settings.c:17
#define WM_NCCREATE
Definition: winuser.h:1665
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by ClassTest(), test_actctx_classes(), test_builtinproc(), test_icons(), and test_instances().

◆ ClassTest_WndProc2()

static LRESULT WINAPI ClassTest_WndProc2 ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 85 of file class.c.

86 {
87  if (msg == WM_NCCREATE) return 1;
88  return DefWindowProcA (hWnd, msg, wParam, lParam);
89 }
HWND hWnd
Definition: settings.c:17
#define WM_NCCREATE
Definition: winuser.h:1665
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by test_builtinproc().

◆ create_manifest_file()

static void create_manifest_file ( const char filename,
const char manifest 
)
static

Definition at line 1086 of file class.c.

1087 {
1088  WCHAR path[MAX_PATH];
1089  HANDLE file;
1090  DWORD size;
1091 
1094  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
1096  CloseHandle(file);
1097 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:406
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
const char * filename
Definition: ioapi.h:135
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define CREATE_ALWAYS
Definition: disk.h:72
#define ok(value,...)
Definition: atltest.h:57
#define MultiByteToWideChar
Definition: compat.h:100
#define CreateFileW
Definition: compat.h:408
static const CHAR manifest[]
Definition: v6util.h:39
Definition: fci.c:126

Referenced by test_actctx_classes(), and test_comctl32_class().

◆ create_test_actctx()

static HANDLE create_test_actctx ( const char file)
static

Definition at line 1099 of file class.c.

1100 {
1101  WCHAR path[MAX_PATH];
1102  ACTCTXW actctx;
1103  HANDLE handle;
1104 
1106  memset(&actctx, 0, sizeof(ACTCTXW));
1107  actctx.cbSize = sizeof(ACTCTXW);
1108  actctx.lpSource = path;
1109 
1111  ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %u\n", GetLastError());
1112 
1113  ok(actctx.cbSize == sizeof(actctx), "cbSize=%d\n", actctx.cbSize);
1114  ok(actctx.dwFlags == 0, "dwFlags=%d\n", actctx.dwFlags);
1115  ok(actctx.lpSource == path, "lpSource=%p\n", actctx.lpSource);
1116  ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture);
1117  ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId);
1118  ok(actctx.lpAssemblyDirectory == NULL, "lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory);
1119  ok(actctx.lpResourceName == NULL, "lpResourceName=%p\n", actctx.lpResourceName);
1120  ok(actctx.lpApplicationName == NULL, "lpApplicationName=%p\n", actctx.lpApplicationName);
1121  ok(actctx.hModule == NULL, "hModule=%p\n", actctx.hModule);
1122 
1123  return handle;
1124 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
GLsizei const GLchar ** path
Definition: glext.h:7234
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define ok(value,...)
Definition: atltest.h:57
#define MultiByteToWideChar
Definition: compat.h:100
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
Definition: actctx.c:104
#define memset(x, y, z)
Definition: compat.h:39
Definition: fci.c:126

Referenced by test_actctx_classes(), and test_comctl32_class().

◆ CreateDialogParamTest()

static void CreateDialogParamTest ( HINSTANCE  hInstance)
static

Definition at line 917 of file class.c.

918 {
919  HWND hWndMain;
920 
922  {
923  hWndMain = CreateDialogParamA(hInstance, "CLASS_TEST_DIALOG", NULL, 0, 0);
924  ok(hWndMain != NULL, "CreateDialogParam returned NULL\n");
927  }
928 }
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
HINSTANCE hInstance
Definition: charmap.c:20
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
HWND WINAPI CreateDialogParamA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
HWND hWndMain
Definition: welcome.c:60
#define ok(value,...)
Definition: atltest.h:57
static BOOL RegisterTestDialog(HINSTANCE hInstance)
Definition: class.c:889

Referenced by START_TEST().

◆ RegisterTestDialog()

static BOOL RegisterTestDialog ( HINSTANCE  hInstance)
static

Definition at line 889 of file class.c.

890 {
891  WNDCLASSEXA wcx;
892  ATOM atom = 0;
893 
894  ZeroMemory(&wcx, sizeof(WNDCLASSEXA));
895  wcx.cbSize = sizeof(wcx);
896  wcx.lpfnWndProc = TestDlgProc;
897  wcx.cbClsExtra = 0;
899  wcx.hInstance = hInstance;
903  wcx.lpszClassName = "TestDialog";
904  wcx.lpszMenuName = "TestDialog";
908 
909  atom = RegisterClassExA(&wcx);
910  ok(atom != 0, "RegisterClassEx returned 0\n");
911 
912  return atom;
913 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define MAKEINTRESOURCE
Definition: winuser.h:591
LPCSTR lpszMenuName
Definition: winuser.h:3185
ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
Definition: class.c:1528
#define IMAGE_ICON
Definition: winuser.h:212
HCURSOR hCursor
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3178
LPCSTR lpszClassName
Definition: winuser.h:3186
WORD ATOM
Definition: dimm.idl:113
#define ZeroMemory
Definition: winbase.h:1642
#define SM_CYSMICON
Definition: winuser.h:1003
#define WHITE_BRUSH
Definition: wingdi.h:901
#define IDI_APPLICATION
Definition: winuser.h:699
HICON hIconSm
Definition: winuser.h:3187
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
static LRESULT WINAPI TestDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: class.c:884
HINSTANCE hInstance
Definition: charmap.c:20
HINSTANCE hInstance
Definition: winuser.h:3181
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3176
const char * LPCSTR
Definition: xmlstorage.h:183
HBRUSH hbrBackground
Definition: winuser.h:3184
int WINAPI GetSystemMetrics(_In_ int)
int cbWndExtra
Definition: winuser.h:3180
#define SM_CXSMICON
Definition: winuser.h:1002
HICON hIcon
Definition: winuser.h:3182
#define DLGWINDOWEXTRA
Definition: winuser.h:2540
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
int cbClsExtra
Definition: winuser.h:3179
HANDLE WINAPI LoadImageA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2147
#define ok(value,...)
Definition: atltest.h:57
#define IDC_ARROW
Definition: winuser.h:682
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077

Referenced by CreateDialogParamTest().

◆ START_TEST()

START_TEST ( class  )

Definition at line 1472 of file class.c.

1473 {
1474  char **argv;
1476  int argc = winetest_get_mainargs( &argv );
1477 
1478  if (argc >= 3)
1479  {
1480  test_comctl32_class( argv[2] );
1481  return;
1482  }
1483 
1484  test_IME();
1487 
1488  if (!GetModuleHandleW(0))
1489  {
1490  trace("Class test is incompatible with Win9x implementation, skipping\n");
1491  return;
1492  }
1493 
1497  test_styles();
1498  test_builtinproc();
1499  test_icons();
1502 
1503  /* this test unregisters the Button class so it should be executed at the end */
1504  test_instances();
1505 }
static void test_actctx_classes(void)
Definition: class.c:1311
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
static void ClassTest(HINSTANCE hInstance, BOOL global)
Definition: class.c:93
static void test_instances(void)
Definition: class.c:354
static void test_GetClassInfo(void)
Definition: class.c:960
static void test_extra_values(void)
Definition: class.c:945
#define argv
Definition: mplay32.c:18
HINSTANCE hInstance
Definition: charmap.c:20
smooth NULL
Definition: ftsmooth.c:416
static void test_builtinproc(void)
Definition: class.c:642
static void test_comctl32_classes(void)
Definition: class.c:1213
#define trace
Definition: atltest.h:70
int winetest_get_mainargs(char ***pargv)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
static void test_IME(void)
Definition: class.c:1265
static void test_styles(void)
Definition: class.c:258
static void test_icons(void)
Definition: class.c:1027
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
static void test_comctl32_class(const char *name)
Definition: class.c:1125
static void CreateDialogParamTest(HINSTANCE hInstance)
Definition: class.c:917

◆ test_actctx_classes()

static void test_actctx_classes ( void  )
static

Definition at line 1311 of file class.c.

1312 {
1313  static const char main_manifest[] =
1314  "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
1315  "<assemblyIdentity version=\"4.3.2.1\" name=\"Wine.WndClass.Test\" type=\"win32\" />"
1316  "<file name=\"file.exe\">"
1317  "<windowClass>MyTestClass</windowClass>"
1318  "</file>"
1319  "</assembly>";
1320  static const char *testclass = "MyTestClass";
1321  WNDCLASSA wc;
1322  ULONG_PTR cookie;
1323  HANDLE context;
1324  BOOL ret;
1325  ATOM class;
1326  HINSTANCE hinst;
1327  char buff[64];
1328  HWND hwnd, hwnd2;
1329  char path[MAX_PATH];
1330 
1332  strcat(path, "actctx_classes.manifest");
1333 
1334  create_manifest_file(path, main_manifest);
1336  ret = DeleteFileA(path);
1337  ok(ret, "Failed to delete manifest file, error %d.\n", GetLastError());
1338 
1340  ok(ret, "Failed to activate context.\n");
1341 
1342  memset(&wc, 0, sizeof(wc));
1345  wc.lpszClassName = testclass;
1346 
1347  hinst = GetModuleHandleW(0);
1348 
1349  ret = GetClassInfoA(hinst, testclass, &wc);
1350  ok(!ret, "Expected failure.\n");
1351 
1352  class = RegisterClassA(&wc);
1353  ok(class != 0, "Failed to register class.\n");
1354 
1355  /* Class info is available by versioned and regular names. */
1356  ret = GetClassInfoA(hinst, testclass, &wc);
1357  ok(ret, "Failed to get class info.\n");
1358 
1359  hwnd = CreateWindowExA(0, testclass, "test", 0, 0, 0, 0, 0, 0, 0, hinst, 0);
1360  ok(hwnd != NULL, "Failed to create a window.\n");
1361 
1362  hwnd2 = FindWindowExA(NULL, NULL, "MyTestClass", NULL);
1363  ok(hwnd2 == hwnd, "Failed to find test window.\n");
1364 
1365  hwnd2 = FindWindowExA(NULL, NULL, "4.3.2.1!MyTestClass", NULL);
1366  ok(hwnd2 == NULL, "Unexpected find result %p.\n", hwnd2);
1367 
1368  ret = GetClassNameA(hwnd, buff, sizeof(buff));
1369  ok(ret, "Failed to get class name.\n");
1370  ok(!strcmp(buff, testclass), "Unexpected class name.\n");
1371 
1372  ret = GetClassInfoA(hinst, "4.3.2.1!MyTestClass", &wc);
1373  ok(ret, "Failed to get class info.\n");
1374 
1375  ret = UnregisterClassA(testclass, hinst);
1376  ok(!ret, "Failed to unregister class.\n");
1377 
1378  ret = DeactivateActCtx(0, cookie);
1379  ok(ret, "Failed to deactivate context.\n");
1380 
1381  ret = GetClassInfoA(hinst, testclass, &wc);
1382  ok(!ret, "Unexpected ret val %d.\n", ret);
1383 
1384  ret = GetClassInfoA(hinst, "4.3.2.1!MyTestClass", &wc);
1385  ok(ret, "Failed to get class info.\n");
1386 
1387  ret = GetClassNameA(hwnd, buff, sizeof(buff));
1388  ok(ret, "Failed to get class name.\n");
1389  ok(!strcmp(buff, testclass), "Unexpected class name.\n");
1390 
1392 
1393  hwnd = CreateWindowExA(0, "4.3.2.1!MyTestClass", "test", 0, 0, 0, 0, 0, 0, 0, hinst, 0);
1394  ok(hwnd != NULL, "Failed to create a window.\n");
1395 
1396  hwnd2 = FindWindowExA(NULL, NULL, "MyTestClass", NULL);
1397  ok(hwnd2 == hwnd, "Failed to find test window.\n");
1398 
1399  hwnd2 = FindWindowExA(NULL, NULL, "4.3.2.1!MyTestClass", NULL);
1400  ok(hwnd2 == NULL, "Unexpected find result %p.\n", hwnd2);
1401 
1403 
1404  ret = UnregisterClassA("MyTestClass", hinst);
1405  ok(!ret, "Unexpected ret value %d.\n", ret);
1406 
1407  ret = UnregisterClassA("4.3.2.1!MyTestClass", hinst);
1408  ok(ret, "Failed to unregister class.\n");
1409 
1410  /* Register versioned class without active context. */
1411  wc.lpszClassName = "4.3.2.1!MyTestClass";
1412  class = RegisterClassA(&wc);
1413  ok(class != 0, "Failed to register class.\n");
1414 
1416  ok(ret, "Failed to activate context.\n");
1417 
1418  wc.lpszClassName = "MyTestClass";
1419  class = RegisterClassA(&wc);
1420  ok(class == 0, "Expected failure.\n");
1421 
1422  ret = DeactivateActCtx(0, cookie);
1423  ok(ret, "Failed to deactivate context.\n");
1424 
1425  ret = UnregisterClassA("4.3.2.1!MyTestClass", hinst);
1426  ok(ret, "Failed to unregister class.\n");
1427 
1428  /* Only versioned name is registered. */
1430  ok(ret, "Failed to activate context.\n");
1431 
1432  wc.lpszClassName = "MyTestClass";
1433  class = RegisterClassA(&wc);
1434  ok(class != 0, "Failed to register class\n");
1435 
1436  ret = DeactivateActCtx(0, cookie);
1437  ok(ret, "Failed to deactivate context.\n");
1438 
1439  ret = GetClassInfoA(hinst, "MyTestClass", &wc);
1440  ok(!ret, "Expected failure.\n");
1441 
1442  ret = GetClassInfoA(hinst, "4.3.2.1!MyTestClass", &wc);
1443  ok(ret, "Failed to get class info.\n");
1444 
1445  ret = UnregisterClassA("4.3.2.1!MyTestClass", hinst);
1446  ok(ret, "Failed to unregister class.\n");
1447 
1448  /* Register regular name first, it's not considered when versioned name is registered. */
1449  wc.lpszClassName = "MyTestClass";
1450  class = RegisterClassA(&wc);
1451  ok(class != 0, "Failed to register class.\n");
1452 
1454  ok(ret, "Failed to activate context.\n");
1455 
1456  wc.lpszClassName = "MyTestClass";
1457  class = RegisterClassA(&wc);
1458  ok(class != 0, "Failed to register class.\n");
1459 
1460  ret = DeactivateActCtx(0, cookie);
1461  ok(ret, "Failed to deactivate context.\n");
1462 
1463  ret = UnregisterClassA("4.3.2.1!MyTestClass", hinst);
1464  ok(ret, "Failed to unregister class.\n");
1465 
1466  ret = UnregisterClassA("MyTestClass", hinst);
1467  ok(ret, "Failed to unregister class.\n");
1468 
1470 }
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: http.c:7094
WORD ATOM
Definition: dimm.idl:113
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define IDI_APPLICATION
Definition: winuser.h:699
static void create_manifest_file(const char *filename, const char *manifest)
Definition: class.c:1086
BOOL WINAPI DestroyWindow(_In_ HWND)
uint32_t ULONG_PTR
Definition: typedefs.h:63
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
ATOM WINAPI RegisterClassA(CONST WNDCLASSA *lpWndClass)
Definition: class.c:1591
unsigned int BOOL
Definition: ntddk_ex.h:94
static HANDLE create_test_actctx(const char *file)
Definition: class.c:1099
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
int WINAPI GetClassNameA(HWND hWnd, LPSTR lpClassName, int nMaxCount)
Definition: class.c:998
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
Definition: actctx.c:208
#define MAX_PATH
Definition: compat.h:26
static LRESULT WINAPI ClassTest_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: class.c:79
int ret
LPCSTR lpszClassName
Definition: winuser.h:3147
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
Definition: cookie.c:33
WNDPROC lpfnWndProc
Definition: winuser.h:3139
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
HWND WINAPI FindWindowExA(_In_opt_ HWND, _In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static HINSTANCE hinst
Definition: edit.c:551
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
BOOL WINAPI UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance)
Definition: class.c:1891
#define memset(x, y, z)
Definition: compat.h:39
static unsigned char buff[32768]
Definition: fatten.c:17
HICON hIcon
Definition: winuser.h:3143

Referenced by START_TEST().

◆ test_builtinproc()

static void test_builtinproc ( void  )
static

Definition at line 642 of file class.c.

643 {
644  /* Edit behaves differently */
645  static const CHAR NORMAL_CLASSES[][10] = {
646  "Button",
647  "Static",
648  "ComboBox",
649  "ComboLBox",
650  "ListBox",
651  "ScrollBar",
652  "#32770", /* dialog */
653  };
654  static const char classA[] = "deftest";
655  static const WCHAR classW[] = {'d','e','f','t','e','s','t',0};
656  WCHAR unistring[] = {0x142, 0x40e, 0x3b4, 0}; /* a string that would be destroyed by a W->A->W conversion */
657  WNDPROC pDefWindowProcA, pDefWindowProcW;
658  WNDPROC pNtdllDefWindowProcA, pNtdllDefWindowProcW;
659  WNDPROC oldproc;
660  WNDCLASSEXA cls; /* the memory layout of WNDCLASSEXA and WNDCLASSEXW is the same */
661  WCHAR buf[128];
662  ATOM atom;
663  HWND hwnd;
664  unsigned int i;
665 
666  pDefWindowProcA = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "DefWindowProcA");
667  pDefWindowProcW = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "DefWindowProcW");
668  pNtdllDefWindowProcA = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtdllDefWindowProc_A");
669  pNtdllDefWindowProcW = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtdllDefWindowProc_W");
670 
671  /* On Vista+, the user32.dll export DefWindowProcA/W is forwarded to */
672  /* ntdll.NtdllDefWindowProc_A/W. However, the wndproc returned by */
673  /* GetClassLong/GetWindowLong points to an unexported user32 function */
674  if (pDefWindowProcA == pNtdllDefWindowProcA &&
675  pDefWindowProcW == pNtdllDefWindowProcW)
676  skip("user32.DefWindowProcX forwarded to ntdll.NtdllDefWindowProc_X\n");
677  else
678  {
679  for (i = 0; i < 4; i++)
680  {
681  ZeroMemory(&cls, sizeof(cls));
682  cls.cbSize = sizeof(cls);
685  if (i & 1)
686  cls.lpfnWndProc = pDefWindowProcA;
687  else
688  cls.lpfnWndProc = pDefWindowProcW;
689 
690  if (i & 2)
691  {
692  cls.lpszClassName = classA;
693  atom = RegisterClassExA(&cls);
694  }
695  else
696  {
697  cls.lpszClassName = (LPCSTR)classW;
698  atom = RegisterClassExW((WNDCLASSEXW *)&cls);
699  }
700  ok(atom != 0, "Couldn't register class, i=%d, %d\n", i, GetLastError());
701 
702  hwnd = CreateWindowA(classA, NULL, 0, 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), NULL);
703  ok(hwnd != NULL, "Couldn't create window i=%d\n", i);
704 
705  ok(GetWindowLongPtrA(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcA, "Wrong ANSI wndproc: %p vs %p\n",
706  (void *)GetWindowLongPtrA(hwnd, GWLP_WNDPROC), pDefWindowProcA);
707  ok(GetClassLongPtrA(hwnd, GCLP_WNDPROC) == (ULONG_PTR)pDefWindowProcA, "Wrong ANSI wndproc: %p vs %p\n",
708  (void *)GetClassLongPtrA(hwnd, GCLP_WNDPROC), pDefWindowProcA);
709 
710  ok(GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcW, "Wrong Unicode wndproc: %p vs %p\n",
711  (void *)GetWindowLongPtrW(hwnd, GWLP_WNDPROC), pDefWindowProcW);
712  ok(GetClassLongPtrW(hwnd, GCLP_WNDPROC) == (ULONG_PTR)pDefWindowProcW, "Wrong Unicode wndproc: %p vs %p\n",
713  (void *)GetClassLongPtrW(hwnd, GCLP_WNDPROC), pDefWindowProcW);
714 
717  }
718  }
719 
720  /* built-in winproc - window A/W type automatically detected */
721  ZeroMemory(&cls, sizeof(cls));
722  cls.cbSize = sizeof(cls);
725  cls.lpszClassName = classA;
726  cls.lpfnWndProc = pDefWindowProcW;
727  atom = RegisterClassExA(&cls);
728 
732  broken(!IsWindowUnicode(hwnd)) /* Windows 8 and 10 */,
733  "Windows should be Unicode\n");
735  if (IsWindowUnicode(hwnd))
736  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
737  else
738  ok(memcmp(buf, unistring, sizeof(unistring)) != 0, "WM_GETTEXT invalid return\n");
739  SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)pDefWindowProcA);
740  ok(IsWindowUnicode(hwnd), "Windows should have remained Unicode\n");
741  if (GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcA)
742  {
743  /* DefWindowProc isn't magic on wow64 */
744  ok(IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd, GWLP_WNDPROC)), "Ansi winproc is not a handle\n");
745  }
746  else
747  {
748  ok(GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcW, "Invalid Unicode winproc\n");
749  ok(GetWindowLongPtrA(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcA, "Invalid Ansi winproc\n");
750  }
752  ok(IsWindowUnicode(hwnd) == FALSE, "SetWindowLongPtrA should have switched window to ANSI\n");
753 
756 
757  /* custom winproc - the same function can be used as both A and W*/
758  ZeroMemory(&cls, sizeof(cls));
759  cls.cbSize = sizeof(cls);
762  cls.lpszClassName = classA;
764  atom = RegisterClassExA(&cls);
765 
768  ok(IsWindowUnicode(hwnd) == FALSE, "Window should be ANSI\n");
770  ok(IsWindowUnicode(hwnd), "SetWindowLongPtrW should have changed window to Unicode\n");
772  ok(IsWindowUnicode(hwnd) == FALSE, "SetWindowLongPtrA should have changed window to ANSI\n");
773 
776 
777  /* For most of the builtin controls both GetWindowLongPtrA and W returns a pointer that is executed directly
778  * by CallWindowProcA/W */
779  for (i = 0; i < ARRAY_SIZE(NORMAL_CLASSES); i++)
780  {
781  WNDPROC procA, procW;
782  hwnd = CreateWindowExA(0, NORMAL_CLASSES[i], classA, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 680, 260,
783  NULL, NULL, NULL, 0);
784  ok(hwnd != NULL, "Couldn't create window of class %s\n", NORMAL_CLASSES[i]);
785  SetWindowTextA(hwnd, classA); /* ComboBox needs this */
788  ok(!IS_WNDPROC_HANDLE(procA), "procA should not be a handle for %s (%p)\n", NORMAL_CLASSES[i], procA);
789  ok(!IS_WNDPROC_HANDLE(procW), "procW should not be a handle for %s (%p)\n", NORMAL_CLASSES[i], procW);
790  CallWindowProcA(procA, hwnd, WM_GETTEXT, 120, (LPARAM)buf);
791  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT A/A invalid return for class %s\n", NORMAL_CLASSES[i]);
792  CallWindowProcA(procW, hwnd, WM_GETTEXT, 120, (LPARAM)buf);
793  ok(memcmp(buf, classW, sizeof(classW)) == 0, "WM_GETTEXT A/W invalid return for class %s\n", NORMAL_CLASSES[i]);
794  CallWindowProcW(procA, hwnd, WM_GETTEXT, 120, (LPARAM)buf);
795  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT W/A invalid return for class %s\n", NORMAL_CLASSES[i]);
796  CallWindowProcW(procW, hwnd, WM_GETTEXT, 120, (LPARAM)buf);
797  ok(memcmp(buf, classW, sizeof(classW)) == 0, "WM_GETTEXT W/W invalid return for class %s\n", NORMAL_CLASSES[i]);
798 
800  ok(IS_WNDPROC_HANDLE(oldproc) == FALSE, "Class %s shouldn't return a handle\n", NORMAL_CLASSES[i]);
803  }
804 
805  /* Edit controls are special - they return a wndproc handle when GetWindowLongPtr is called with a different A/W.
806  * On the other hand there is no W->A->W conversion so this control is treated specially. */
808  CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, NULL, 0);
809  /* GetClassLongPtr returns that both the Unicode and ANSI wndproc */
810  ok(IS_WNDPROC_HANDLE(GetClassLongPtrA(hwnd, GCLP_WNDPROC)) == FALSE, "Edit control class should have a Unicode wndproc\n");
811  ok(IS_WNDPROC_HANDLE(GetClassLongPtrW(hwnd, GCLP_WNDPROC)) == FALSE, "Edit control class should have a ANSI wndproc\n");
812  /* But GetWindowLongPtr returns only a handle for the ANSI one */
813  ok(IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd, GWLP_WNDPROC)), "Edit control should return a wndproc handle\n");
814  ok(!IS_WNDPROC_HANDLE(GetWindowLongPtrW(hwnd, GWLP_WNDPROC)), "Edit control shouldn't return a W wndproc handle\n");
816  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
818  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
820  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
821 
824  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
825 
827  /* SetWindowLongPtr returns a wndproc handle - like GetWindowLongPtr */
828  ok(IS_WNDPROC_HANDLE(oldproc), "Edit control should return a wndproc handle\n");
829  ok(IsWindowUnicode(hwnd) == FALSE, "SetWindowLongPtrA should have changed window to ANSI\n");
830  SetWindowTextA(hwnd, classA); /* Windows resets the title to WideStringToMultiByte(unistring) */
831  memset(buf, 0, sizeof(buf));
833  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
835  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
837  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
838 
840  ok(memcmp(buf, classW, sizeof(classW)) == 0, "WM_GETTEXT invalid return\n");
841 
843 
845 
847  CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, NULL, 0);
848 
849  /* GetClassLongPtr returns that both the Unicode and ANSI wndproc */
850  ok(!IS_WNDPROC_HANDLE(GetClassLongPtrA(hwnd, GCLP_WNDPROC)), "Edit control class should have a Unicode wndproc\n");
851  ok(!IS_WNDPROC_HANDLE(GetClassLongPtrW(hwnd, GCLP_WNDPROC)), "Edit control class should have a ANSI wndproc\n");
852  /* But GetWindowLongPtr returns only a handle for the Unicode one */
853  ok(!IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd, GWLP_WNDPROC)), "Edit control shouldn't return an A wndproc handle\n");
854  ok(IS_WNDPROC_HANDLE(GetWindowLongPtrW(hwnd, GWLP_WNDPROC)), "Edit control should return a wndproc handle\n");
856  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
858  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
860  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
861 
863  ok(memcmp(buf, classW, sizeof(classW)) == 0, "WM_GETTEXT invalid return\n");
864 
866  SetWindowTextW(hwnd, unistring);
868  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
870  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
872  ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
873 
876  ok(memcmp(buf, classA, sizeof(classA)) == 0, "WM_GETTEXT invalid return\n");
877 
879 
881 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static const WCHAR classW[]
Definition: lex.c:40
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
Definition: class.c:1528
#define WC_EDITW
Definition: commctrl.h:4683
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WNDPROC lpfnWndProc
Definition: winuser.h:3178
LPCSTR lpszClassName
Definition: winuser.h:3186
WORD ATOM
Definition: dimm.idl:113
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char CHAR
Definition: xmlstorage.h:175
#define WM_GETTEXT
Definition: winuser.h:1600
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1642
#define WHITE_BRUSH
Definition: wingdi.h:901
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define GCLP_WNDPROC
Definition: winuser.h:673
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint32_t ULONG_PTR
Definition: typedefs.h:63
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 WC_EDITA
Definition: commctrl.h:4682
HINSTANCE hInstance
Definition: winuser.h:3181
#define IS_WNDPROC_HANDLE(x)
Definition: class.c:41
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
#define CW_USEDEFAULT
Definition: winuser.h:225
static LRESULT WINAPI ClassTest_WndProc2(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: class.c:85
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
UINT cbSize
Definition: winuser.h:3176
const char * LPCSTR
Definition: xmlstorage.h:183
BOOL WINAPI IsWindowUnicode(_In_ HWND)
HBRUSH hbrBackground
Definition: winuser.h:3184
#define GetWindowLongPtrA
Definition: winuser.h:4803
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
static LRESULT WINAPI ClassTest_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: class.c:79
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define SetWindowLongPtrA
Definition: winuser.h:5320
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define GWLP_WNDPROC
Definition: treelist.c:66
#define broken(x)
Definition: _sntprintf.h:21
ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
Definition: class.c:1574
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define skip(...)
Definition: atltest.h:64
#define GetClassLongPtrA
Definition: winuser.h:4538
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define GetProcAddress(x, y)
Definition: compat.h:418
#define SetWindowLongPtrW
Definition: winuser.h:5321
BOOL WINAPI UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance)
Definition: class.c:1891
#define memset(x, y, z)
Definition: compat.h:39
#define GetClassLongPtrW
Definition: winuser.h:4539

Referenced by START_TEST().

◆ test_comctl32_class()

static void test_comctl32_class ( const char name)
static

Definition at line 1125 of file class.c.

1126 {
1127  WNDCLASSA wcA;
1128  WNDCLASSW wcW;
1129  BOOL ret;
1130  HMODULE module;
1131  WCHAR nameW[20];
1132  HWND hwnd;
1133 
1134  if (name[0] == '!')
1135  {
1136  char path[MAX_PATH];
1137  ULONG_PTR cookie;
1138  HANDLE context;
1139 
1140  name++;
1141 
1143  strcat(path, "comctl32_class.manifest");
1144 
1147  ret = DeleteFileA(path);
1148  ok(ret, "Failed to delete manifest file, error %d.\n", GetLastError());
1149 
1150  module = GetModuleHandleA( "comctl32" );
1151  ok( !module, "comctl32 already loaded\n" );
1152 
1154  ok(ret, "Failed to activate context.\n");
1155 
1156  /* Some systems load modules during context activation. In this case skip the rest of the test. */
1157  module = GetModuleHandleA( "comctl32" );
1158  ok( !module || broken(module != NULL) /* Vista/Win7 */, "comctl32 already loaded\n" );
1159  if (module)
1160  {
1161  win_skip("Module loaded during context activation. Skipping tests.\n");
1162  goto skiptest;
1163  }
1164 
1165  ret = GetClassInfoA( 0, name, &wcA );
1166  ok( ret || broken(!ret) /* WinXP */, "GetClassInfoA failed for %s\n", name );
1167  if (!ret)
1168  goto skiptest;
1169 
1171  ret = GetClassInfoW( 0, nameW, &wcW );
1172  ok( ret, "GetClassInfoW failed for %s\n", name );
1173  module = GetModuleHandleA( "comctl32" );
1174  ok( module != 0, "comctl32 not loaded\n" );
1175  FreeLibrary( module );
1176  module = GetModuleHandleA( "comctl32" );
1177  ok( !module || broken(module != NULL) /* Vista */, "comctl32 still loaded\n" );
1178  hwnd = CreateWindowA( name, "test", WS_OVERLAPPEDWINDOW, 0, 0, 10, 10, NULL, NULL, NULL, 0 );
1179  ok( hwnd != 0, "failed to create window for %s\n", name );
1180  module = GetModuleHandleA( "comctl32" );
1181  ok( module != 0, "comctl32 not loaded\n" );
1182  DestroyWindow( hwnd );
1183 
1184  skiptest:
1185  ret = DeactivateActCtx(0, cookie);
1186  ok(ret, "Failed to deactivate context.\n");
1188  }
1189  else
1190  {
1191  module = GetModuleHandleA( "comctl32" );
1192  ok( !module, "comctl32 already loaded\n" );
1193  ret = GetClassInfoA( 0, name, &wcA );
1194  ok( ret || broken(!ret) /* <= winxp */, "GetClassInfoA failed for %s\n", name );
1195  if (!ret) return;
1197  ret = GetClassInfoW( 0, nameW, &wcW );
1198  ok( ret, "GetClassInfoW failed for %s\n", name );
1199  module = GetModuleHandleA( "comctl32" );
1200  ok( module != 0, "comctl32 not loaded\n" );
1201  FreeLibrary( module );
1202  module = GetModuleHandleA( "comctl32" );
1203  ok( !module, "comctl32 still loaded\n" );
1204  hwnd = CreateWindowA( name, "test", WS_OVERLAPPEDWINDOW, 0, 0, 10, 10, NULL, NULL, NULL, 0 );
1205  ok( hwnd != 0, "failed to create window for %s\n", name );
1206  module = GetModuleHandleA( "comctl32" );
1207  ok( module != 0, "comctl32 not loaded\n" );
1208  DestroyWindow( hwnd );
1209  }
1210 }
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HMODULE module
Definition: main.cpp:47
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
Definition: http.c:7094
#define CP_ACP
Definition: compat.h:99
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI GetClassInfoW(HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSW lpWndClass)
Definition: class.c:507
static void create_manifest_file(const char *filename, const char *manifest)
Definition: class.c:1086
BOOL WINAPI DestroyWindow(_In_ HWND)
uint32_t ULONG_PTR
Definition: typedefs.h:63
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
unsigned int BOOL
Definition: ntddk_ex.h:94
static HANDLE create_test_actctx(const char *file)
Definition: class.c:1099
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const WCHAR nameW[]
Definition: main.c:46
#define FreeLibrary(x)
Definition: compat.h:413
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
Definition: actctx.c:208
#define MAX_PATH
Definition: compat.h:26
int ret
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define broken(x)
Definition: _sntprintf.h:21
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
#define ARRAY_SIZE(a)
Definition: main.h:24
static const char comctl32_manifest[]
Definition: class.c:55
#define ok(value,...)
Definition: atltest.h:57
Definition: cookie.c:33
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:38
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define win_skip
Definition: test.h:149

Referenced by START_TEST().

◆ test_comctl32_classes()

static void test_comctl32_classes ( void  )
static

Definition at line 1213 of file class.c.

1214 {
1215  char path_name[MAX_PATH];
1218  char **argv;
1219  int i;
1220 
1221  static const char *classes[] =
1222  {
1226  WC_HEADERA,
1227  HOTKEY_CLASSA,
1228  WC_IPADDRESSA,
1229  WC_LISTVIEWA,
1236  "SysLink",
1241  WC_TREEVIEWA,
1242  UPDOWN_CLASSA,
1243  "!Button",
1244  "!Edit",
1245  "!Static",
1246  "!Listbox",
1247  "!ComboBox",
1248  "!ComboLBox",
1249  };
1250 
1252  for (i = 0; i < ARRAY_SIZE(classes); i++)
1253  {
1254  memset( &startup, 0, sizeof(startup) );
1255  startup.cb = sizeof( startup );
1256  sprintf( path_name, "%s class %s", argv[0], classes[i] );
1258  "CreateProcess failed.\n" );
1259  winetest_wait_child_process( info.hProcess );
1260  CloseHandle( info.hProcess );
1261  CloseHandle( info.hThread );
1262  }
1263 }
#define WC_PAGESCROLLERA
Definition: commctrl.h:4494
#define CloseHandle
Definition: compat.h:406
#define REBARCLASSNAMEA
Definition: commctrl.h:1460
int startup(int argc, const char *argv[])
Definition: startup.c:430
#define WC_LISTVIEWA
Definition: commctrl.h:2252
#define argv
Definition: mplay32.c:18
#define MONTHCAL_CLASSA
Definition: commctrl.h:4172
struct _test_info info[]
Definition: SetCursorPos.c:19
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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 WC_IPADDRESSA
Definition: commctrl.h:4469
#define WC_TREEVIEWA
Definition: commctrl.h:3238
smooth NULL
Definition: ftsmooth.c:416
#define DATETIMEPICK_CLASSA
Definition: commctrl.h:4319
#define HOTKEY_CLASSA
Definition: commctrl.h:2231
static char * path_name(DOS_FILE *file)
Definition: check.c:208
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4742
#define MAX_PATH
Definition: compat.h:26
int winetest_get_mainargs(char ***pargv)
#define UPDOWN_CLASSA
Definition: commctrl.h:2114
#define ANIMATE_CLASSA
Definition: commctrl.h:4138
void winetest_wait_child_process(HANDLE process)
#define TOOLBARCLASSNAMEA
Definition: commctrl.h:940
#define WC_NATIVEFONTCTLA
Definition: commctrl.h:4603
#define WC_COMBOBOXEXA
Definition: commctrl.h:3778
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define TRACKBAR_CLASSA
Definition: commctrl.h:2006
#define TOOLTIPS_CLASSA
Definition: commctrl.h:1704
#define STATUSCLASSNAMEA
Definition: commctrl.h:1933
#define memset(x, y, z)
Definition: compat.h:39
#define PROGRESS_CLASSA
Definition: commctrl.h:2171
#define WC_TABCONTROLA
Definition: commctrl.h:3930
#define WC_HEADERA
Definition: commctrl.h:619

Referenced by START_TEST().

◆ test_extra_values()

static void test_extra_values ( void  )
static

Definition at line 945 of file class.c.

946 {
947  int i;
948  for(i = 0; i < ARRAY_SIZE(extra_values); i++)
949  {
950  WNDCLASSEXA wcx;
952 
953  ok( ret, "GetClassInfo (0) failed for global class %s\n", extra_values[i].name);
954  if (!ret) continue;
956  "expected %d, got %d\n", extra_values[i].value, wcx.cbWndExtra);
957  }
958 }
BOOL WINAPI GetClassInfoExA(HINSTANCE hInstance, LPCSTR lpszClass, LPWNDCLASSEXA lpwcx)
Definition: class.c:264
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
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
int badvalue
Definition: class.c:934
int cbWndExtra
Definition: winuser.h:3180
int ret
#define broken(x)
Definition: _sntprintf.h:21
static const struct @1669 extra_values[]
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
Definition: name.c:38

Referenced by START_TEST().

◆ test_GetClassInfo()

static void test_GetClassInfo ( void  )
static

Definition at line 960 of file class.c.

961 {
962  static const WCHAR staticW[] = {'s','t','a','t','i','c',0};
963  WNDCLASSA wc;
964  WNDCLASSEXA wcx;
965  BOOL ret;
966 
967  SetLastError(0xdeadbeef);
968  ret = GetClassInfoA(0, "static", &wc);
969  ok(ret, "GetClassInfoA() error %d\n", GetLastError());
970 
971 if (0) { /* crashes under XP */
972  SetLastError(0xdeadbeef);
973  ret = GetClassInfoA(0, "static", NULL);
974  ok(ret, "GetClassInfoA() error %d\n", GetLastError());
975 
976  SetLastError(0xdeadbeef);
977  ret = GetClassInfoW(0, staticW, NULL);
978  ok(ret, "GetClassInfoW() error %d\n", GetLastError());
979 }
980 
981  wcx.cbSize = sizeof(wcx);
982  SetLastError(0xdeadbeef);
983  ret = GetClassInfoExA(0, "static", &wcx);
984  ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
985 
986  SetLastError(0xdeadbeef);
987  ret = GetClassInfoExA(0, "static", NULL);
988  ok(!ret, "GetClassInfoExA() should fail\n");
990  broken(GetLastError() == 0xdeadbeef), /* win9x */
991  "expected ERROR_NOACCESS, got %d\n", GetLastError());
992 
993  SetLastError(0xdeadbeef);
995  ok(!ret, "GetClassInfoExW() should fail\n");
997  broken(GetLastError() == 0xdeadbeef) /* NT4 */ ||
999  "expected ERROR_NOACCESS, got %d\n", GetLastError());
1000 
1001  wcx.cbSize = 0;
1002  wcx.lpfnWndProc = NULL;
1003  SetLastError(0xdeadbeef);
1004  ret = GetClassInfoExA(0, "static", &wcx);
1005  ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
1006  ok(GetLastError() == 0xdeadbeef, "Unexpected error code %d\n", GetLastError());
1007  ok(wcx.cbSize == 0, "expected 0, got %u\n", wcx.cbSize);
1008  ok(wcx.lpfnWndProc != NULL, "got null proc\n");
1009 
1010  wcx.cbSize = sizeof(wcx) - 1;
1011  wcx.lpfnWndProc = NULL;
1012  SetLastError(0xdeadbeef);
1013  ret = GetClassInfoExA(0, "static", &wcx);
1014  ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
1015  ok(wcx.cbSize == sizeof(wcx) - 1, "expected sizeof(wcx)-1, got %u\n", wcx.cbSize);
1016  ok(wcx.lpfnWndProc != NULL, "got null proc\n");
1017 
1018  wcx.cbSize = sizeof(wcx) + 1;
1019  wcx.lpfnWndProc = NULL;
1020  SetLastError(0xdeadbeef);
1021  ret = GetClassInfoExA(0, "static", &wcx);
1022  ok(ret, "GetClassInfoExA() error %d\n", GetLastError());
1023  ok(wcx.cbSize == sizeof(wcx) + 1, "expected sizeof(wcx)+1, got %u\n", wcx.cbSize);
1024  ok(wcx.lpfnWndProc != NULL, "got null proc\n");
1025 }
WNDPROC lpfnWndProc
Definition: winuser.h:3178
BOOL WINAPI GetClassInfoExA(HINSTANCE hInstance, LPCSTR lpszClass, LPWNDCLASSEXA lpwcx)
Definition: class.c:264
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI GetClassInfoW(HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSW lpWndClass)
Definition: class.c:507
#define ERROR_NOACCESS
Definition: winerror.h:578
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3176
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SetLastError(x)
Definition: compat.h:417
int ret
#define broken(x)
Definition: _sntprintf.h:21
static const WCHAR staticW[]
Definition: actctx.c:656
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
BOOL WINAPI GetClassInfoExW(HINSTANCE hInstance, LPCWSTR lpszClass, LPWNDCLASSEXW lpwcx)
Definition: class.c:374

Referenced by START_TEST().

◆ test_icons()

static void test_icons ( void  )
static

Definition at line 1027 of file class.c.

1028 {
1029  WNDCLASSEXW wcex, ret_wcex;
1030  WCHAR cls_name[] = {'I','c','o','n','T','e','s','t','C','l','a','s','s',0};
1031  HWND hwnd;
1033  HICON hsmicon, hsmallnew;
1034  ICONINFO icinf;
1035 
1036  memset(&wcex, 0, sizeof wcex);
1037  wcex.cbSize = sizeof wcex;
1039  wcex.hIcon = LoadIconW(0, (LPCWSTR)IDI_APPLICATION);
1040  wcex.hInstance = hinst;
1041  wcex.lpszClassName = cls_name;
1042  ok(RegisterClassExW(&wcex), "RegisterClassExW returned 0\n");
1044  0, 0, 0, 0, NULL, NULL, hinst, 0);
1045  ok(hwnd != NULL, "Window was not created\n");
1046 
1047  ok(GetClassInfoExW(hinst, cls_name, &ret_wcex), "Class info was not retrieved\n");
1048  ok(wcex.hIcon == ret_wcex.hIcon, "Icons don't match\n");
1049  ok(ret_wcex.hIconSm != NULL, "hIconSm should be non-zero handle\n");
1050 
1051  hsmicon = (HICON)GetClassLongPtrW(hwnd, GCLP_HICONSM);
1052  ok(hsmicon != NULL, "GetClassLong should return non-zero handle\n");
1053 
1054  ok(SendMessageA(hwnd, WM_GETICON, ICON_BIG, 0) == 0,
1055  "WM_GETICON with ICON_BIG should not return the class icon\n");
1056  ok(SendMessageA(hwnd, WM_GETICON, ICON_SMALL, 0) == 0,
1057  "WM_GETICON with ICON_SMALL should not return the class icon\n");
1058  ok(SendMessageA(hwnd, WM_GETICON, ICON_SMALL2, 0) == 0,
1059  "WM_GETICON with ICON_SMALL2 should not return the class icon\n");
1060 
1063  ok(!SetClassLongPtrW(hwnd, GCLP_HICONSM, (LONG_PTR)hsmallnew),
1064  "Previous hIconSm should be zero\n");
1065  ok(hsmallnew == (HICON)GetClassLongPtrW(hwnd, GCLP_HICONSM),
1066  "Should return explicitly assigned small icon\n");
1067  ok(!GetIconInfo(hsmicon, &icinf), "Previous small icon should be destroyed\n");
1068 
1070  hsmicon = (HICON)GetClassLongPtrW(hwnd, GCLP_HICONSM);
1071  ok( hsmicon != NULL, "GetClassLong should return non-zero handle\n");
1072 
1074  ok(!GetClassLongPtrW(hwnd, GCLP_HICONSM), "GetClassLong should return zero handle\n");
1075 
1077  hsmicon = (HICON)GetClassLongPtrW(hwnd, GCLP_HICONSM);
1078  ok(hsmicon != NULL, "GetClassLong should return non-zero handle\n");
1080  ok(GetIconInfo(hsmicon, &icinf), "Icon should NOT be destroyed\n");
1081 
1082  DestroyIcon(hsmallnew);
1084 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define IMAGE_ICON
Definition: winuser.h:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI UnregisterClassW(LPCWSTR lpClassName, HINSTANCE hInstance)
Definition: class.c:1938
#define SM_CYSMICON
Definition: winuser.h:1003
HICON hIcon
Definition: winuser.h:3197
#define IDI_APPLICATION
Definition: winuser.h:699
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2014
#define ICON_SMALL
Definition: tnclass.cpp:48
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
smooth NULL
Definition: ftsmooth.c:416
#define SetClassLongPtrW
Definition: winuser.h:5240
LPCWSTR lpszClassName
Definition: winuser.h:3201
#define GCLP_HICONSM
Definition: winuser.h:670
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT cbSize
Definition: winuser.h:3191
int WINAPI GetSystemMetrics(_In_ int)
static LRESULT WINAPI ClassTest_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: class.c:79
HINSTANCE hInstance
Definition: winuser.h:3196
#define SM_CXSMICON
Definition: winuser.h:1002
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define GCLP_HICON
Definition: winuser.h:669
WNDPROC lpfnWndProc
Definition: winuser.h:3193
ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
Definition: class.c:1574
#define IDI_QUESTION
Definition: winuser.h:701
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HICON hIconSm
Definition: winuser.h:3202
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
static HINSTANCE hinst
Definition: edit.c:551
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
static const char cls_name[]
Definition: compobj.c:2476
#define memset(x, y, z)
Definition: compat.h:39
BOOL WINAPI GetClassInfoExW(HINSTANCE hInstance, LPCWSTR lpszClass, LPWNDCLASSEXW lpwcx)
Definition: class.c:374
#define GetClassLongPtrW
Definition: winuser.h:4539
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by START_TEST().

◆ test_IME()

static void test_IME ( void  )
static

Definition at line 1265 of file class.c.

1266 {
1267  static const WCHAR ime_classW[] = {'I','M','E',0};
1268 
1269  char module_name[MAX_PATH], *ptr;
1271  WNDCLASSW wnd_classw;
1273  SIZE_T size;
1274  BOOL ret;
1275 
1276  if (!GetProcAddress(GetModuleHandleA("user32.dll"), "BroadcastSystemMessageExA"))
1277  {
1278  win_skip("BroadcastSystemMessageExA not available, skipping IME class test\n");
1279  return;
1280  }
1281 
1282  ok(GetModuleHandleA("imm32") != 0, "imm32.dll is not loaded\n");
1283 
1284  ret = GetClassInfoA(NULL, "IME", &wnd_class);
1285  ok(ret, "GetClassInfo failed: %d\n", GetLastError());
1286 
1287  size = VirtualQuery(wnd_class.lpfnWndProc, &mbi, sizeof(mbi));
1288  ok(size == sizeof(mbi), "VirtualQuery returned %ld\n", size);
1289  if (size == sizeof(mbi)) {
1291  ok(size, "GetModuleFileName failed\n");
1292  for (ptr = module_name+size-1; ptr > module_name; ptr--)
1293  if (*ptr == '\\' || *ptr == '/') break;
1294  if (*ptr == '\\' || *ptr=='/') ptr++;
1295  ok(!lstrcmpiA(ptr, "user32.dll") || !lstrcmpiA(ptr, "ntdll.dll"), "IME window proc implemented in %s\n", ptr);
1296  }
1297 
1298  ret = GetClassInfoW(NULL, ime_classW, &wnd_classw);
1299  ok(ret, "GetClassInfo failed: %d\n", GetLastError());
1300 
1301  size = VirtualQuery(wnd_classw.lpfnWndProc, &mbi, sizeof(mbi));
1302  ok(size == sizeof(mbi), "VirtualQuery returned %ld\n", size);
1304  ok(size, "GetModuleFileName failed\n");
1305  for (ptr = module_name+size-1; ptr > module_name; ptr--)
1306  if (*ptr == '\\' || *ptr == '/') break;
1307  if (*ptr == '\\' || *ptr=='/') ptr++;
1308  ok(!lstrcmpiA(ptr, "user32.dll") || !lstrcmpiA(ptr, "ntdll.dll"), "IME window proc implemented in %s\n", ptr);
1309 }
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
static LPCWSTR LPCWSTR module_name
Definition: db.cpp:168
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI GetClassInfoW(HINSTANCE hInstance, LPCWSTR lpClassName, LPWNDCLASSW lpWndClass)
Definition: class.c:507
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:548
unsigned int BOOL
Definition: ntddk_ex.h:94
WNDPROC lpfnWndProc
Definition: winuser.h:3152
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
Definition: virtmem.c:220
int ret
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define ok(value,...)
Definition: atltest.h:57
#define GetProcAddress(x, y)
Definition: compat.h:418
#define win_skip
Definition: test.h:149
WNDCLASSW wnd_class
Definition: startup.c:16

Referenced by START_TEST().

◆ test_instances()

static void test_instances ( void  )
static

Definition at line 354 of file class.c.

355 {
356  WNDCLASSA cls, wc;
357  WNDCLASSEXA wcexA;
358  HWND hwnd, hwnd2;
359  const char *name = "__test__";
360  HINSTANCE kernel32 = GetModuleHandleA("kernel32");
361  HINSTANCE user32 = GetModuleHandleA("user32");
362  HINSTANCE main_module = GetModuleHandleA(NULL);
363  HINSTANCE zero_instance = 0;
364  DWORD r;
365  char buffer[0x10];
366 
367  memset( &cls, 0, sizeof(cls) );
368  cls.style = CS_HREDRAW | CS_VREDRAW;
370  cls.cbClsExtra = 0;
371  cls.cbWndExtra = 0;
372  cls.lpszClassName = name;
373 
374  cls.lpszMenuName = "main_module";
375  cls.hInstance = main_module;
376 
377  ok( RegisterClassA( &cls ), "Failed to register local class for main module\n" );
378  check_class( main_module, name, "main_module" );
379  check_instance( name, main_module, main_module, main_module );
380  check_thread_instance( name, main_module, main_module, main_module );
381 
382  cls.lpszMenuName = "kernel32";
383  cls.hInstance = kernel32;
384  ok( RegisterClassA( &cls ), "Failed to register local class for kernel32\n" );
385  check_class( kernel32, name, "kernel32" );
386  check_class( main_module, name, "main_module" );
387  check_instance( name, kernel32, kernel32, kernel32 );
388  check_thread_instance( name, kernel32, kernel32, kernel32 );
389  ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" );
390 
391  ZeroMemory(&wcexA, sizeof(wcexA));
392  wcexA.lpfnWndProc = DefWindowProcA;
393  wcexA.lpszClassName = "__classex_test__";
394  SetLastError(0xdeadbeef);
395  wcexA.cbSize = sizeof(wcexA) - 1;
396  ok( ((RegisterClassExA( &wcexA ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
397  "Succeeded with invalid number of cbSize bytes\n");
398  SetLastError(0xdeadbeef);
399  wcexA.cbSize = sizeof(wcexA) + 1;
400  ok( ((RegisterClassExA( &wcexA ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
401  "Succeeded with invalid number of cbSize bytes\n");
402  SetLastError(0xdeadbeef);
403  wcexA.cbSize = sizeof(wcexA);
404  ok( RegisterClassExA( &wcexA ), "Failed with valid number of cbSize bytes\n");
405  wcexA.cbSize = 0xdeadbeef;
406  ok( GetClassInfoExA(main_module, wcexA.lpszClassName, &wcexA), "GetClassInfoEx failed\n");
407  ok( wcexA.cbSize == 0xdeadbeef, "GetClassInfoEx returned wrong cbSize value %d\n", wcexA.cbSize);
408  UnregisterClassA(wcexA.lpszClassName, main_module);
409 
410  /* Bug 2631 - Supplying an invalid number of bytes fails */
411  cls.cbClsExtra = 0;
412  cls.cbWndExtra = -1;
413  SetLastError(0xdeadbeef);
414  ok( ((RegisterClassA( &cls ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
415  "Failed with invalid number of WndExtra bytes\n");
416 
417  cls.cbClsExtra = -1;
418  cls.cbWndExtra = 0;
419  SetLastError(0xdeadbeef);
420  ok( ((RegisterClassA( &cls ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
421  "Failed with invalid number of ClsExtra bytes\n");
422 
423  cls.cbClsExtra = -1;
424  cls.cbWndExtra = -1;
425  SetLastError(0xdeadbeef);
426  ok( ((RegisterClassA( &cls ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)),
427  "Failed with invalid number of ClsExtra and cbWndExtra bytes\n");
428 
429  cls.cbClsExtra = 0;
430  cls.cbWndExtra = 0;
431  SetLastError(0xdeadbeef);
432 
433  /* setting global flag doesn't change status of class */
434  hwnd = CreateWindowExA( 0, name, "test", 0, 0, 0, 0, 0, 0, 0, main_module, 0 );
435  ok( hwnd != 0, "CreateWindow failed error %u\n", GetLastError());
437  cls.lpszMenuName = "kernel32";
438  cls.hInstance = kernel32;
439  ok( RegisterClassA( &cls ), "Failed to register local class for kernel32\n" );
440  check_class( kernel32, name, "kernel32" );
441  check_class( main_module, name, "main_module" );
442  check_instance( name, kernel32, kernel32, kernel32 );
443  check_instance( name, main_module, main_module, main_module );
444  check_thread_instance( name, kernel32, kernel32, kernel32 );
445  check_thread_instance( name, main_module, main_module, main_module );
446  ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" );
447 
448  /* changing the instance doesn't make it global */
450  ok( RegisterClassA( &cls ), "Failed to register local class for kernel32\n" );
451  check_class( kernel32, name, "kernel32" );
452  check_instance( name, kernel32, kernel32, kernel32 );
453  check_thread_instance( name, kernel32, kernel32, kernel32 );
454  ok( !GetClassInfoA( 0, name, &wc ), "Class found with null instance\n" );
455  ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" );
456 
457  /* GetClassInfo with instance 0 finds user32 instance */
459  ok( RegisterClassA( &cls ), "Failed to register local class for kernel32\n" );
460  if (!GetClassInfoA( 0, name, &wc )) zero_instance = user32; /* instance 0 not supported on wow64 */
461  else
462  {
463  check_instance( name, 0, 0, kernel32 );
464  check_thread_instance( name, 0, 0, kernel32 );
465  }
466  check_class( kernel32, name, "kernel32" );
467  check_class( user32, name, "main_module" );
468  check_class( zero_instance, name, "main_module" );
469  check_instance( name, kernel32, kernel32, kernel32 );
470  check_instance( name, user32, zero_instance, user32 );
471  check_thread_instance( name, kernel32, kernel32, kernel32 );
472  check_thread_instance( name, user32, zero_instance, user32 );
473  ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" );
474 
475  SetClassLongPtrA( hwnd, GCLP_HMODULE, 0x12345678 );
476  ok( RegisterClassA( &cls ), "Failed to register local class for kernel32\n" );
477  check_class( kernel32, name, "kernel32" );
478  check_class( (HINSTANCE)0x12345678, name, "main_module" );
479  check_instance( name, kernel32, kernel32, kernel32 );
480  check_instance( name, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678 );
481  check_thread_instance( name, kernel32, kernel32, kernel32 );
482  check_thread_instance( name, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678 );
483  ok( !GetClassInfoA( 0, name, &wc ), "Class found with null instance\n" );
484 
485  /* creating a window with instance 0 uses the first class found */
486  cls.hInstance = (HINSTANCE)0xdeadbeef;
487  cls.lpszMenuName = "deadbeef";
488  cls.style = 3;
489  ok( RegisterClassA( &cls ), "Failed to register local class for deadbeef\n" );
490  hwnd2 = CreateWindowExA( 0, name, "test_window", 0, 0, 0, 0, 0, 0, 0, NULL, 0 );
491  ok( GetClassLongPtrA( hwnd2, GCLP_HMODULE ) == 0xdeadbeef,
492  "Didn't get deadbeef class for null instance\n" );
493  DestroyWindow( hwnd2 );
494  ok( UnregisterClassA( name, (HINSTANCE)0xdeadbeef ), "Unregister failed for deadbeef\n" );
495 
496  hwnd2 = CreateWindowExA( 0, name, "test_window", 0, 0, 0, 0, 0, 0, 0, NULL, 0 );
497  ok( (HINSTANCE)GetClassLongPtrA( hwnd2, GCLP_HMODULE ) == kernel32,
498  "Didn't get kernel32 class for null instance\n" );
499  DestroyWindow( hwnd2 );
500 
501  r = GetClassNameA( hwnd, buffer, 4 );
502  ok( r == 3, "expected 3, got %d\n", r );
503  ok( !strcmp( buffer, "__t"), "name wrong: %s\n", buffer );
504 
505  ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" );
506 
507  hwnd2 = CreateWindowExA( 0, name, "test_window", 0, 0, 0, 0, 0, 0, 0, NULL, 0 );
508  ok( GetClassLongPtrA( hwnd2, GCLP_HMODULE ) == 0x12345678,
509  "Didn't get 12345678 class for null instance\n" );
510  DestroyWindow( hwnd2 );
511 
512  SetClassLongPtrA( hwnd, GCLP_HMODULE, (LONG_PTR)main_module );
513  DestroyWindow( hwnd );
514 
515  /* null handle means the same thing as main module */
516  cls.lpszMenuName = "null";
517  cls.hInstance = 0;
518  ok( !RegisterClassA( &cls ), "Succeeded registering local class for null instance\n" );
519  ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
520  ok( UnregisterClassA( name, main_module ), "Unregister failed for main module\n" );
521 
522  ok( RegisterClassA( &cls ), "Failed to register local class for null instance\n" );
523  /* must be found with main module handle */
524  check_class( main_module, name, "null" );
525  check_instance( name, main_module, main_module, main_module );
526  check_thread_instance( name, main_module, main_module, main_module );
527  ok( !GetClassInfoA( 0, name, &wc ), "Class found with null instance\n" );
528  ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
529  ok( UnregisterClassA( name, 0 ), "Unregister failed for null instance\n" );
530 
531  /* registering for user32 always fails */
532  cls.lpszMenuName = "user32";
533  cls.hInstance = user32;
534  ok( !RegisterClassA( &cls ), "Succeeded registering local class for user32\n" );
535  ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error code %d\n", GetLastError() );
536  cls.style |= CS_GLOBALCLASS;
537  ok( !RegisterClassA( &cls ), "Succeeded registering global class for user32\n" );
538  ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error code %d\n", GetLastError() );
539 
540  /* unregister is OK though */
541  cls.hInstance = main_module;
542  ok( RegisterClassA( &cls ), "Failed to register global class for main module\n" );
543  ok( UnregisterClassA( name, user32 ), "Unregister failed for user32\n" );
544 
545  /* instance doesn't matter for global class */
546  cls.style |= CS_GLOBALCLASS;
547  cls.lpszMenuName = "main_module";
548  cls.hInstance = main_module;
549  ok( RegisterClassA( &cls ), "Failed to register global class for main module\n" );
550  cls.lpszMenuName = "kernel32";
551  cls.hInstance = kernel32;
552  ok( !RegisterClassA( &cls ), "Succeeded registering local class for kernel32\n" );
553  ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
554  /* even if global flag is cleared */
555  hwnd = CreateWindowExA( 0, name, "test", 0, 0, 0, 0, 0, 0, 0, main_module, 0 );
557  ok( !RegisterClassA( &cls ), "Succeeded registering local class for kernel32\n" );
558  ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
559 
560  check_class( main_module, name, "main_module" );
561  check_class( kernel32, name, "main_module" );
562  check_class( 0, name, "main_module" );
563  check_class( (HINSTANCE)0x12345678, name, "main_module" );
564  check_instance( name, main_module, main_module, main_module );
565  check_instance( name, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, main_module );
566  check_thread_instance( name, main_module, main_module, main_module );
567  check_thread_instance( name, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, main_module );
568 
569  /* changing the instance for global class doesn't make much difference */
570  SetClassLongPtrA( hwnd, GCLP_HMODULE, 0xdeadbeef );
571  check_instance( name, main_module, main_module, (HINSTANCE)0xdeadbeef );
572  check_instance( name, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef );
573  check_thread_instance( name, main_module, main_module, (HINSTANCE)0xdeadbeef );
574  check_thread_instance( name, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef );
575 
576  DestroyWindow( hwnd );
577  ok( UnregisterClassA( name, (HINSTANCE)0x87654321 ), "Unregister failed for main module global\n" );
578  ok( !UnregisterClassA( name, (HINSTANCE)0x87654321 ), "Unregister succeeded the second time\n" );
579  ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
580 
581  cls.hInstance = (HINSTANCE)0x12345678;
582  ok( RegisterClassA( &cls ), "Failed to register global class for dummy instance\n" );
583  check_instance( name, main_module, main_module, (HINSTANCE)0x12345678 );
584  check_instance( name, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, (HINSTANCE)0x12345678 );
585  check_thread_instance( name, main_module, main_module, (HINSTANCE)0x12345678 );
586  check_thread_instance( name, (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, (HINSTANCE)0x12345678 );
587  ok( UnregisterClassA( name, (HINSTANCE)0x87654321 ), "Unregister failed for main module global\n" );
588 
589  /* check system classes */
590 
591  /* we cannot register a global class with the name of a system class */
592  cls.style |= CS_GLOBALCLASS;
593  cls.lpszMenuName = "button_main_module";
594  cls.lpszClassName = "BUTTON";
595  cls.hInstance = main_module;
596  ok( !RegisterClassA( &cls ), "Succeeded registering global button class for main module\n" );
597  ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
598  cls.hInstance = kernel32;
599  ok( !RegisterClassA( &cls ), "Succeeded registering global button class for kernel32\n" );
600  ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
601 
602  /* local class is OK however */
603  cls.style &= ~CS_GLOBALCLASS;
604  cls.lpszMenuName = "button_main_module";
605  cls.hInstance = main_module;
606  ok( RegisterClassA( &cls ), "Failed to register local button class for main module\n" );
607  check_class( main_module, "BUTTON", "button_main_module" );
608  cls.lpszMenuName = "button_kernel32";
609  cls.hInstance = kernel32;
610  ok( RegisterClassA( &cls ), "Failed to register local button class for kernel32\n" );
611  check_class( kernel32, "BUTTON", "button_kernel32" );
612  check_class( main_module, "BUTTON", "button_main_module" );
613  ok( UnregisterClassA( "BUTTON", kernel32 ), "Unregister failed for kernel32 button\n" );
614  ok( UnregisterClassA( "BUTTON", main_module ), "Unregister failed for main module button\n" );
615  /* GetClassInfo sets instance to passed value for global classes */
616  check_instance( "BUTTON", 0, 0, user32 );
617  check_instance( "BUTTON", (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, user32 );
618  check_instance( "BUTTON", user32, zero_instance, user32 );
619  check_thread_instance( "BUTTON", 0, 0, user32 );
620  check_thread_instance( "BUTTON", (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, user32 );
621  check_thread_instance( "BUTTON", user32, zero_instance, user32 );
622 
623  /* we can unregister system classes */
624  ok( GetClassInfoA( 0, "BUTTON", &wc ), "Button class not found with null instance\n" );
625  ok( GetClassInfoA( kernel32, "BUTTON", &wc ), "Button class not found with kernel32\n" );
626  ok( UnregisterClassA( "BUTTON", (HINSTANCE)0x12345678 ), "Failed to unregister button\n" );
627  ok( !UnregisterClassA( "BUTTON", (HINSTANCE)0x87654321 ), "Unregistered button a second time\n" );
628  ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
629  ok( !GetClassInfoA( 0, "BUTTON", &wc ), "Button still exists\n" );
630  /* last error not set reliably */
631 
632  /* we can change the instance of a system class */
633  check_instance( "EDIT", (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, user32 );
634  check_thread_instance( "EDIT", (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, user32 );
635  hwnd = CreateWindowExA( 0, "EDIT", "test", 0, 0, 0, 0, 0, 0, 0, main_module, 0 );
636  SetClassLongPtrA( hwnd, GCLP_HMODULE, 0xdeadbeef );
637  check_instance( "EDIT", (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0xdeadbeef );
638  check_thread_instance( "EDIT", (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0xdeadbeef );
640 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
Definition: class.c:1528
WNDPROC lpfnWndProc
Definition: winuser.h:3178
BOOL WINAPI GetClassInfoExA(HINSTANCE hInstance, LPCSTR lpszClass, LPWNDCLASSEXA lpwcx)
Definition: class.c:264
LPCSTR lpszClassName
Definition: winuser.h:3186
#define check_class(inst, name, menu)
Definition: class.c:294
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
BOOL WINAPI GetClassInfoA(HINSTANCE hInstance, LPCSTR lpClassName, LPWNDCLASSA lpWndClass)
Definition: class.c:476
int cbClsExtra
Definition: winuser.h:3140
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1642
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3146
GLuint buffer
Definition: glext.h:5915
BOOL WINAPI DestroyWindow(_In_ HWND)
static void check_thread_instance(const char *name, HINSTANCE inst, HINSTANCE info_inst, HINSTANCE gcl_inst)
Definition: class.c:336
#define GCLP_HMODULE
Definition: winuser.h:671
#define GCL_STYLE
Definition: winuser.h:665
int cbWndExtra
Definition: winuser.h:3141
ATOM WINAPI RegisterClassA(CONST WNDCLASSA *lpWndClass)
Definition: class.c:1591
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_CLASS_ALREADY_EXISTS
Definition: winerror.h:891
UINT cbSize
Definition: winuser.h:3176
#define CS_VREDRAW
Definition: winuser.h:653
const char name[9]
Definition: class.c:932
int WINAPI GetClassNameA(HWND hWnd, LPSTR lpClassName, int nMaxCount)
Definition: class.c:998
#define CS_GLOBALCLASS
Definition: winuser.h:647
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
static LRESULT WINAPI ClassTest_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: class.c:79
HANDLE HINSTANCE
Definition: typedefs.h:75
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPCSTR lpszClassName
Definition: winuser.h:3147
#define SetClassLongPtrA
Definition: winuser.h:5239
UINT style
Definition: winuser.h:3138
HINSTANCE hInstance
Definition: winuser.h:3142
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
DWORD WINAPI SetClassLongA(HWND hWnd, int nIndex, LONG dwNewLong)
Definition: class.c:1652
WNDPROC lpfnWndProc
Definition: winuser.h:3139
Definition: name.c:38
#define GetClassLongPtrA
Definition: winuser.h:4538
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
BOOL WINAPI UnregisterClassA(LPCSTR lpClassName, HINSTANCE hInstance)
Definition: class.c:1891
#define memset(x, y, z)
Definition: compat.h:39
#define ERROR_CLASS_DOES_NOT_EXIST
Definition: winerror.h:892
#define check_instance(name, inst, info_inst, gcl_inst)
Definition: class.c:319

Referenced by START_TEST().

◆ test_styles()

static void test_styles ( void  )
static

Definition at line 258 of file class.c.

259 {
260  /* check style bits */
261  check_style( "Button", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, 0 );
262  check_style( "ComboBox", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, 0 );
263  check_style( "Edit", 1, CS_PARENTDC | CS_DBLCLKS, 0 );
264  check_style( "ListBox", 1, CS_PARENTDC | CS_DBLCLKS, CS_PARENTDC /*FIXME*/ );
265  check_style( "MDIClient", 1, 0, 0 );
266  check_style( "ScrollBar", 1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, 0 );
267  check_style( "Static", 1, CS_PARENTDC | CS_DBLCLKS, 0 );
268  check_style( "ComboLBox", 1, CS_SAVEBITS | CS_DBLCLKS, 0 );
269  check_style( "DDEMLEvent", 0, 0, 0 );
270  check_style( "Message", 0, 0, 0 );
271  check_style( "#32768", 1, CS_DROPSHADOW | CS_SAVEBITS | CS_DBLCLKS, CS_DROPSHADOW ); /* menu */
272  check_style( "#32769", 1, CS_DBLCLKS, 0 ); /* desktop */
273  check_style( "#32770", 1, CS_SAVEBITS | CS_DBLCLKS, 0 ); /* dialog */
274  todo_wine { check_style( "#32771", 1, CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW, 0 ); } /* task switch */
275  check_style( "#32772", 1, 0, 0 ); /* icon title */
276 }
#define CS_DROPSHADOW
Definition: winuser.h:655
#define CS_HREDRAW
Definition: winuser.h:648
#define CS_VREDRAW
Definition: winuser.h:653
#define CS_SAVEBITS
Definition: winuser.h:652
#define todo_wine
Definition: test.h:162
#define CS_DBLCLKS
Definition: winuser.h:646
static void check_style(const char *name, int must_exist, UINT style, UINT ignore)
Definition: class.c:242
#define CS_PARENTDC
Definition: winuser.h:651

Referenced by START_TEST().

◆ TestDlgProc()

static LRESULT WINAPI TestDlgProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 884 of file class.c.

885 {
886  return DefDlgProcA(hWnd, uMsg, wParam, lParam);
887 }
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterTestDialog().

◆ thread_proc()

static DWORD WINAPI thread_proc ( void param)
static

Definition at line 327 of file class.c.

328 {
329  struct class_info *class_info = param;
330 
332 
333  return 0;
334 }
HINSTANCE gcl_inst
Definition: class.c:324
GLfloat param
Definition: glext.h:5796
HINSTANCE info_inst
Definition: class.c:324
HINSTANCE inst
Definition: class.c:324
#define check_instance(name, inst, info_inst, gcl_inst)
Definition: class.c:319
const char * name
Definition: class.c:323

Referenced by check_thread_instance().

Variable Documentation

◆ badvalue

int badvalue

Definition at line 934 of file class.c.

Referenced by _TIFFVSetField(), and test_extra_values().

◆ comctl32_manifest

const char comctl32_manifest[]
static
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n"
" <assemblyIdentity\n"
" type=\"win32\"\n"
" name=\"Wine.User32.Tests\"\n"
" version=\"1.0.0.0\"\n"
" processorArchitecture=\"" ARCH "\"\n"
" />\n"
"<description>Wine comctl32 test suite</description>\n"
"<dependency>\n"
" <dependentAssembly>\n"
" <assemblyIdentity\n"
" type=\"win32\"\n"
" name=\"microsoft.windows.common-controls\"\n"
" version=\"6.0.0.0\"\n"
" processorArchitecture=\"" ARCH "\"\n"
" publicKeyToken=\"6595b64144ccf1df\"\n"
" language=\"*\"\n"
" />\n"
"</dependentAssembly>\n"
"</dependency>\n"
"</assembly>\n"
#define ARCH
Definition: class.c:52

Definition at line 55 of file class.c.

Referenced by test_comctl32_class().

◆ extra_values

const { ... } extra_values[]
Initial value:
=
{
{"#32770",30,30},
{"Edit",6,8},
}

Referenced by test_extra_values().

◆ name

◆ value

Definition at line 933 of file class.c.

Referenced by get_body_text().