mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[W32KNAPI]
- Test ONE_PARAM_ROUTINE_CREATEEMPTYCUROBJECT - Test NtUserGetIconInfo svn path=/trunk/; revision=48039
This commit is contained in:
parent
f4769202d7
commit
8ad729230c
5 changed files with 88 additions and 0 deletions
|
@ -25,6 +25,26 @@ Test_OneParamRoutine_WindowFromDC(PTESTINFO pti) /* 0x1f */
|
|||
return APISTATUS_NORMAL;
|
||||
}
|
||||
|
||||
INT
|
||||
Test_OneParamRoutine_CreateEmptyCurObject(PTESTINFO pti) /* XP/2k3 : 0x21, vista 0x25 */
|
||||
{
|
||||
HICON hIcon ;
|
||||
|
||||
/* Test 0 */
|
||||
hIcon = (HICON) NtUserCallOneParam(0, _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT);
|
||||
TEST(hIcon != NULL);
|
||||
|
||||
TEST(NtUserDestroyCursor(hIcon, 0) == TRUE);
|
||||
|
||||
/* Test Garbage */
|
||||
hIcon = (HICON) NtUserCallOneParam(0xdeadbeef, _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT);
|
||||
TEST(hIcon != NULL);
|
||||
|
||||
TEST(NtUserDestroyCursor(hIcon, 0xbaadf00d) == TRUE);
|
||||
|
||||
return APISTATUS_NORMAL;
|
||||
}
|
||||
|
||||
INT
|
||||
Test_OneParamRoutine_MapDesktopObject(PTESTINFO pti) /* 0x30 */
|
||||
{
|
||||
|
@ -66,6 +86,7 @@ Test_NtUserCallOneParam(PTESTINFO pti)
|
|||
{
|
||||
Test_OneParamRoutine_BeginDeferWindowPos(pti); /* 0x1e */
|
||||
Test_OneParamRoutine_WindowFromDC(pti); /* 0x1f */
|
||||
Test_OneParamRoutine_CreateEmptyCurObject(pti); /* XP/2k3 : 0x21, vista 0x25 */
|
||||
Test_OneParamRoutine_MapDesktopObject(pti); /* 0x30 */
|
||||
|
||||
Test_OneParamRoutine_SwapMouseButtons(pti); /* 0x42 */
|
||||
|
|
62
rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c
Normal file
62
rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
INT
|
||||
Test_NtUserGetIconInfo(PTESTINFO pti)
|
||||
{
|
||||
HICON hIcon;
|
||||
ICONINFO iinfo;
|
||||
HBITMAP mask, color;
|
||||
|
||||
ZeroMemory(&iinfo, sizeof(ICONINFO));
|
||||
|
||||
/* BASIC TESTS */
|
||||
hIcon = (HICON) NtUserCallOneParam(0, _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT);
|
||||
TEST(hIcon != NULL);
|
||||
|
||||
/* Last param is unknown */
|
||||
TEST(NtUserGetIconInfo(hIcon, &iinfo, NULL, NULL, NULL, FALSE) == FALSE);
|
||||
TEST(NtUserGetIconInfo(hIcon, &iinfo, NULL, NULL, NULL, TRUE) == FALSE);
|
||||
|
||||
TEST(NtUserDestroyCursor(hIcon, 0) == TRUE);
|
||||
|
||||
mask = CreateBitmap(16,16,1,1,NULL);
|
||||
color = CreateBitmap(16,16,1,16,NULL);
|
||||
|
||||
iinfo.hbmMask = mask;
|
||||
iinfo.hbmColor = color ;
|
||||
iinfo.fIcon = TRUE;
|
||||
iinfo.xHotspot = 8;
|
||||
iinfo.yHotspot = 8;
|
||||
|
||||
hIcon = CreateIconIndirect(&iinfo);
|
||||
TEST(hIcon!=NULL);
|
||||
|
||||
// TODO : test last parameter...
|
||||
TEST(NtUserGetIconInfo(hIcon, &iinfo, NULL, NULL, NULL, FALSE) == TRUE);
|
||||
|
||||
TEST(iinfo.hbmMask != NULL);
|
||||
TEST(iinfo.hbmColor != NULL);
|
||||
TEST(iinfo.fIcon == TRUE);
|
||||
TEST(iinfo.yHotspot == 8);
|
||||
TEST(iinfo.xHotspot == 8);
|
||||
|
||||
TEST(iinfo.hbmMask != mask);
|
||||
TEST(iinfo.hbmColor != color);
|
||||
|
||||
/* Does it make a difference? */
|
||||
TEST(NtUserGetIconInfo(hIcon, &iinfo, NULL, NULL, NULL, TRUE) == TRUE);
|
||||
|
||||
TEST(iinfo.hbmMask != NULL);
|
||||
TEST(iinfo.hbmColor != NULL);
|
||||
TEST(iinfo.fIcon == TRUE);
|
||||
TEST(iinfo.yHotspot == 8);
|
||||
TEST(iinfo.xHotspot == 8);
|
||||
|
||||
TEST(iinfo.hbmMask != mask);
|
||||
TEST(iinfo.hbmColor != color);
|
||||
|
||||
DeleteObject(mask);
|
||||
DeleteObject(color);
|
||||
|
||||
DestroyIcon(hIcon);
|
||||
|
||||
return APISTATUS_NORMAL;
|
||||
}
|
|
@ -6,6 +6,7 @@ UINT g_OsIdx;
|
|||
ASPI gNOPARAM_ROUTINE_CREATEMENU = {-1,-1,0x00,-1,0x00};
|
||||
ASPI gNOPARAM_ROUTINE_CREATEMENUPOPUP = {-1,-1,0x01,-1,0x01};
|
||||
ASPI gNOPARAM_ROUTINE_LOADUSERAPIHOOK = {-1,-1,0x1d,-1,0x0e};
|
||||
ASPI gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT = {-1, -1, 0x21, 0x21, 0x25};
|
||||
ASPI gONEPARAM_ROUTINE_MAPDEKTOPOBJECT = {-1,-1,0x30,-1,0x31};
|
||||
ASPI gONEPARAM_ROUTINE_SWAPMOUSEBUTTON = {-1,-1,0x42,-1,0x44};
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "ntuser/NtUserEnumDisplaySettings.c"
|
||||
#include "ntuser/NtUserFindExistingCursorIcon.c"
|
||||
#include "ntuser/NtUserGetClassInfo.c"
|
||||
#include "ntuser/NtUserGetIconInfo.c"
|
||||
#include "ntuser/NtUserGetTitleBarInfo.c"
|
||||
#include "ntuser/NtUserProcessConnect.c"
|
||||
#include "ntuser/NtUserRedrawWindow.c"
|
||||
|
@ -114,6 +115,7 @@ TESTENTRY TestList[] =
|
|||
{ L"NtUserEnumDisplaySettings", TEST_NtUserEnumDisplaySettings },
|
||||
{ L"NtUserFindExistingCursorIcon", Test_NtUserFindExistingCursoricon },
|
||||
{ L"NtUserGetClassInfo", Test_NtUserGetClassInfo },
|
||||
{ L"NtUserGetIconInfo", Test_NtUserGetIconInfo },
|
||||
{ L"NtUserGetTitleBarInfo", Test_NtUserGetTitleBarInfo },
|
||||
{ L"NtUserProcessConnect", Test_NtUserProcessConnect },
|
||||
{ L"NtUserRedrawWindow", Test_NtUserRedrawWindow },
|
||||
|
|
|
@ -47,6 +47,7 @@ typedef UINT ASPI[5];
|
|||
extern ASPI gNOPARAM_ROUTINE_CREATEMENU;
|
||||
extern ASPI gNOPARAM_ROUTINE_CREATEMENUPOPUP;
|
||||
extern ASPI gNOPARAM_ROUTINE_LOADUSERAPIHOOK;
|
||||
extern ASPI gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT;
|
||||
extern ASPI gONEPARAM_ROUTINE_MAPDEKTOPOBJECT;
|
||||
extern ASPI gONEPARAM_ROUTINE_SWAPMOUSEBUTTON;
|
||||
extern ASPI gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW;
|
||||
|
@ -56,6 +57,7 @@ extern ASPI gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID;
|
|||
#define _NOPARAM_ROUTINE_CREATEMENU gNOPARAM_ROUTINE_CREATEMENU[g_OsIdx]
|
||||
#define _NOPARAM_ROUTINE_CREATEMENUPOPUP gNOPARAM_ROUTINE_CREATEMENUPOPUP[g_OsIdx]
|
||||
#define _NOPARAM_ROUTINE_LOADUSERAPIHOOK gNOPARAM_ROUTINE_LOADUSERAPIHOOK[g_OsIdx]
|
||||
#define _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT[g_OsIdx]
|
||||
#define _ONEPARAM_ROUTINE_MAPDEKTOPOBJECT gONEPARAM_ROUTINE_MAPDEKTOPOBJECT[g_OsIdx]
|
||||
#define _ONEPARAM_ROUTINE_SWAPMOUSEBUTTON gONEPARAM_ROUTINE_SWAPMOUSEBUTTON[g_OsIdx]
|
||||
#define _HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW[g_OsIdx]
|
||||
|
|
Loading…
Reference in a new issue