ReactOS 0.4.15-dev-5875-g7c755d9
PrivateExtractIcons.c File Reference
#include "precomp.h"
Include dependency graph for PrivateExtractIcons.c:

Go to the source code of this file.

Functions

 START_TEST (PrivateExtractIcons)
 

Variables

struct {
   PCWSTR   FilePath
 
   UINT   cIcons
 
   BOOL   bhIconValid
 
IconTests []
 

Function Documentation

◆ START_TEST()

START_TEST ( PrivateExtractIcons  )

Definition at line 31 of file PrivateExtractIcons.c.

32{
33 HICON ahIcon;
34 UINT i, aIconId, cIcons;
35
36 for (i = 0; i < _countof(IconTests); ++i)
37 {
38 /* Always test extraction of the FIRST icon (index 0) */
39 ahIcon = (HICON)UlongToHandle(0xdeadbeef);
40 aIconId = 0xdeadbeef;
41 cIcons = PrivateExtractIconsW(IconTests[i].FilePath, 0, 16, 16, &ahIcon, &aIconId, 1, 0);
42 ok(cIcons == IconTests[i].cIcons, "PrivateExtractIconsW(%u): got %u, expected %u\n", i, cIcons, IconTests[i].cIcons);
43 ok(ahIcon != (HICON)UlongToHandle(0xdeadbeef), "PrivateExtractIconsW(%u): icon not set\n", i);
44 ok((IconTests[i].bhIconValid && ahIcon) || (!IconTests[i].bhIconValid && !ahIcon),
45 "PrivateExtractIconsW(%u): icon expected to be %s, but got 0x%p\n",
46 i, IconTests[i].bhIconValid ? "valid" : "not valid", ahIcon);
47 if (cIcons == 0xFFFFFFFF)
48 {
49 ok(aIconId == 0xdeadbeef, "PrivateExtractIconsW(%u): id should not be set\n", i);
50 }
51 else
52 {
53 ok(aIconId != 0xdeadbeef, "PrivateExtractIconsW(%u): id not set\n", i);
54 }
55 if (ahIcon && ahIcon != (HICON)UlongToHandle(0xdeadbeef))
56 DestroyIcon(ahIcon);
57 }
58}
static struct @1578 IconTests[]
BOOL bhIconValid
PCWSTR FilePath
UINT cIcons
#define ok(value,...)
Definition: atltest.h:57
#define UlongToHandle(ul)
Definition: basetsd.h:97
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HICON
Definition: imagelist.c:84
unsigned int UINT
Definition: ndis.h:50
#define _countof(array)
Definition: sndvol32.h:68
UINT WINAPI PrivateExtractIconsW(_In_reads_(MAX_PATH) LPCWSTR szFileName, _In_ int nIconIndex, _In_ int cxIcon, _In_ int cyIcon, _Out_writes_opt_(nIcons) HICON *phicon, _Out_writes_opt_(nIcons) UINT *piconid, _In_ UINT nIcons, _In_ UINT flags)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022

Variable Documentation

◆ bhIconValid

BOOL bhIconValid

Definition at line 14 of file PrivateExtractIcons.c.

Referenced by START_TEST().

◆ cIcons

UINT cIcons

Definition at line 13 of file PrivateExtractIcons.c.

Referenced by START_TEST(), and test_PrivateExtractIcons().

◆ FilePath

◆ 

struct { ... } IconTests[]
Initial value:
=
{
{L"notepad.exe", 1, TRUE},
{L"%SystemRoot%\\System32\\cmd.exe", 1, TRUE},
{L"%SystemRoot%\\System32\\autochk.exe", 0, FALSE},
{L"%SystemRoot%\\System32\\shell32.dll", 1, TRUE},
{L"%SystemRoot%\\non-existent-file.sdf", 0xFFFFFFFF, FALSE},
}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50

Referenced by START_TEST().