[ros-diffs] [jgardou] 48103: [W32KNAPI] - Add some more NtUserGetIconInfo tests

jgardou at svn.reactos.org jgardou at svn.reactos.org
Sun Jul 18 16:34:16 UTC 2010


Author: jgardou
Date: Sun Jul 18 16:34:14 2010
New Revision: 48103

URL: http://svn.reactos.org/svn/reactos?rev=48103&view=rev
Log:
[W32KNAPI]  - Add some more NtUserGetIconInfo tests

Modified:
    trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c

Modified: trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c?rev=48103&r1=48102&r2=48103&view=diff
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c [iso-8859-1] Sun Jul 18 16:34:14 2010
@@ -4,6 +4,9 @@
 	HICON hIcon;
 	ICONINFO iinfo;
 	HBITMAP mask, color;
+	UNICODE_STRING hInstStr;
+	UNICODE_STRING ResourceStr;
+	DWORD bpp = 0;
 
 	ZeroMemory(&iinfo, sizeof(ICONINFO));
 
@@ -58,5 +61,43 @@
 
 	DestroyIcon(hIcon);
 
+	/* Test full param, with local icon */
+	hIcon = LoadImageA(GetModuleHandle(NULL),
+					   MAKEINTRESOURCE(IDI_ICON),
+					   IMAGE_ICON,
+					   0,
+					   0,
+					   LR_DEFAULTSIZE);
+
+	TEST(hIcon != NULL);
+
+	RtlInitUnicodeString(&hInstStr, NULL);
+	RtlInitUnicodeString(&ResourceStr, NULL);
+
+	TEST(NtUserGetIconInfo(hIcon,
+						   &iinfo,
+						   &hInstStr,
+						   &ResourceStr,
+						   &bpp,
+						   FALSE) == TRUE);
+	
+	TESTX(hInstStr.Buffer == NULL, "hInstStr.buffer : %p\n", hInstStr.Buffer);
+	TEST((LPCTSTR)ResourceStr.Buffer == MAKEINTRESOURCE(IDI_ICON));
+	TEST(bpp == 32);
+
+	/* Last param doesn't seem to matter*/
+	TEST(NtUserGetIconInfo(hIcon,
+						   &iinfo,
+						   &hInstStr,
+						   &ResourceStr,
+						   &bpp,
+						   TRUE) == TRUE);
+
+	TESTX(hInstStr.Buffer == NULL, "hInstStr.buffer : %p\n", hInstStr.Buffer);
+	TEST((LPCTSTR)ResourceStr.Buffer == MAKEINTRESOURCE(IDI_ICON));
+	TEST(bpp == 32);
+
+	DestroyIcon(hIcon);
+
 	return APISTATUS_NORMAL;
 }




More information about the Ros-diffs mailing list