Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2322254c
Commit
2322254c
authored
Jul 01, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Jul 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement QueryCapability for BMP decoder.
parent
5b7de464
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
bmpdecode.c
dlls/windowscodecs/bmpdecode.c
+17
-2
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+5
-5
No files found.
dlls/windowscodecs/bmpdecode.c
View file @
2322254c
...
@@ -329,9 +329,14 @@ static HRESULT BmpDecoder_ReadHeaders(BmpDecoder* This, IStream *stream)
...
@@ -329,9 +329,14 @@ static HRESULT BmpDecoder_ReadHeaders(BmpDecoder* This, IStream *stream)
{
{
HRESULT
hr
;
HRESULT
hr
;
ULONG
bytestoread
,
bytesread
;
ULONG
bytestoread
,
bytesread
;
LARGE_INTEGER
seek
;
if
(
This
->
initialized
)
return
WINCODEC_ERR_WRONGSTATE
;
if
(
This
->
initialized
)
return
WINCODEC_ERR_WRONGSTATE
;
seek
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
stream
,
seek
,
STREAM_SEEK_SET
,
NULL
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IStream_Read
(
stream
,
&
This
->
bfh
,
sizeof
(
BITMAPFILEHEADER
),
&
bytesread
);
hr
=
IStream_Read
(
stream
,
&
This
->
bfh
,
sizeof
(
BITMAPFILEHEADER
),
&
bytesread
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
if
(
bytesread
!=
sizeof
(
BITMAPFILEHEADER
)
||
if
(
bytesread
!=
sizeof
(
BITMAPFILEHEADER
)
||
...
@@ -483,8 +488,18 @@ static ULONG WINAPI BmpDecoder_Release(IWICBitmapDecoder *iface)
...
@@ -483,8 +488,18 @@ static ULONG WINAPI BmpDecoder_Release(IWICBitmapDecoder *iface)
static
HRESULT
WINAPI
BmpDecoder_QueryCapability
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
static
HRESULT
WINAPI
BmpDecoder_QueryCapability
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
DWORD
*
pdwCapability
)
DWORD
*
pdwCapability
)
{
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
pIStream
,
pdwCapability
);
HRESULT
hr
;
return
E_NOTIMPL
;
BmpDecoder
*
This
=
(
BmpDecoder
*
)
iface
;
hr
=
BmpDecoder_ReadHeaders
(
This
,
pIStream
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
This
->
read_data_func
==
BmpFrameDecode_ReadUnsupported
)
*
pdwCapability
=
0
;
else
*
pdwCapability
=
WICBitmapDecoderCapabilityCanDecodeAllImages
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
BmpDecoder_Initialize
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
static
HRESULT
WINAPI
BmpDecoder_Initialize
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
...
...
dlls/windowscodecs/tests/bmpformat.c
View file @
2322254c
...
@@ -157,7 +157,7 @@ static void test_decode_24bpp(void)
...
@@ -157,7 +157,7 @@ static void test_decode_24bpp(void)
/* cannot querycapability after initialize */
/* cannot querycapability after initialize */
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder
,
bmpstream
,
&
capability
);
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder
,
bmpstream
,
&
capability
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_WICBmpDecoder
,
NULL
,
CLSCTX_INPROC_SERVER
,
hr
=
CoCreateInstance
(
&
CLSID_WICBmpDecoder
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder2
);
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder2
);
...
@@ -165,17 +165,17 @@ static void test_decode_24bpp(void)
...
@@ -165,17 +165,17 @@ static void test_decode_24bpp(void)
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder2
,
bmpstream
,
&
capability
);
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder2
,
bmpstream
,
&
capability
);
todo_wine
ok
(
hr
==
S_OK
,
"QueryCapability failed, hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"QueryCapability failed, hr=%x
\n
"
,
hr
);
todo_wine
ok
(
capability
==
(
WICBitmapDecoderCapabilityCanDecodeAllImages
),
ok
(
capability
==
(
WICBitmapDecoderCapabilityCanDecodeAllImages
),
"unexpected capabilities: %x
\n
"
,
capability
);
"unexpected capabilities: %x
\n
"
,
capability
);
/* cannot initialize after querycapability */
/* cannot initialize after querycapability */
hr
=
IWICBitmapDecoder_Initialize
(
decoder2
,
bmpstream
,
WICDecodeMetadataCacheOnLoad
);
hr
=
IWICBitmapDecoder_Initialize
(
decoder2
,
bmpstream
,
WICDecodeMetadataCacheOnLoad
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
/* cannot querycapability twice */
/* cannot querycapability twice */
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder2
,
bmpstream
,
&
capability
);
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder2
,
bmpstream
,
&
capability
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
}
}
IStream_Release
(
bmpstream
);
IStream_Release
(
bmpstream
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment