ReactOS  0.4.13-dev-73-gcfe54aa
stubs.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS user32.dll
4  * FILE: win32ss/user/user32/misc/stubs.c
5  * PURPOSE: User32.dll stubs
6  * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
7  * NOTES: If you implement a function, remove it from this file
8  * UPDATE HISTORY:
9  * 08-F05-2001 CSH Created
10  */
11 
12 #include <user32.h>
13 
15 
16 /*
17  * @unimplemented
18  */
19 DWORD
20 WINAPI
23  DWORD dwMilliseconds)
24 {
25 // Need to call NtQueryInformationProcess and send ProcessId not hProcess.
26  return NtUserWaitForInputIdle(hProcess, dwMilliseconds, FALSE);
27 }
28 
29 /******************************************************************************
30  * SetDebugErrorLevel [USER32.@]
31  * Sets the minimum error level for generating debugging events
32  *
33  * PARAMS
34  * dwLevel [I] Debugging error level
35  *
36  * @unimplemented
37  */
38 VOID
39 WINAPI
41 {
42  FIXME("(%lu): stub\n", dwLevel);
43 }
44 
45 
46 /*
47  * @implemented
48  */
49 DWORD
50 WINAPI
51 GetAppCompatFlags(HTASK hTask)
52 {
54 
55  return pci->dwCompatFlags;
56 }
57 
58 /*
59  * @implemented
60  */
61 DWORD
62 WINAPI
63 GetAppCompatFlags2(HTASK hTask)
64 {
66 
67  return pci->dwCompatFlags2;
68 }
69 
70 /*
71  * @unimplemented
72  */
73 VOID
74 WINAPI
76 {
78 }
79 
80 /*
81  * @unimplemented
82  */
83 VOID
84 WINAPI
86 {
88 }
89 
90 /*
91  * @unimplemented
92  */
93 VOID
94 WINAPI
96 {
98 }
99 
100 
101 /*
102  * @implemented
103  */
104 UINT
105 WINAPI
107 {
108  return NtUserxRealizePalette(hDC);
109 }
110 
111 
112 /*************************************************************************
113  * SetSysColorsTemp (USER32.@) (Wine 10/22/2008)
114  *
115  * UNDOCUMENTED !!
116  *
117  * Called by W98SE desk.cpl Control Panel Applet:
118  * handle = SetSysColorsTemp(ptr, ptr, nCount); ("set" call)
119  * result = SetSysColorsTemp(NULL, NULL, handle); ("restore" call)
120  *
121  * pPens is an array of COLORREF values, which seems to be used
122  * to indicate the color values to create new pens with.
123  *
124  * pBrushes is an array of solid brush handles (returned by a previous
125  * CreateSolidBrush), which seems to contain the brush handles to set
126  * for the system colors.
127  *
128  * n seems to be used for
129  * a) indicating the number of entries to operate on (length of pPens,
130  * pBrushes)
131  * b) passing the handle that points to the previously used color settings.
132  * I couldn't figure out in hell what kind of handle this is on
133  * Windows. I just use a heap handle instead. Shouldn't matter anyway.
134  *
135  * RETURNS
136  * heap handle of our own copy of the current syscolors in case of
137  * "set" call, i.e. pPens, pBrushes != NULL.
138  * TRUE (unconditionally !) in case of "restore" call,
139  * i.e. pPens, pBrushes == NULL.
140  * FALSE in case of either pPens != NULL and pBrushes == NULL
141  * or pPens == NULL and pBrushes != NULL.
142  *
143  * I'm not sure whether this implementation is 100% correct. [AM]
144  */
145 
146 static HPEN SysColorPens[COLOR_MENUBAR + 1];
147 static HBRUSH SysColorBrushes[COLOR_MENUBAR + 1];
148 
149 DWORD_PTR
150 WINAPI
152  const HBRUSH *pBrushes,
153  DWORD_PTR n)
154 {
155  DWORD i;
156 
157  if (pPens && pBrushes) /* "set" call */
158  {
159  /* allocate our structure to remember old colors */
160  LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH));
161  LPVOID p = pOldCol;
162  *(DWORD_PTR *)p = n; p = (char*)p + sizeof(DWORD);
163  memcpy(p, SysColorPens, n*sizeof(HPEN)); p = (char*)p + n*sizeof(HPEN);
164  memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p = (char*)p + n*sizeof(HBRUSH);
165 
166  for (i=0; i < n; i++)
167  {
168  SysColorPens[i] = CreatePen( PS_SOLID, 1, pPens[i] );
169  SysColorBrushes[i] = pBrushes[i];
170  }
171 
172  return (DWORD_PTR) pOldCol;
173  }
174  if (!pPens && !pBrushes) /* "restore" call */
175  {
176  LPVOID pOldCol = (LPVOID)n;
177  LPVOID p = pOldCol;
178  DWORD nCount = *(DWORD *)p;
179  p = (char*)p + sizeof(DWORD);
180 
181  for (i=0; i < nCount; i++)
182  {
184  SysColorPens[i] = *(HPEN *)p; p = (char*)p + sizeof(HPEN);
185  }
186  for (i=0; i < nCount; i++)
187  {
188  SysColorBrushes[i] = *(HBRUSH *)p; p = (char*)p + sizeof(HBRUSH);
189  }
190  /* get rid of storage structure */
191  HeapFree(GetProcessHeap(), 0, pOldCol);
192 
193  return TRUE;
194  }
195  return FALSE;
196 }
197 
198 /*
199  * @unimplemented
200  */
201 HDESK
202 WINAPI
204 {
206  return FALSE;
207 }
208 
209 /*
210  * @unimplemented
211  */
212 BOOL
213 WINAPI
215 {
217  return FALSE;
218 }
219 
220 /*
221  * @unimplemented
222  */
223 UINT
224 WINAPI
226  HANDLE hDevice,
227  UINT uiCommand,
228  LPVOID pData,
229  PUINT pcbSize)
230 {
232  return 0;
233 }
234 
235 /*
236  * @unimplemented
237  */
238 LONG
239 WINAPI
241  DWORD dwflags,
242  LPDWORD lpdwRecipients,
243  UINT uiMessage,
244  WPARAM wParam,
245  LPARAM lParam,
246  PBSMINFO pBSMInfo)
247 {
249  return FALSE;
250 }
251 
252 /*
253  * @unimplemented
254  */
255 UINT
256 WINAPI
258  HANDLE hDevice,
259  UINT uiCommand,
260  LPVOID pData,
261  PUINT pcbSize)
262 {
264  return 0;
265 }
266 
267 /*
268  * @unimplemented
269  */
270 BOOL
271 WINAPI
273 {
275  return FALSE;
276 }
277 
278 /*
279  * @implemented
280  */
281 LRESULT
282 WINAPI
284  PRAWINPUT* paRawInput,
285  INT nInput,
286  UINT cbSizeHeader)
287 {
288  if (cbSizeHeader == sizeof(RAWINPUTHEADER))
289  return S_OK;
290  return 1;
291 }
292 
293 /*
294  * @unimplemented
295  */
296 UINT
297 WINAPI
300  PRAWINPUT pData,
301  PUINT pcbSize,
302  UINT cbSizeHeader)
303 {
305  return 0;
306 }
307 
308 /*
309  * @unimplemented
310  */
311 UINT
312 WINAPI
314  HRAWINPUT hRawInput,
315  UINT uiCommand,
316  LPVOID pData,
317  PUINT pcbSize,
318  UINT cbSizeHeader)
319 {
321  return 0;
322 }
323 
324 /*
325  * @unimplemented
326  */
327 UINT
328 WINAPI
330  PRAWINPUTDEVICELIST pRawInputDeviceList,
331  PUINT puiNumDevices,
332  UINT cbSize)
333 {
334  if(pRawInputDeviceList)
335  memset(pRawInputDeviceList, 0, sizeof *pRawInputDeviceList);
336  if(puiNumDevices)
337  *puiNumDevices = 0;
338 
340  return 0;
341 }
342 
343 /*
344  * @unimplemented
345  */
346 UINT
347 WINAPI
350  PRAWINPUTDEVICE pRawInputDevices,
351  PUINT puiNumDevices,
352  UINT cbSize)
353 {
355  return 0;
356 }
357 
358 /*
359  * @unimplemented
360  */
361 BOOL
362 WINAPI
365  PCRAWINPUTDEVICE pRawInputDevices,
366  UINT uiNumDevices,
367  UINT cbSize)
368 {
370  return FALSE;
371 }
372 
373 /*
374  * @unimplemented
375  */
377 {
379  return FALSE;
380 }
381 
382 /*
383  * @unimplemented
384  */
386 {
388  return FALSE;
389 }
390 
391 /*
392  * @unimplemented
393  */
395 {
397  return FALSE;
398 }
399 
400 /*
401  * @unimplemented
402  */
404 {
406  return FALSE;
407 }
408 
409 /*
410  * @unimplemented
411  */
413 {
415  return FALSE;
416 }
417 
418 /*
419  * @unimplemented
420  */
422 {
424 }
425 
426 /*
427  * @unimplemented
428  */
430 {
432  return FALSE;
433 }
434 
435 /*
436  * @unimplemented
437  */
439 {
441  return FALSE;
442 }
443 
444 /*
445  * @unimplemented
446  */
447 HKL WINAPI LoadKeyboardLayoutEx(DWORD unknown,LPCWSTR pwszKLID,UINT Flags) //1st parameter unknown
448 {
450  return FALSE;
451 }
452 
453 /*
454  * @unimplemented
455  */
457 {
459 }
460 
461 /*
462  * @unimplemented
463  */
465 {
467 }
468 
469 /*
470  * @implemented
471  */
473 {
474  return NtUserGetMenuIndex(hMenu, hSubMenu);
475 }
476 
477 /*
478  * @unimplemented
479  */
481 {
483  return 0;
484 }
485 
486 BOOL
487 WINAPI
489 {
491  return FALSE;
492 }
493 
494 VOID
495 WINAPI
497 {
498  /* Thread call for remote processes (non-CSRSS) only */
500  ExitThread(0);
501 }
502 
503 BOOL
504 WINAPI
506 {
508  return FALSE;
509 }
510 
511 BOOL
512 WINAPI
513 DeviceEventWorker(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5)
514 {
516  return FALSE;
517 }
518 
519 BOOL
520 WINAPI
522 {
524  return FALSE;
525 }
526 
527 BOOL
528 WINAPI
530 {
531  /*
532  * Determines whether the Shutdown Event Tracker is enabled.
533  *
534  * See http://undoc.airesoft.co.uk/user32.dll/IsSETEnabled.php
535  * for more information.
536  */
538  return FALSE;
539 }
540 
541 BOOL
542 WINAPI
544 {
546  return FALSE;
547 }
548 
549 BOOL
550 WINAPI
552  DWORD dw1,
553  DWORD dw2,
554  DWORD dw3,
555  DWORD dw4,
556  DWORD dw5,
557  DWORD dw6,
558  DWORD dw7,
559  DWORD dw8,
560  DWORD dw9,
561  DWORD dw10,
562  DWORD dw11,
563  DWORD dw12)
564 {
566  return FALSE;
567 }
568 
569 BOOL
570 WINAPI
572 {
574  return FALSE;
575 }
576 
VOID WINAPI LoadLocalFonts(VOID)
Definition: stubs.c:75
VOID WINAPI InitializeLpkHooks(FARPROC *hookfuncs)
Definition: stubs.c:421
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1128
DWORD WINAPI GetAppCompatFlags(HTASK hTask)
Definition: stubs.c:51
#define TRUE
Definition: types.h:120
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI UserLpkTabbedTextOut(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6, DWORD dw7, DWORD dw8, DWORD dw9, DWORD dw10, DWORD dw11, DWORD dw12)
Definition: stubs.c:551
EXTINLINE VOID NtUserxCreateSystemThreads(BOOL bRemoteProcess)
Definition: ntwrapper.h:646
static HPEN SysColorPens[COLOR_MENUBAR+1]
Definition: stubs.c:146
UINT NTAPI NtUserGetMenuIndex(HMENU hMenu, HMENU hSubMenu)
Definition: menu.c:5927
UINT WINAPI GetRawInputDeviceInfoW(HANDLE hDevice, UINT uiCommand, LPVOID pData, PUINT pcbSize)
Definition: stubs.c:225
BOOL WINAPI CtxInitUser32(VOID)
Definition: stubs.c:403
static HDC
Definition: imagelist.c:92
GLdouble n
Definition: glext.h:7729
UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader)
Definition: stubs.c:299
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
BOOL WINAPI DestroyReasons(PVOID Pointer)
Definition: stubs.c:505
BOOL WINAPI ReasonCodeNeedsComment(ULONG reasoncode)
Definition: stubs.c:394
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWin32ClientInfo()
Definition: ntuser.h:320
BOOL WINAPI Win32PoolAllocationStats(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5)
Definition: stubs.c:571
#define UNIMPLEMENTED
Definition: stubs.c:20
BOOL WINAPI EnterReaderModeHelper(HWND hwnd)
Definition: stubs.c:412
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
VOID WINAPI LoadRemoteFonts(VOID)
Definition: stubs.c:85
static HBRUSH SysColorBrushes[COLOR_MENUBAR+1]
Definition: stubs.c:147
#define PS_SOLID
Definition: wingdi.h:585
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
long LONG
Definition: pedump.c:60
DWORD dwCompatFlags2
Definition: ntuser.h:291
#define FIXME(fmt,...)
Definition: debug.h:110
UINT WINAPI GetRawInputDeviceInfoA(HANDLE hDevice, UINT uiCommand, LPVOID pData, PUINT pcbSize)
Definition: stubs.c:257
BOOL WINAPI GetReasonTitleFromReasonCode(DWORD dw1, DWORD dw2, DWORD dw3)
Definition: stubs.c:521
r reserved
Definition: btrfs.c:2655
LONG WINAPI CsrBroadcastSystemMessageExW(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo)
Definition: stubs.c:240
WINE_DEFAULT_DEBUG_CHANNEL(mapi)
LRESULT WINAPI DefRawInputProc(PRAWINPUT *paRawInput, INT nInput, UINT cbSizeHeader)
Definition: stubs.c:283
DWORD WINAPI GetMenuIndex(HMENU hMenu, HMENU hSubMenu)
Definition: stubs.c:472
VOID WINAPI CreateSystemThreads(DWORD Unused)
Definition: stubs.c:496
BOOL WINAPI BuildReasonArray(PVOID Pointer)
Definition: stubs.c:488
LONG_PTR LPARAM
Definition: windef.h:208
VOID WINAPI SetDebugErrorLevel(DWORD dwLevel)
Definition: stubs.c:40
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:327
BOOL WINAPI ReasonCodeNeedsBugID(ULONG reasoncode)
Definition: stubs.c:385
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:224
BOOL WINAPI RecordShutdownReason(DWORD dw0)
Definition: stubs.c:543
BOOL WINAPI DeviceEventWorker(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5)
Definition: stubs.c:513
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define d
Definition: ke_i.h:81
DWORD WINAPI WaitForInputIdle(HANDLE hProcess, DWORD dwMilliseconds)
Definition: stubs.c:21
DWORD NTAPI NtUserWaitForInputIdle(IN HANDLE hProcess, IN DWORD dwMilliseconds, IN BOOL Unknown2)
Definition: message.c:2893
DWORD COLORREF
Definition: windef.h:285
#define WINAPI
Definition: msvc.h:8
const GLubyte * c
Definition: glext.h:8905
VOID WINAPI AllowForegroundActivation(VOID)
Definition: stubs.c:456
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI IsServerSideWindow(HWND wnd)
Definition: stubs.c:438
DWORD WINAPI UserRegisterWowHandlers(PVOID Unknown1, PVOID Unknown2)
Definition: stubs.c:480
Definition: id3.c:18
#define LPVOID
Definition: nt_native.h:45
DWORD dwCompatFlags
Definition: ntuser.h:290
DWORD_PTR WINAPI SetSysColorsTemp(const COLORREF *pPens, const HBRUSH *pBrushes, DWORD_PTR n)
Definition: stubs.c:151
GLbitfield flags
Definition: glext.h:7161
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOL WINAPI IsSETEnabled(VOID)
Definition: stubs.c:529
BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
Definition: stubs.c:272
VOID WINAPI RegisterSystemThread(DWORD flags, DWORD reserved)
Definition: stubs.c:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT WINAPI DECLSPEC_HOTPATCH GetRegisteredRawInputDevices(PRAWINPUTDEVICE pRawInputDevices, PUINT puiNumDevices, UINT cbSize)
Definition: stubs.c:349
static _In_ DWORD dwflags
Definition: dispmode.c:64
UINT_PTR HKL
Definition: msctf.idl:101
uint32_t DWORD_PTR
Definition: typedefs.h:63
WORD WINAPI InitializeWin32EntryTable(UCHAR *EntryTablePlus0x1000)
Definition: stubs.c:429
BOOL WINAPI DisplayExitWindowsWarnings(ULONG flags)
Definition: stubs.c:376
static HDC hDC
Definition: 3dtext.c:33
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(PCRAWINPUTDEVICE pRawInputDevices, UINT uiNumDevices, UINT cbSize)
Definition: stubs.c:364
HDESK WINAPI GetInputDesktop(VOID)
Definition: stubs.c:203
uint32_t * LPDWORD
Definition: typedefs.h:57
UINT WINAPI UserRealizePalette(HDC hDC)
Definition: stubs.c:106
unsigned int ULONG
Definition: retypes.h:1
UINT WINAPI GetRawInputDeviceList(PRAWINPUTDEVICELIST pRawInputDeviceList, PUINT puiNumDevices, UINT cbSize)
Definition: stubs.c:329
VOID WINAPI ShowStartGlass(DWORD unknown)
Definition: stubs.c:464
HKL WINAPI LoadKeyboardLayoutEx(DWORD unknown, LPCWSTR pwszKLID, UINT Flags)
Definition: stubs.c:447
BOOL WINAPI GetAccCursorInfo(PCURSORINFO pci)
Definition: stubs.c:214
GLfloat GLfloat p
Definition: glext.h:8902
DWORD WINAPI GetAppCompatFlags2(HTASK hTask)
Definition: stubs.c:63
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
LONG_PTR LRESULT
Definition: windef.h:209
#define memset(x, y, z)
Definition: compat.h:39
EXTINLINE UINT NtUserxRealizePalette(HDC hDC)
Definition: ntwrapper.h:641
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
int(* FARPROC)()
Definition: compat.h:28
unsigned int * PUINT
Definition: ndis.h:50
UINT WINAPI GetRawInputData(HRAWINPUT hRawInput, UINT uiCommand, LPVOID pData, PUINT pcbSize, UINT cbSizeHeader)
Definition: stubs.c:313