From ec5e0ea56a18bc69d6676f0d7bf2ca744a4325d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Sun, 18 Jul 2010 16:34:14 +0000 Subject: [PATCH] [W32KNAPI] - Add some more NtUserGetIconInfo tests svn path=/trunk/; revision=48103 --- .../w32knapi/ntuser/NtUserGetIconInfo.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c b/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c index d0e1ec018a3..4c976cbc20a 100644 --- a/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c +++ b/rostests/apitests/w32knapi/ntuser/NtUserGetIconInfo.c @@ -4,6 +4,9 @@ Test_NtUserGetIconInfo(PTESTINFO pti) HICON hIcon; ICONINFO iinfo; HBITMAP mask, color; + UNICODE_STRING hInstStr; + UNICODE_STRING ResourceStr; + DWORD bpp = 0; ZeroMemory(&iinfo, sizeof(ICONINFO)); @@ -58,5 +61,43 @@ Test_NtUserGetIconInfo(PTESTINFO pti) 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; } \ No newline at end of file