ReactOS 0.4.17-dev-1422-g6299811
PrivateExtractIcons.c File Reference
#include "precomp.h"
#include <stdio.h>
#include <versionhelpers.h>
Include dependency graph for PrivateExtractIcons.c:

Go to the source code of this file.

Classes

struct  tagPAIRSTESTS
 

Functions

static int MyAbs (int v)
 
static void SafeDestroyIcon (HICON *ph)
 
BOOL IsValidIcon (HICON hIco)
 
static void * GetDiBitsAlloc (HBITMAP hBM, UINT Width, UINT Height, UINT BitsPerPixel)
 
static DWORD * GetIconMaskData32 (HICON hIco)
 
BOOL FileExists (PCWSTR FileName)
 
BOOL ResourceToFile (INT i, PCWSTR FileName)
 
void TestPairExtraction (void)
 
void TestBigSmallPairExtraction (void)
 
 START_TEST (PrivateExtractIcons)
 

Variables

struct {
   PCWSTR   FilePath
 
   UINT   cIcons
 
   UINT   cTotalIcons
 
   BOOL   bhIconValid
 
} IconTests []
 
struct {
   PCWSTR   FileName
 
   INT   ResourceId
 
} IconFiles []
 
static const struct tagPAIRSTESTS g_pairs []
 

Function Documentation

◆ FileExists()

BOOL FileExists ( PCWSTR  FileName)

Definition at line 67 of file PrivateExtractIcons.c.

68{
70
71 return (Attribute != INVALID_FILE_ATTRIBUTES &&
72 !(Attribute & FILE_ATTRIBUTE_DIRECTORY));
73}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by ResourceToFile().

◆ GetDiBitsAlloc()

static void * GetDiBitsAlloc ( HBITMAP  hBM,
UINT  Width,
UINT  Height,
UINT  BitsPerPixel 
)
static

Definition at line 40 of file PrivateExtractIcons.c.

41{
42 SIZE_T size = Width * MyAbs(Height) * 4;
44 BITMAPINFO bmi = { { sizeof(bmi.bmiHeader), Width, Height, 1, BitsPerPixel } };
45 HDC hdc = GetDC(0);
46 if (pData)
47 GetDIBits(hdc, hBM, 0, MyAbs(Height), pData, &bmi, DIB_RGB_COLORS);
49 return pData;
50}
static int MyAbs(int v)
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT _Out_ UINT * Height
Definition: dispmprt.h:1445
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT * Width
Definition: dispmprt.h:1444
#define NULL
Definition: types.h:112
GLsizeiptr size
Definition: glext.h:5919
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
#define LMEM_FIXED
Definition: minwinbase.h:81
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1922
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define DIB_RGB_COLORS
Definition: wingdi.h:367
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)

Referenced by GetIconMaskData32().

◆ GetIconMaskData32()

static DWORD * GetIconMaskData32 ( HICON  hIco)
static

Definition at line 52 of file PrivateExtractIcons.c.

53{
54 void *pData = NULL;
55 ICONINFO info = { 0 };
56 BITMAP bm;
57 if (!hIco || !GetIconInfo(hIco, &info))
58 return NULL;
59 if (GetObjectW(info.hbmMask, sizeof(bm), &bm))
60 pData = GetDiBitsAlloc(info.hbmMask, bm.bmWidth, bm.bmHeight, 32);
61 DeleteObject(info.hbmMask);
62 if (info.hbmColor)
63 DeleteObject(info.hbmColor);
64 return (DWORD*)pData;
65}
static void * GetDiBitsAlloc(HBITMAP hBM, UINT Width, UINT Height, UINT BitsPerPixel)
pKey DeleteObject()
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2414
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)

Referenced by TestBigSmallPairExtraction().

◆ IsValidIcon()

BOOL IsValidIcon ( HICON  hIco)

Definition at line 27 of file PrivateExtractIcons.c.

28{
29 ICONINFO info = { 0 };
30
31 if (!hIco || !GetIconInfo(hIco, &info))
32 return FALSE;
33
34 DeleteObject(info.hbmMask);
35 if (info.hbmColor)
36 DeleteObject(info.hbmColor);
37 return TRUE;
38}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by TestBigSmallPairExtraction(), and TestPairExtraction().

