69{
70 struct decoder_info_test
71 {
73 const char *mimetype;
74 const char *extensions;
76 } decoder_info_tests[] =
77 {
78 {
79 &CLSID_WICBmpDecoder,
80 "image/bmp",
81 ".bmp,.dib,.rle"
82 },
83 {
84 &CLSID_WICGifDecoder,
85 "image/gif",
86 ".gif"
87 },
88 {
89 &CLSID_WICIcoDecoder,
90 "image/ico,image/x-icon",
91 ".ico,.icon",
92 1
93 },
94 {
95 &CLSID_WICJpegDecoder,
96 "image/jpeg,image/jpe,image/jpg",
97 ".jpeg,.jpe,.jpg,.jfif,.exif",
98 1
99 },
100 {
101 &CLSID_WICPngDecoder,
102 "image/png",
103 ".png"
104 },
105 {
106 &CLSID_WICTiffDecoder,
107 "image/tiff,image/tif",
108 ".tiff,.tif",
109 1
110 },
111 };
121
123 {
124 struct decoder_info_test *
test = &decoder_info_tests[
i];
126 WCHAR extensionsW[64];
128
131
133 hr = IWICBitmapDecoder_GetDecoderInfo(decoder, &decoder_info);
135 "%u: failed to get decoder info, hr %#x.\n",
i,
hr);
136
138 {
139 decoder_info2 =
NULL;
140 hr = IWICBitmapDecoder_GetDecoderInfo(decoder, &decoder_info2);
141 ok(
hr ==
S_OK,
"Failed to get decoder info, hr %#x.\n",
hr);
142 ok(decoder_info == decoder_info2,
"Unexpected decoder info instance.\n");
143
144 hr = IWICBitmapDecoderInfo_QueryInterface(decoder_info, &IID_IWICBitmapDecoder, (
void **)&decoder2);
146
147 IWICBitmapDecoderInfo_Release(decoder_info);
148 IWICBitmapDecoderInfo_Release(decoder_info2);
149 }
150 IWICBitmapDecoder_Release(decoder);
151
154
156 ok(
hr ==
S_OK,
"CreateComponentInfo failed, hr=%x\n",
hr);
157
158 hr = IWICComponentInfo_QueryInterface(
info, &IID_IWICBitmapDecoderInfo, (
void **)&decoder_info);
159 ok(
hr ==
S_OK,
"QueryInterface failed, hr=%x\n",
hr);
160
161 hr = IWICBitmapDecoderInfo_GetCLSID(decoder_info,
NULL);
163
164 hr = IWICBitmapDecoderInfo_GetCLSID(decoder_info, &
clsid);
165 ok(
hr ==
S_OK,
"GetCLSID failed, hr=%x\n",
hr);
167
168 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 0,
NULL,
NULL);
170
172 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 1,
NULL, &
len);
176
177 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info,
len,
value,
NULL);
179
181 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 0,
NULL, &
len);
185
187 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info,
len,
value, &
len);
191 ok(
len ==
lstrlenW(mimetypeW) + 1,
"GetMimeType returned wrong len %i\n",
len);
192 }
193 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 1,
value, &
len);
197
198 hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 256,
value, &
len);
202 ok(
len ==
lstrlenW(mimetypeW) + 1,
"GetMimeType returned wrong len %i\n",
len);
203 }
204 num_formats = 0xdeadbeef;
205 hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, 0,
NULL, &num_formats);
206 ok(
hr ==
S_OK,
"GetPixelFormats failed, hr=%x\n",
hr);
207 ok((num_formats <= 21 && num_formats >= 1) ||
209 "%u: got %d formats\n",
i, num_formats);
210
211 hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, 0,
NULL,
NULL);
213
216 ok(
hr ==
S_OK,
"GetPixelFormats failed, hr=%x\n",
hr);
218
221 ok(
hr ==
S_OK,
"GetPixelFormats failed, hr=%x\n",
hr);
223 "%u: got %d formats\n",
i, num_formats);
225
227 hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, num_formats,
pixelformats, &
count);
228 ok(
hr ==
S_OK,
"GetPixelFormats failed, hr=%x\n",
hr);
229 ok(
count == num_formats,
"got %d formats, expected %d\n",
count, num_formats);
230 for (
j = 0;
j < num_formats;
j++)
232
233 hr = IWICBitmapDecoderInfo_GetPixelFormats(decoder_info, num_formats,
pixelformats,
NULL);
235
239 ok(
hr ==
S_OK,
"GetPixelFormats failed, hr=%x\n",
hr);
240 ok(
count == num_formats,
"got %d formats, expected %d\n",
count, num_formats);
241
242 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 0,
NULL,
NULL);
244
245 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 1,
NULL, &
len);
248 ok(
len ==
lstrlenW(extensionsW) + 1,
"%u: GetFileExtensions returned wrong len %i\n",
i,
len);
249
250 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info,
len,
value,
NULL);
252
253 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 0,
NULL, &
len);
254 ok(
hr ==
S_OK,
"GetFileExtensions failed, hr=%x\n",
hr);
256 ok(
len ==
lstrlenW(extensionsW) + 1,
"GetFileExtensions returned wrong len %i\n",
len);
257
259 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info,
len,
value, &
len);
260 ok(
hr ==
S_OK,
"GetFileExtensions failed, hr=%x\n",
hr);
265
266 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 1,
value, &
len);
270
271 hr = IWICBitmapDecoderInfo_GetFileExtensions(decoder_info, 256,
value, &
len);
277
278 IWICBitmapDecoderInfo_Release(decoder_info);
279 IWICComponentInfo_Release(
info);
280 }
281}
DDPIXELFORMAT pixelformats[]
#define MultiByteToWideChar
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
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
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
#define todo_wine_if(is_todo)
static BOOL is_pixelformat(GUID *format)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualCLSID(rclsid1, rclsid2)
#define WINCODEC_ERR_INSUFFICIENTBUFFER