Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
60e66535
Commit
60e66535
authored
13 years ago
by
Esme Povirk
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
windowscodecs: Implement IWICMetadataWriter::LoadEx.
parent
6b2d1ce1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/windowscodecs/metadatahandler.c
+88
-4
88 additions, 4 deletions
dlls/windowscodecs/metadatahandler.c
dlls/windowscodecs/tests/metadata.c
+1
-1
1 addition, 1 deletion
dlls/windowscodecs/tests/metadata.c
with
89 additions
and
5 deletions
dlls/windowscodecs/metadatahandler.c
+
88
−
4
View file @
60e66535
...
...
@@ -39,6 +39,9 @@ typedef struct MetadataHandler {
LONG
ref
;
IWICPersistStream
IWICPersistStream_iface
;
const
MetadataHandlerVtbl
*
vtable
;
MetadataItem
*
items
;
DWORD
item_count
;
CRITICAL_SECTION
lock
;
}
MetadataHandler
;
static
inline
MetadataHandler
*
impl_from_IWICMetadataWriter
(
IWICMetadataWriter
*
iface
)
...
...
@@ -51,6 +54,20 @@ static inline MetadataHandler *impl_from_IWICPersistStream(IWICPersistStream *if
return
CONTAINING_RECORD
(
iface
,
MetadataHandler
,
IWICPersistStream_iface
);
}
static
void
MetadataHandler_FreeItems
(
MetadataHandler
*
This
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
item_count
;
i
++
)
{
PropVariantClear
(
&
This
->
items
[
i
].
schema
);
PropVariantClear
(
&
This
->
items
[
i
].
id
);
PropVariantClear
(
&
This
->
items
[
i
].
value
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
items
);
}
static
HRESULT
WINAPI
MetadataHandler_QueryInterface
(
IWICMetadataWriter
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
...
...
@@ -100,6 +117,9 @@ static ULONG WINAPI MetadataHandler_Release(IWICMetadataWriter *iface)
if
(
ref
==
0
)
{
MetadataHandler_FreeItems
(
This
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
lock
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -248,8 +268,28 @@ static HRESULT WINAPI MetadataHandler_GetSizeMax(IWICPersistStream *iface,
static
HRESULT
WINAPI
MetadataHandler_LoadEx
(
IWICPersistStream
*
iface
,
IStream
*
pIStream
,
const
GUID
*
pguidPreferredVendor
,
DWORD
dwPersistOptions
)
{
FIXME
(
"(%p,%p,%s,%x): stub
\n
"
,
iface
,
pIStream
,
debugstr_guid
(
pguidPreferredVendor
),
dwPersistOptions
);
return
E_NOTIMPL
;
MetadataHandler
*
This
=
impl_from_IWICPersistStream
(
iface
);
HRESULT
hr
;
MetadataItem
*
new_items
=
NULL
;
DWORD
item_count
=
0
;
TRACE
(
"(%p,%p,%s,%x)
\n
"
,
iface
,
pIStream
,
debugstr_guid
(
pguidPreferredVendor
),
dwPersistOptions
);
EnterCriticalSection
(
&
This
->
lock
);
hr
=
This
->
vtable
->
fnLoad
(
pIStream
,
pguidPreferredVendor
,
dwPersistOptions
,
&
new_items
,
&
item_count
);
if
(
SUCCEEDED
(
hr
))
{
MetadataHandler_FreeItems
(
This
);
This
->
items
=
new_items
;
This
->
item_count
=
item_count
;
}
LeaveCriticalSection
(
&
This
->
lock
);
return
hr
;
}
static
HRESULT
WINAPI
MetadataHandler_SaveEx
(
IWICPersistStream
*
iface
,
...
...
@@ -290,6 +330,11 @@ HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, IUnknown *pUnkO
This
->
IWICPersistStream_iface
.
lpVtbl
=
&
MetadataHandler_PersistStream_Vtbl
;
This
->
ref
=
1
;
This
->
vtable
=
vtable
;
This
->
items
=
NULL
;
This
->
item_count
=
0
;
InitializeCriticalSection
(
&
This
->
lock
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": MetadataHandler.lock"
);
hr
=
IWICMetadataWriter_QueryInterface
(
&
This
->
IWICMetadataWriter_iface
,
iid
,
ppv
);
...
...
@@ -301,8 +346,47 @@ HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, IUnknown *pUnkO
static
HRESULT
LoadUnknownMetadata
(
IStream
*
input
,
const
GUID
*
preferred_vendor
,
DWORD
persist_options
,
MetadataItem
**
items
,
DWORD
*
item_count
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
HRESULT
hr
;
MetadataItem
*
result
;
STATSTG
stat
;
BYTE
*
data
;
ULONG
bytesread
;
TRACE
(
"
\n
"
);
hr
=
IStream_Stat
(
input
,
&
stat
,
STATFLAG_NONAME
);
if
(
FAILED
(
hr
))
return
hr
;
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stat
.
cbSize
.
QuadPart
);
if
(
!
data
)
return
E_OUTOFMEMORY
;
hr
=
IStream_Read
(
input
,
data
,
stat
.
cbSize
.
QuadPart
,
&
bytesread
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
hr
;
}
result
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
MetadataItem
));
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
E_OUTOFMEMORY
;
}
PropVariantInit
(
&
result
[
0
].
schema
);
PropVariantInit
(
&
result
[
0
].
id
);
PropVariantInit
(
&
result
[
0
].
value
);
result
[
0
].
value
.
vt
=
VT_BLOB
;
result
[
0
].
value
.
blob
.
cbSize
=
bytesread
;
result
[
0
].
value
.
blob
.
pBlobData
=
data
;
*
items
=
result
;
*
item_count
=
1
;
return
S_OK
;
}
static
const
MetadataHandlerVtbl
UnknownMetadataReader_Vtbl
=
{
...
...
This diff is collapsed.
Click to expand it.
dlls/windowscodecs/tests/metadata.c
+
1
−
1
View file @
60e66535
...
...
@@ -100,7 +100,7 @@ static void load_stream(IUnknown *reader, const char *data, int data_size)
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICPersistStream_LoadEx
(
persist
,
stream
,
NULL
,
WICPersistOptionsDefault
);
todo_wine
ok
(
hr
==
S_OK
,
"LoadEx failed, hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"LoadEx failed, hr=%x
\n
"
,
hr
);
IWICPersistStream_Release
(
persist
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment