From: Jérôme Gardou Date: Sun, 18 Jul 2010 16:57:32 +0000 (+0000) Subject: [W32KNAPI] - More tests to NtUserGetIconInfo X-Git-Tag: backups/Ash_Shell@48412~1^2~192 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=a6017cd9b2f5a39d7befd81b791c95ba0a4191c1 [W32KNAPI] - More tests to NtUserGetIconInfo svn path=/trunk/; revision=48106 --- diff --git a/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c b/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c index 4c976cbc20a..2b4fd81a7f5 100644 --- a/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c +++ b/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c @@ -99,5 +99,51 @@ Test_NtUserGetIconInfo(PTESTINFO pti) DestroyIcon(hIcon); + /* Test full param, with foreign icon */ + hIcon = LoadImageA(GetModuleHandleA("shell32.dll"), + MAKEINTRESOURCE(293), + 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(hInstStr.Length == 0); + TEST(hInstStr.MaximumLength == 0); + TEST((LPCTSTR)ResourceStr.Buffer == MAKEINTRESOURCE(293)); + TEST(ResourceStr.Length == 0); + TEST(ResourceStr.MaximumLength == 0); + TEST(bpp == 32); + + RtlInitUnicodeString(&hInstStr, NULL); + RtlInitUnicodeString(&ResourceStr, NULL); + + TEST(NtUserGetIconInfo(hIcon, + &iinfo, + &hInstStr, + &ResourceStr, + &bpp, + TRUE) == TRUE); + + TESTX(hInstStr.Buffer == NULL, "hInstStr.buffer : %p\n", hInstStr.Buffer); + TEST(hInstStr.Length == 0); + TEST(hInstStr.MaximumLength == 0); + TEST((LPCTSTR)ResourceStr.Buffer == MAKEINTRESOURCE(293)); + TEST(bpp == 32); + + DestroyIcon(hIcon); + return APISTATUS_NORMAL; } \ No newline at end of file