Author: jgardou
Date: Wed Jul 14 14:56:53 2010
New Revision: 48039
URL:
http://svn.reactos.org/svn/reactos?rev=48039&view=rev
Log:
[W32KNAPI]
- Test ONE_PARAM_ROUTINE_CREATEEMPTYCUROBJECT
- Test NtUserGetIconInfo
Added:
trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c (with props)
Modified:
trunk/rostests/apitests/w32knapi/ntuser/NtUserCallOneParam.c
trunk/rostests/apitests/w32knapi/osver.c
trunk/rostests/apitests/w32knapi/testlist.c
trunk/rostests/apitests/w32knapi/w32knapi.h
Modified: trunk/rostests/apitests/w32knapi/ntuser/NtUserCallOneParam.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntuser/NtUserCallOneParam.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/ntuser/NtUserCallOneParam.c [iso-8859-1] Wed Jul 14
14:56:53 2010
@@ -21,6 +21,26 @@
TEST(hWnd != 0);
TEST(IsWindow(hWnd));
TEST(hWnd == GetDesktopWindow());
+
+ 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;
}
@@ -66,6 +86,7 @@
{
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 */
Added: trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c (added)
+++ trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c [iso-8859-1] Wed Jul 14
14:56:53 2010
@@ -1,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;
+}
Propchange: trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/w32knapi/osver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/osver.c…
==============================================================================
--- trunk/rostests/apitests/w32knapi/osver.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/osver.c [iso-8859-1] Wed Jul 14 14:56:53 2010
@@ -6,6 +6,7 @@
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};
Modified: trunk/rostests/apitests/w32knapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/testlis…
==============================================================================
--- trunk/rostests/apitests/w32knapi/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/testlist.c [iso-8859-1] Wed Jul 14 14:56:53 2010
@@ -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 @@
{ 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 },
Modified: trunk/rostests/apitests/w32knapi/w32knapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/w32knap…
==============================================================================
--- trunk/rostests/apitests/w32knapi/w32knapi.h [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/w32knapi.h [iso-8859-1] Wed Jul 14 14:56:53 2010
@@ -47,6 +47,7 @@
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 @@
#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]