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
6c5d1b2f
Commit
6c5d1b2f
authored
Jul 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement IWICBitmapDecoderInfo::GetPatterns.
parent
3f2ff088
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
2 deletions
+92
-2
info.c
dlls/windowscodecs/info.c
+92
-2
No files found.
dlls/windowscodecs/info.c
View file @
6c5d1b2f
...
...
@@ -31,6 +31,7 @@
#include "wincodecs_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wincodecs
);
...
...
@@ -233,8 +234,97 @@ static HRESULT WINAPI BitmapDecoderInfo_MatchesMimeType(IWICBitmapDecoderInfo *i
static
HRESULT
WINAPI
BitmapDecoderInfo_GetPatterns
(
IWICBitmapDecoderInfo
*
iface
,
UINT
cbSizePatterns
,
WICBitmapPattern
*
pPatterns
,
UINT
*
pcPatterns
,
UINT
*
pcbPatternsActual
)
{
FIXME
(
"(%p,%i,%p,%p,%p): stub
\n
"
,
iface
,
cbSizePatterns
,
pPatterns
,
pcPatterns
,
pcbPatternsActual
);
return
E_NOTIMPL
;
BitmapDecoderInfo
*
This
=
(
BitmapDecoderInfo
*
)
iface
;
UINT
pattern_count
=
0
,
patterns_size
=
0
;
WCHAR
subkeyname
[
11
];
LONG
res
;
HKEY
patternskey
,
patternkey
;
static
const
WCHAR
uintformatW
[]
=
{
'%'
,
'u'
,
0
};
static
const
WCHAR
patternsW
[]
=
{
'P'
,
'a'
,
't'
,
't'
,
'e'
,
'r'
,
'n'
,
's'
,
0
};
static
const
WCHAR
positionW
[]
=
{
'P'
,
'o'
,
's'
,
'i'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
lengthW
[]
=
{
'L'
,
'e'
,
'n'
,
'g'
,
't'
,
'h'
,
0
};
static
const
WCHAR
patternW
[]
=
{
'P'
,
'a'
,
't'
,
't'
,
'e'
,
'r'
,
'n'
,
0
};
static
const
WCHAR
maskW
[]
=
{
'M'
,
'a'
,
's'
,
'k'
,
0
};
static
const
WCHAR
endofstreamW
[]
=
{
'E'
,
'n'
,
'd'
,
'O'
,
'f'
,
'S'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
0
};
HRESULT
hr
=
S_OK
;
UINT
i
;
BYTE
*
bPatterns
=
(
BYTE
*
)
pPatterns
;
DWORD
length
,
valuesize
;
TRACE
(
"(%p,%i,%p,%p,%p)
\n
"
,
iface
,
cbSizePatterns
,
pPatterns
,
pcPatterns
,
pcbPatternsActual
);
res
=
RegOpenKeyExW
(
This
->
classkey
,
patternsW
,
0
,
KEY_READ
,
&
patternskey
);
if
(
res
!=
ERROR_SUCCESS
)
return
HRESULT_FROM_WIN32
(
res
);
res
=
RegQueryInfoKeyW
(
patternskey
,
NULL
,
NULL
,
NULL
,
&
pattern_count
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
res
==
ERROR_SUCCESS
)
{
patterns_size
=
pattern_count
*
sizeof
(
WICBitmapPattern
);
for
(
i
=
0
;
i
<
pattern_count
;
i
++
)
{
snprintfW
(
subkeyname
,
11
,
uintformatW
,
i
);
res
=
RegOpenKeyExW
(
patternskey
,
subkeyname
,
0
,
KEY_READ
,
&
patternkey
);
if
(
res
==
ERROR_SUCCESS
)
{
valuesize
=
sizeof
(
ULONG
);
res
=
RegGetValueW
(
patternkey
,
NULL
,
lengthW
,
RRF_RT_DWORD
,
NULL
,
&
length
,
&
valuesize
);
patterns_size
+=
length
*
2
;
if
((
cbSizePatterns
>=
patterns_size
)
&&
(
res
==
ERROR_SUCCESS
))
{
pPatterns
[
i
].
Length
=
length
;
pPatterns
[
i
].
EndOfStream
=
0
;
valuesize
=
sizeof
(
BOOL
);
RegGetValueW
(
patternkey
,
NULL
,
endofstreamW
,
RRF_RT_DWORD
,
NULL
,
&
pPatterns
[
i
].
EndOfStream
,
&
valuesize
);
pPatterns
[
i
].
Position
.
QuadPart
=
0
;
valuesize
=
sizeof
(
ULARGE_INTEGER
);
res
=
RegGetValueW
(
patternkey
,
NULL
,
positionW
,
RRF_RT_DWORD
|
RRF_RT_QWORD
,
NULL
,
&
pPatterns
[
i
].
Position
,
&
valuesize
);
if
(
res
==
ERROR_SUCCESS
)
{
pPatterns
[
i
].
Pattern
=
bPatterns
+
patterns_size
-
length
*
2
;
valuesize
=
length
;
res
=
RegGetValueW
(
patternkey
,
NULL
,
patternW
,
RRF_RT_REG_BINARY
,
NULL
,
pPatterns
[
i
].
Pattern
,
&
valuesize
);
}
if
(
res
==
ERROR_SUCCESS
)
{
pPatterns
[
i
].
Mask
=
bPatterns
+
patterns_size
-
length
;
valuesize
=
length
;
res
=
RegGetValueW
(
patternkey
,
NULL
,
maskW
,
RRF_RT_REG_BINARY
,
NULL
,
pPatterns
[
i
].
Mask
,
&
valuesize
);
}
}
RegCloseKey
(
patternkey
);
}
if
(
res
!=
ERROR_SUCCESS
)
{
hr
=
HRESULT_FROM_WIN32
(
res
);
break
;
}
}
}
else
hr
=
HRESULT_FROM_WIN32
(
res
);
RegCloseKey
(
patternskey
);
if
(
hr
==
S_OK
)
{
*
pcPatterns
=
pattern_count
;
*
pcbPatternsActual
=
patterns_size
;
if
(
pPatterns
&&
cbSizePatterns
<
patterns_size
)
hr
=
WINCODEC_ERR_INSUFFICIENTBUFFER
;
}
return
hr
;
}
static
HRESULT
WINAPI
BitmapDecoderInfo_MatchesPattern
(
IWICBitmapDecoderInfo
*
iface
,
...
...
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