◆ MyAbs()

static int MyAbs ( int  v)
static

Definition at line 13 of file PrivateExtractIcons.c.

14{
15 return v < 0 ? -v : v;
16}
const GLdouble * v
Definition: gl.h:2040

Referenced by GetDiBitsAlloc().

◆ ResourceToFile()

BOOL ResourceToFile ( INT  i,
PCWSTR  FileName 
)

Definition at line 75 of file PrivateExtractIcons.c.

76{
77 FILE *fout;
78 HGLOBAL hData;
79 HRSRC hRes;
80 PVOID pResLock;
81 UINT iSize;
82
84 {
85 /* We should only be using %temp% paths, so deleting here should be OK */
86 printf("Deleting '%S' that already exists.\n", FileName);
88 }
89
91 if (hRes == NULL)
92 {
93 skip("Could not locate resource (%d). Exiting now\n", i);
94 return FALSE;
95 }
96
97 iSize = SizeofResource(NULL, hRes);
98
99 hData = LoadResource(NULL, hRes);
100 if (hData == NULL)
101 {
102 skip("Could not load resource (%d). Exiting now\n", i);
103 return FALSE;
104 }
105
106 // Lock the resource into global memory.
107 pResLock = LockResource(hData);
108 if (pResLock == NULL)
109 {
110 skip("Could not lock resource (%d). Exiting now\n", i);
111 return FALSE;
112 }
113
114 fout = _wfopen(FileName, L"wb");
115 fwrite(pResLock, iSize, 1, fout);
116 fclose(fout);
117 return TRUE;
118}
BOOL FileExists(PCWSTR FileName)
#define skip(...)
Definition: atltest.h:64
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
int CDECL fclose(FILE *file)
Definition: file.c:3757
FILE *CDECL _wfopen(const wchar_t *path, const wchar_t *mode)
Definition: file.c:4335
size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE *file)
Definition: file.c:4129
#define L(x)
Definition: resources.c:13
#define printf
Definition: freeldr.h:103
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
unsigned int UINT
Definition: sysinfo.c:13
#define RT_RCDATA
Definition: pedump.c:372
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by START_TEST(), and TestBigSmallPairExtraction().

◆ SafeDestroyIcon()

static void SafeDestroyIcon ( HICON *  ph)
static

Definition at line 18 of file PrivateExtractIcons.c.

19{
20 if (ph && *ph)
21 {
22 DestroyIcon(*ph);
23 *ph = NULL;
24 }
25}
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422

Referenced by TestBigSmallPairExtraction().

◆ START_TEST()

START_TEST ( PrivateExtractIcons  )

Definition at line 171 of file PrivateExtractIcons.c.

