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
df9ec3c1
Commit
df9ec3c1
authored
Mar 06, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add helper to create internal COM classes without CoCreateInstance call if possible.
parent
2b40f9b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
8 deletions
+30
-8
clsfactory.c
dlls/windowscodecs/clsfactory.c
+11
-0
info.c
dlls/windowscodecs/info.c
+5
-8
gifformat.c
dlls/windowscodecs/tests/gifformat.c
+12
-0
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+2
-0
No files found.
dlls/windowscodecs/clsfactory.c
View file @
df9ec3c1
...
...
@@ -202,3 +202,14 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
TRACE
(
"<-- %08X
\n
"
,
ret
);
return
ret
;
}
HRESULT
create_instance
(
CLSID
*
clsid
,
const
IID
*
iid
,
void
**
ppv
)
{
int
i
;
for
(
i
=
0
;
wic_classes
[
i
].
classid
;
i
++
)
if
(
IsEqualCLSID
(
wic_classes
[
i
].
classid
,
clsid
))
return
wic_classes
[
i
].
constructor
(
iid
,
ppv
);
return
CoCreateInstance
(
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
iid
,
ppv
);
}
dlls/windowscodecs/info.c
View file @
df9ec3c1
...
...
@@ -623,8 +623,7 @@ static HRESULT WINAPI BitmapDecoderInfo_CreateInstance(IWICBitmapDecoderInfo *if
TRACE
(
"(%p,%p)
\n
"
,
iface
,
ppIBitmapDecoder
);
return
CoCreateInstance
(
&
This
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
ppIBitmapDecoder
);
return
create_instance
(
&
This
->
clsid
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
ppIBitmapDecoder
);
}
static
const
IWICBitmapDecoderInfoVtbl
BitmapDecoderInfo_Vtbl
=
{
...
...
@@ -917,8 +916,7 @@ static HRESULT WINAPI BitmapEncoderInfo_CreateInstance(IWICBitmapEncoderInfo *if
TRACE
(
"(%p,%p)
\n
"
,
iface
,
ppIBitmapEncoder
);
return
CoCreateInstance
(
&
This
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapEncoder
,
(
void
**
)
ppIBitmapEncoder
);
return
create_instance
(
&
This
->
clsid
,
&
IID_IWICBitmapEncoder
,
(
void
**
)
ppIBitmapEncoder
);
}
static
const
IWICBitmapEncoderInfoVtbl
BitmapEncoderInfo_Vtbl
=
{
...
...
@@ -1125,8 +1123,8 @@ static HRESULT WINAPI FormatConverterInfo_CreateInstance(IWICFormatConverterInfo
TRACE
(
"(%p,%p)
\n
"
,
iface
,
ppIFormatConverter
);
return
CoCreateInstance
(
&
This
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICFormatConverter
,
(
void
**
)
ppIFormatConverter
);
return
create_instance
(
&
This
->
clsid
,
&
IID_IWICFormatConverter
,
(
void
**
)
ppIFormatConverter
);
}
static
BOOL
ConverterSupportsFormat
(
IWICFormatConverterInfo
*
iface
,
const
WCHAR
*
formatguid
)
...
...
@@ -1871,8 +1869,7 @@ static HRESULT WINAPI MetadataReaderInfo_CreateInstance(IWICMetadataReaderInfo *
TRACE
(
"(%p,%p)
\n
"
,
iface
,
reader
);
return
CoCreateInstance
(
&
This
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICMetadataReader
,
(
void
**
)
reader
);
return
create_instance
(
&
This
->
clsid
,
&
IID_IWICMetadataReader
,
(
void
**
)
reader
);
}
static
const
IWICMetadataReaderInfoVtbl
MetadataReaderInfo_Vtbl
=
{
...
...
dlls/windowscodecs/tests/gifformat.c
View file @
df9ec3c1
...
...
@@ -25,6 +25,8 @@
#include "wincodec.h"
#include "wine/test.h"
HRESULT
WINAPI
WICCreateImagingFactory_Proxy
(
UINT
,
IWICImagingFactory
**
);
static
const
char
gif_global_palette
[]
=
{
/* LSD */
'G'
,
'I'
,
'F'
,
'8'
,
'7'
,
'a'
,
0x01
,
0x00
,
0x01
,
0x00
,
0xa1
,
0x02
,
0x00
,
/* palette */
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x0a
,
0x0b
,
0x0c
,
...
...
@@ -344,4 +346,14 @@ START_TEST(gifformat)
IWICImagingFactory_Release
(
factory
);
CoUninitialize
();
/* run the same tests with no COM initialization */
hr
=
WICCreateImagingFactory_Proxy
(
WINCODEC_SDK_VERSION
,
&
factory
);
ok
(
hr
==
S_OK
,
"WICCreateImagingFactory_Proxy error %#x
\n
"
,
hr
);
test_global_gif_palette
();
test_global_gif_palette_2frames
();
test_local_gif_palette
();
IWICImagingFactory_Release
(
factory
);
}
dlls/windowscodecs/wincodecs_private.h
View file @
df9ec3c1
...
...
@@ -67,6 +67,8 @@ DECLARE_INTERFACE_(IMILUnknown2,IUnknown)
};
#undef INTERFACE
HRESULT
create_instance
(
CLSID
*
clsid
,
const
IID
*
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
typedef
HRESULT
(
*
class_constructor
)(
REFIID
,
void
**
);
extern
HRESULT
FormatConverter_CreateInstance
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
ComponentFactory_CreateInstance
(
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
...
...
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