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
5f15f9b8
Commit
5f15f9b8
authored
Nov 29, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Standardize the COM usage in icoformat.c.
parent
2ff573c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
icoformat.c
dlls/windowscodecs/icoformat.c
+25
-15
No files found.
dlls/windowscodecs/icoformat.c
View file @
5f15f9b8
...
@@ -57,7 +57,7 @@ typedef struct
...
@@ -57,7 +57,7 @@ typedef struct
#include "poppack.h"
#include "poppack.h"
typedef
struct
{
typedef
struct
{
const
IWICBitmapDecoderVtbl
*
lpVtbl
;
IWICBitmapDecoder
IWICBitmapDecoder_iface
;
LONG
ref
;
LONG
ref
;
BOOL
initialized
;
BOOL
initialized
;
IStream
*
stream
;
IStream
*
stream
;
...
@@ -66,16 +66,26 @@ typedef struct {
...
@@ -66,16 +66,26 @@ typedef struct {
}
IcoDecoder
;
}
IcoDecoder
;
typedef
struct
{
typedef
struct
{
const
IWICBitmapFrameDecodeVtbl
*
lpVtbl
;
IWICBitmapFrameDecode
IWICBitmapFrameDecode_iface
;
LONG
ref
;
LONG
ref
;
UINT
width
,
height
;
UINT
width
,
height
;
BYTE
*
bits
;
BYTE
*
bits
;
}
IcoFrameDecode
;
}
IcoFrameDecode
;
static
inline
IcoDecoder
*
impl_from_IWICBitmapDecoder
(
IWICBitmapDecoder
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IcoDecoder
,
IWICBitmapDecoder_iface
);
}
static
inline
IcoFrameDecode
*
impl_from_IWICBitmapFrameDecode
(
IWICBitmapFrameDecode
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IcoFrameDecode
,
IWICBitmapFrameDecode_iface
);
}
static
HRESULT
WINAPI
IcoFrameDecode_QueryInterface
(
IWICBitmapFrameDecode
*
iface
,
REFIID
iid
,
static
HRESULT
WINAPI
IcoFrameDecode_QueryInterface
(
IWICBitmapFrameDecode
*
iface
,
REFIID
iid
,
void
**
ppv
)
void
**
ppv
)
{
{
IcoFrameDecode
*
This
=
(
IcoFrameDecode
*
)
iface
;
IcoFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
if
(
!
ppv
)
return
E_INVALIDARG
;
...
@@ -98,7 +108,7 @@ static HRESULT WINAPI IcoFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface
...
@@ -98,7 +108,7 @@ static HRESULT WINAPI IcoFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface
static
ULONG
WINAPI
IcoFrameDecode_AddRef
(
IWICBitmapFrameDecode
*
iface
)
static
ULONG
WINAPI
IcoFrameDecode_AddRef
(
IWICBitmapFrameDecode
*
iface
)
{
{
IcoFrameDecode
*
This
=
(
IcoFrameDecode
*
)
iface
;
IcoFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
@@ -108,7 +118,7 @@ static ULONG WINAPI IcoFrameDecode_AddRef(IWICBitmapFrameDecode *iface)
...
@@ -108,7 +118,7 @@ static ULONG WINAPI IcoFrameDecode_AddRef(IWICBitmapFrameDecode *iface)
static
ULONG
WINAPI
IcoFrameDecode_Release
(
IWICBitmapFrameDecode
*
iface
)
static
ULONG
WINAPI
IcoFrameDecode_Release
(
IWICBitmapFrameDecode
*
iface
)
{
{
IcoFrameDecode
*
This
=
(
IcoFrameDecode
*
)
iface
;
IcoFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
@@ -125,7 +135,7 @@ static ULONG WINAPI IcoFrameDecode_Release(IWICBitmapFrameDecode *iface)
...
@@ -125,7 +135,7 @@ static ULONG WINAPI IcoFrameDecode_Release(IWICBitmapFrameDecode *iface)
static
HRESULT
WINAPI
IcoFrameDecode_GetSize
(
IWICBitmapFrameDecode
*
iface
,
static
HRESULT
WINAPI
IcoFrameDecode_GetSize
(
IWICBitmapFrameDecode
*
iface
,
UINT
*
puiWidth
,
UINT
*
puiHeight
)
UINT
*
puiWidth
,
UINT
*
puiHeight
)
{
{
IcoFrameDecode
*
This
=
(
IcoFrameDecode
*
)
iface
;
IcoFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
*
puiWidth
=
This
->
width
;
*
puiWidth
=
This
->
width
;
*
puiHeight
=
This
->
height
;
*
puiHeight
=
This
->
height
;
...
@@ -159,7 +169,7 @@ static HRESULT WINAPI IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
...
@@ -159,7 +169,7 @@ static HRESULT WINAPI IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
static
HRESULT
WINAPI
IcoFrameDecode_CopyPixels
(
IWICBitmapFrameDecode
*
iface
,
static
HRESULT
WINAPI
IcoFrameDecode_CopyPixels
(
IWICBitmapFrameDecode
*
iface
,
const
WICRect
*
prc
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbBuffer
)
const
WICRect
*
prc
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbBuffer
)
{
{
IcoFrameDecode
*
This
=
(
IcoFrameDecode
*
)
iface
;
IcoFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
return
copy_pixels
(
32
,
This
->
bits
,
This
->
width
,
This
->
height
,
This
->
width
*
4
,
return
copy_pixels
(
32
,
This
->
bits
,
This
->
width
,
This
->
height
,
This
->
width
*
4
,
...
@@ -392,7 +402,7 @@ end:
...
@@ -392,7 +402,7 @@ end:
static
HRESULT
WINAPI
IcoDecoder_QueryInterface
(
IWICBitmapDecoder
*
iface
,
REFIID
iid
,
static
HRESULT
WINAPI
IcoDecoder_QueryInterface
(
IWICBitmapDecoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
void
**
ppv
)
{
{
IcoDecoder
*
This
=
(
IcoDecoder
*
)
iface
;
IcoDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
if
(
!
ppv
)
return
E_INVALIDARG
;
...
@@ -413,7 +423,7 @@ static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID
...
@@ -413,7 +423,7 @@ static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID
static
ULONG
WINAPI
IcoDecoder_AddRef
(
IWICBitmapDecoder
*
iface
)
static
ULONG
WINAPI
IcoDecoder_AddRef
(
IWICBitmapDecoder
*
iface
)
{
{
IcoDecoder
*
This
=
(
IcoDecoder
*
)
iface
;
IcoDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
@@ -423,7 +433,7 @@ static ULONG WINAPI IcoDecoder_AddRef(IWICBitmapDecoder *iface)
...
@@ -423,7 +433,7 @@ static ULONG WINAPI IcoDecoder_AddRef(IWICBitmapDecoder *iface)
static
ULONG
WINAPI
IcoDecoder_Release
(
IWICBitmapDecoder
*
iface
)
static
ULONG
WINAPI
IcoDecoder_Release
(
IWICBitmapDecoder
*
iface
)
{
{
IcoDecoder
*
This
=
(
IcoDecoder
*
)
iface
;
IcoDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
@@ -449,7 +459,7 @@ static HRESULT WINAPI IcoDecoder_QueryCapability(IWICBitmapDecoder *iface, IStre
...
@@ -449,7 +459,7 @@ static HRESULT WINAPI IcoDecoder_QueryCapability(IWICBitmapDecoder *iface, IStre
static
HRESULT
WINAPI
IcoDecoder_Initialize
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
static
HRESULT
WINAPI
IcoDecoder_Initialize
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
WICDecodeOptions
cacheOptions
)
WICDecodeOptions
cacheOptions
)
{
{
IcoDecoder
*
This
=
(
IcoDecoder
*
)
iface
;
IcoDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
LARGE_INTEGER
seek
;
LARGE_INTEGER
seek
;
HRESULT
hr
;
HRESULT
hr
;
ULONG
bytesread
;
ULONG
bytesread
;
...
@@ -540,7 +550,7 @@ static HRESULT WINAPI IcoDecoder_GetThumbnail(IWICBitmapDecoder *iface,
...
@@ -540,7 +550,7 @@ static HRESULT WINAPI IcoDecoder_GetThumbnail(IWICBitmapDecoder *iface,
static
HRESULT
WINAPI
IcoDecoder_GetFrameCount
(
IWICBitmapDecoder
*
iface
,
static
HRESULT
WINAPI
IcoDecoder_GetFrameCount
(
IWICBitmapDecoder
*
iface
,
UINT
*
pCount
)
UINT
*
pCount
)
{
{
IcoDecoder
*
This
=
(
IcoDecoder
*
)
iface
;
IcoDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pCount
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pCount
);
if
(
!
This
->
initialized
)
return
WINCODEC_ERR_NOTINITIALIZED
;
if
(
!
This
->
initialized
)
return
WINCODEC_ERR_NOTINITIALIZED
;
...
@@ -554,7 +564,7 @@ static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface,
...
@@ -554,7 +564,7 @@ static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface,
static
HRESULT
WINAPI
IcoDecoder_GetFrame
(
IWICBitmapDecoder
*
iface
,
static
HRESULT
WINAPI
IcoDecoder_GetFrame
(
IWICBitmapDecoder
*
iface
,
UINT
index
,
IWICBitmapFrameDecode
**
ppIBitmapFrame
)
UINT
index
,
IWICBitmapFrameDecode
**
ppIBitmapFrame
)
{
{
IcoDecoder
*
This
=
(
IcoDecoder
*
)
iface
;
IcoDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
IcoFrameDecode
*
result
=
NULL
;
IcoFrameDecode
*
result
=
NULL
;
LARGE_INTEGER
seek
;
LARGE_INTEGER
seek
;
ULARGE_INTEGER
offset
,
length
;
ULARGE_INTEGER
offset
,
length
;
...
@@ -586,7 +596,7 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface,
...
@@ -586,7 +596,7 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface,
goto
fail
;
goto
fail
;
}
}
result
->
lpVtbl
=
&
IcoFrameDecode_Vtbl
;
result
->
IWICBitmapFrameDecode_iface
.
lpVtbl
=
&
IcoFrameDecode_Vtbl
;
result
->
ref
=
1
;
result
->
ref
=
1
;
result
->
bits
=
NULL
;
result
->
bits
=
NULL
;
...
@@ -677,7 +687,7 @@ HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
...
@@ -677,7 +687,7 @@ HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IcoDecoder
));
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IcoDecoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
IcoDecoder_Vtbl
;
This
->
IWICBitmapDecoder_iface
.
lpVtbl
=
&
IcoDecoder_Vtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
stream
=
NULL
;
This
->
stream
=
NULL
;
This
->
initialized
=
FALSE
;
This
->
initialized
=
FALSE
;
...
...
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