172{
173 HICON ahIcon;
174 UINT i, aIconId, cIcons, cIcoTotal;
175 WCHAR PathBuffer[MAX_PATH];
176 UINT Shell32WinIcoCount = IsWindowsVistaOrGreater() ? 326 : 239; /* 239 on W2K3SP2, 326 on Win10 */
177
178 /* Extract icons */
179 for (i = 0; i < _countof(IconFiles); ++i)
180 {
181 ExpandEnvironmentStringsW(IconFiles[i].FileName, PathBuffer, _countof(PathBuffer));
182
183 if (!ResourceToFile(IconFiles[i].ResourceId, PathBuffer))
184 goto Cleanup;
185 }
186
189
190 for (i = 0; i < _countof(IconTests); ++i)
191 {
192 /* Get total number of icon groups in file.
193 * None of the hard numbers in the function matter since we have
194 * two NULLs for the Icon Handle and Count to be set. */
195 cIcoTotal = PrivateExtractIconsW(IconTests[i].FilePath, 0, 16, 16, NULL, NULL, 0, 0);
196 ok((i == 3 ?
197 cIcoTotal > 232 && cIcoTotal <= Shell32WinIcoCount : /* shell32 case: ROS has 233, Windows has >= 239 icon groups. */
198 cIcoTotal == IconTests[i].cTotalIcons),
199 "PrivateExtractIconsW(%u): "
200 "got %u, expected %u\n", i, cIcoTotal, IconTests[i].cTotalIcons);
201
202 /* Always test extraction of the FIRST icon (index 0) */
203 ahIcon = (HICON)UlongToHandle(0xdeadbeef);
204 aIconId = 0xdeadbeef;
205 cIcons = PrivateExtractIconsW(IconTests[i].FilePath, 0, 16, 16, &ahIcon, &aIconId, 1, 0);
206 ok(cIcons == IconTests[i].cIcons, "PrivateExtractIconsW(%u): got %u, expected %u\n", i, cIcons, IconTests[i].cIcons);
207 ok(ahIcon != (HICON)UlongToHandle(0xdeadbeef), "PrivateExtractIconsW(%u): icon not set\n", i);
208 ok((IconTests[i].bhIconValid && ahIcon) || (!IconTests[i].bhIconValid && !ahIcon),
209 "PrivateExtractIconsW(%u): icon expected to be %s, but got 0x%p\n",
210 i, IconTests[i].bhIconValid ? "valid" : "not valid", ahIcon);
211 if (cIcons == 0xFFFFFFFF)
212 {
213 ok(aIconId == 0xdeadbeef,
214 "PrivateExtractIconsW(%u): id should not be set to 0x%x\n",
215 i, aIconId);
216 }
217 else
218 {
219 ok(aIconId != 0xdeadbeef, "PrivateExtractIconsW(%u): id not set\n", i);
220 }
221 if (ahIcon && ahIcon != (HICON)UlongToHandle(0xdeadbeef))
222 DestroyIcon(ahIcon);
223 }
224
225Cleanup:
226 for (i = 0; i < _countof(IconFiles); ++i)
227 {
228 ExpandEnvironmentStringsW(IconFiles[i].FileName, PathBuffer, _countof(PathBuffer));
229 DeleteFileW(PathBuffer);
230 }
231}
BOOL bhIconValid
void TestBigSmallPairExtraction(void)
static struct @1861 IconTests[]
INT ResourceId
PCWSTR FilePath
BOOL ResourceToFile(INT i, PCWSTR FileName)
static struct @1862 IconFiles[]
void TestPairExtraction(void)
UINT cIcons
#define ok(value,...)
Definition: atltest.h:57
#define UlongToHandle(ul)
Definition: basetsd.h:91
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
static const WCHAR Cleanup[]
Definition: register.c:80
GLsizei GLuint * groups
Definition: glext.h:11113
static HICON
Definition: imagelist.c:80
short WCHAR
Definition: pedump.c:58
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)
#define _countof(array)
Definition: sndvol32.h:70
VERSIONHELPERAPI IsWindowsVistaOrGreater()

◆ TestBigSmallPairExtraction()

void TestBigSmallPairExtraction ( void  )

Definition at line 297 of file PrivateExtractIcons.c.

298{
299 HICON hIcons[4] = { NULL };
300 int RetVal;
301 DWORD *pData;
303
305 RetVal = PrivateExtractIconsW(path, -IDI_3216, MAKELONG(32, 16), MAKELONG(32, 16), hIcons, NULL, 2, 0);
306 ok(RetVal == 2, "Extract two icon images\n");
307 ok(IsValidIcon(hIcons[0]), "32\n");
308 ok(IsValidIcon(hIcons[1]), "16\n");
309 ok(!hIcons[2] && !hIcons[3], "Not requested\n");
310 RetVal = (pData = GetIconMaskData32(hIcons[0])) != NULL && pData[0] == 0; // The 32px source icon has an opaque 1px frame border
312 ok(RetVal, "Correct 32px icon image\n");
313 RetVal = (pData = GetIconMaskData32(hIcons[1])) != NULL && pData[0] != 0; // The 16px source icon has no frame (transparent)
315 ok(RetVal, "Correct 16px icon image\n"); // [CORE-20060] The 2nd icon should not just be a resized version of the first
316 SafeDestroyIcon(&hIcons[0]);
317 SafeDestroyIcon(&hIcons[1]);
318
319 // Extract 4 icon images from the first two icons (this assumes IDI_3216 is the 2nd icon in the PE)
320 RetVal = PrivateExtractIconsW(path, 0, MAKELONG(32, 16), MAKELONG(32, 16), hIcons, NULL, 4, 0);
321 ok(RetVal == 4, "Extract four icon images\n");
322 ok(IsValidIcon(hIcons[0]), "32\n");
323 ok(IsValidIcon(hIcons[1]), "16\n");
324 RetVal = (pData = GetIconMaskData32(hIcons[2])) != NULL && pData[0] == 0; // The 32px source icon has an opaque 1px frame border
326 ok(RetVal, "Correct 32px icon image\n");
327 RetVal = (pData = GetIconMaskData32(hIcons[3])) != NULL && pData[0] != 0; // The 16px source icon has no frame (transparent)
329 ok(RetVal, "Correct 16px icon image\n"); // [CORE-20060] The 2nd icon should not just be a resized version of the first
330 SafeDestroyIcon(&hIcons[0]);
331 SafeDestroyIcon(&hIcons[1]);
332 SafeDestroyIcon(&hIcons[2]);
333 SafeDestroyIcon(&hIcons[3]);
334
335 ExpandEnvironmentStringsW(L"%temp%\\ROS_USER32.ico", path, _countof(path));
337 {
338 skip("ResourceToFile failed\n");
339 return;
340 }
341 RetVal = PrivateExtractIconsW(path, 0, MAKELONG(32, 16), MAKELONG(32, 16), hIcons, NULL, 2, 0);
343 ok(RetVal == 1, "Extract two icon images but a .ico only has one icon\n"); // Strange but true
344 ok(IsValidIcon(hIcons[0]), "32\n");
345 ok(IsValidIcon(hIcons[1]), "16\n");
346 RetVal = (pData = GetIconMaskData32(hIcons[0])) != NULL && pData[0] == 0; // The 32px source icon has an opaque 1px frame border
348 ok(RetVal, "Correct 32px icon image\n");
349 RetVal = (pData = GetIconMaskData32(hIcons[1])) != NULL && pData[0] != 0; // The 16px source icon has no frame (transparent)
351 ok(RetVal, "Correct 16px icon image\n"); // [CORE-20060] The 2nd icon should not just be a resized version of the first
352 SafeDestroyIcon(&hIcons[0]);
353 SafeDestroyIcon(&hIcons[1]);
354}
BOOL IsValidIcon(HICON hIco)
static void SafeDestroyIcon(HICON *ph)
static DWORD * GetIconMaskData32(HICON hIco)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define IDI_3216
Definition: resource.h:3
#define IDR_ICONS_3216
Definition: resource.h:9
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by START_TEST().

◆ TestPairExtraction()

void TestPairExtraction ( void  )

Definition at line 266 of file PrivateExtractIcons.c.

267{
268 const HICON hInvalidIcon = (HICON)(INT_PTR)-2;
269 const BOOL IsNT6 = IsWindowsVistaOrGreater();
270 for (UINT i = 0; i < _countof(g_pairs); ++i)
271 {
272 UINT j, Count, ExpectedCount;
273 int RetVal, ExpectedRet;
274 UINT IcoSize = MAKELONG(32, g_pairs[i].UseHigh ? 16 : 0);
275 PCWSTR pszPath = g_pairs[i].Library ? L"%SystemRoot%\\system32\\shell32.dll" : L"%temp%\\sysicon.ico";
276 HICON hIcons[8];
277 for (j = 0; j < _countof(hIcons); ++j)
278 hIcons[j] = hInvalidIcon;
279
280 RetVal = PrivateExtractIconsW(pszPath, 0, IcoSize, IcoSize, hIcons, NULL, g_pairs[i].InCount, 0);
281 for (j = 0, Count = 0; j < _countof(hIcons); ++j)
282 {
283 if (hIcons[j] != hInvalidIcon && IsValidIcon(hIcons[j]))
284 {
285 DestroyIcon(hIcons[j]);
286 ++Count;
287 }
288 }
289
290 ExpectedRet = !IsNT6 ? g_pairs[i].ReturnNT5 : g_pairs[i].ReturnNT6;
291 ExpectedCount = !IsNT6 ? g_pairs[i].CountNT5 : g_pairs[i].CountNT6;
292 ok(RetVal == ExpectedRet, "Test %u: RetVal must be %d but got %d\n", i, ExpectedRet, RetVal);
293 ok(Count == ExpectedCount, "Test %u: Count must be %u but got %u\n", i, ExpectedCount, Count);
294 }
295}
static const struct tagPAIRSTESTS g_pairs[]
unsigned int BOOL
Definition: ntddk_ex.h:94
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 GLint GLint j
Definition: glfuncs.h:250
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
USHORT Count
Definition: userreq.cpp:200

