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
499f32b3
Commit
499f32b3
authored
Nov 12, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement MetadataReaderInfo_MatchesPattern.
parent
8891b8f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
2 deletions
+68
-2
info.c
dlls/windowscodecs/info.c
+68
-2
No files found.
dlls/windowscodecs/info.c
View file @
499f32b3
...
...
@@ -1794,8 +1794,74 @@ static HRESULT WINAPI MetadataReaderInfo_GetPatterns(IWICMetadataReaderInfo *ifa
static
HRESULT
WINAPI
MetadataReaderInfo_MatchesPattern
(
IWICMetadataReaderInfo
*
iface
,
REFGUID
container
,
IStream
*
stream
,
BOOL
*
matches
)
{
FIXME
(
"(%p,%s,%p,%p): stub
\n
"
,
iface
,
debugstr_guid
(
container
),
stream
,
matches
);
return
E_NOTIMPL
;
HRESULT
hr
;
WICMetadataPattern
*
patterns
;
UINT
pattern_count
=
0
,
patterns_size
=
0
;
ULONG
datasize
=
0
;
BYTE
*
data
=
NULL
;
ULONG
bytesread
;
UINT
i
;
LARGE_INTEGER
seekpos
;
ULONG
pos
;
TRACE
(
"(%p,%s,%p,%p)
\n
"
,
iface
,
debugstr_guid
(
container
),
stream
,
matches
);
hr
=
MetadataReaderInfo_GetPatterns
(
iface
,
container
,
0
,
NULL
,
&
pattern_count
,
&
patterns_size
);
if
(
FAILED
(
hr
))
return
hr
;
patterns
=
HeapAlloc
(
GetProcessHeap
(),
0
,
patterns_size
);
if
(
!
patterns
)
return
E_OUTOFMEMORY
;
hr
=
MetadataReaderInfo_GetPatterns
(
iface
,
container
,
patterns_size
,
patterns
,
&
pattern_count
,
&
patterns_size
);
if
(
FAILED
(
hr
))
goto
end
;
for
(
i
=
0
;
i
<
pattern_count
;
i
++
)
{
if
(
datasize
<
patterns
[
i
].
Length
)
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
datasize
=
patterns
[
i
].
Length
;
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
patterns
[
i
].
Length
);
if
(
!
data
)
{
hr
=
E_OUTOFMEMORY
;
break
;
}
}
seekpos
.
QuadPart
=
patterns
[
i
].
Position
.
QuadPart
;
hr
=
IStream_Seek
(
stream
,
seekpos
,
STREAM_SEEK_SET
,
NULL
);
if
(
FAILED
(
hr
))
break
;
hr
=
IStream_Read
(
stream
,
data
,
patterns
[
i
].
Length
,
&
bytesread
);
if
(
hr
==
S_FALSE
||
(
hr
==
S_OK
&&
bytesread
!=
patterns
[
i
].
Length
))
/* past end of stream */
continue
;
if
(
FAILED
(
hr
))
break
;
for
(
pos
=
0
;
pos
<
patterns
[
i
].
Length
;
pos
++
)
{
if
((
data
[
pos
]
&
patterns
[
i
].
Mask
[
pos
])
!=
patterns
[
i
].
Pattern
[
pos
])
break
;
}
if
(
pos
==
patterns
[
i
].
Length
)
/* matches pattern */
{
hr
=
S_OK
;
*
matches
=
TRUE
;
break
;
}
}
if
(
i
==
pattern_count
)
/* does not match any pattern */
{
hr
=
S_OK
;
*
matches
=
FALSE
;
}
end:
HeapFree
(
GetProcessHeap
(),
0
,
patterns
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
hr
;
}
static
HRESULT
WINAPI
MetadataReaderInfo_CreateInstance
(
IWICMetadataReaderInfo
*
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