Referenced by START_TEST().

Variable Documentation

◆ bhIconValid

BOOL bhIconValid

Definition at line 125 of file PrivateExtractIcons.c.

Referenced by START_TEST().

◆ cIcons

UINT cIcons

Definition at line 123 of file PrivateExtractIcons.c.

Referenced by START_TEST(), and test_PrivateExtractIcons().

◆ cTotalIcons

UINT cTotalIcons

Definition at line 124 of file PrivateExtractIcons.c.

◆ FileName

Definition at line 159 of file PrivateExtractIcons.c.

◆ FilePath

◆ g_pairs

const struct tagPAIRSTESTS g_pairs[]
static
Initial value:
=
{
{ 0, 0, 0, 1, 1, 1, 1 },
{ 0, 0, 1, 0, 0, 0, 0 },
{ 0, 1, 0, 1, 2, 1, 2 },
{ 0, 1, 1, 0, 0, 0, 0 },
{ 1, 0, 0, 1, 1, 1, 1 },
{ 1, 0, 1, 1, 1, 1, 1 },
{ 1, 1, 0, 1, 2, 1, 2 },
{ 1, 1, 1, 2, 2, 0, 0 },
{ 2, 0, 0, 1, 1, 1, 1 },
{ 2, 0, 1, 2, 2, 2, 2 },
{ 2, 1, 0, 1, 2, 1, 2 },
{ 2, 1, 1, 2, 2, 2, 2 },
{ 3, 0, 0, 1, 1, 1, 1 },
{ 3, 0, 1, 3, 3, 3, 3 },
{ 3, 1, 0, 1, 2, 1, 2 },
{ 3, 1, 1, 4, 4, 0, 0 },
{ 4, 0, 0, 1, 1, 1, 1 },
{ 4, 0, 1, 4, 4, 4, 4 },
{ 4, 1, 0, 1, 2, 1, 2 },
{ 4, 1, 1, 4, 4, 4, 4 }
}

Referenced by TestPairExtraction().

◆ 

struct { ... } IconFiles[]
Initial value:
=
{
{L"%temp%\\ROS.ico", IDR_ICONS_PNG},
{L"%temp%\\sysicon.ico", IDR_ICONS_NORMAL},
{L"%temp%\\cpimg2e.exe", IDR_EXE_NORMAL}
}
#define IDR_ICONS_NORMAL
Definition: resource.h:6
#define IDR_ICONS_PNG
Definition: resource.h:5
#define IDR_EXE_NORMAL
Definition: resource.h:7

Referenced by START_TEST().

◆ 

struct { ... } IconTests[]
Initial value:
=
{
{L"notepad.exe", 1, 1, TRUE},
{L"%SystemRoot%\\System32\\cmd.exe", 1, 1, TRUE},
{L"%SystemRoot%\\System32\\autochk.exe", 0, 0, FALSE},
{L"%SystemRoot%\\System32\\shell32.dll", 1, 233, TRUE},
{L"%SystemRoot%\\non-existent-file.sdf", 0xFFFFFFFF, 0, FALSE},
{L"%SystemRoot%\\explorer.exe", 1, 18, TRUE},
{L"%temp%\\sysicon.ico", 1, 1, TRUE},
{L"%temp%\\ROS.ico", 1, 1, TRUE},
{L"%temp%\\cpimg2e.exe", 1, 1, TRUE},
}

Referenced by START_TEST().

◆ ResourceId

INT ResourceId

Definition at line 160 of file PrivateExtractIcons.c.

Referenced by START_TEST().