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
7c6dcab7
Commit
7c6dcab7
authored
Mar 28, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use regular QI way to return interface client asked for.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
19777292
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
main.c
dlls/dwrite/main.c
+7
-15
font.c
dlls/dwrite/tests/font.c
+9
-0
No files found.
dlls/dwrite/main.c
View file @
7c6dcab7
...
...
@@ -1313,21 +1313,14 @@ static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYP
HRESULT
WINAPI
DWriteCreateFactory
(
DWRITE_FACTORY_TYPE
type
,
REFIID
riid
,
IUnknown
**
ret
)
{
struct
dwritefactory
*
factory
;
HRESULT
hr
;
TRACE
(
"(%d, %s, %p)
\n
"
,
type
,
debugstr_guid
(
riid
),
ret
);
*
ret
=
NULL
;
if
(
!
IsEqualIID
(
riid
,
&
IID_IDWriteFactory
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDWriteFactory1
)
&&
!
IsEqualIID
(
riid
,
&
IID_IDWriteFactory2
))
return
E_FAIL
;
if
(
type
==
DWRITE_FACTORY_TYPE_SHARED
&&
shared_factory
)
{
*
ret
=
(
IUnknown
*
)
shared_factory
;
IDWriteFactory2_AddRef
(
shared_factory
);
return
S_OK
;
}
if
(
type
==
DWRITE_FACTORY_TYPE_SHARED
&&
shared_factory
)
return
IDWriteFactory2_QueryInterface
(
shared_factory
,
riid
,
(
void
**
)
ret
);
factory
=
heap_alloc
(
sizeof
(
struct
dwritefactory
));
if
(
!
factory
)
return
E_OUTOFMEMORY
;
...
...
@@ -1337,11 +1330,10 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnkno
if
(
type
==
DWRITE_FACTORY_TYPE_SHARED
)
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
shared_factory
,
&
factory
->
IDWriteFactory2_iface
,
NULL
))
{
release_shared_factory
(
&
factory
->
IDWriteFactory2_iface
);
*
ret
=
(
IUnknown
*
)
shared_factory
;
IDWriteFactory2_AddRef
(
shared_factory
);
return
S_OK
;
return
IDWriteFactory2_QueryInterface
(
shared_factory
,
riid
,
(
void
**
)
ret
);
}
*
ret
=
(
IUnknown
*
)
&
factory
->
IDWriteFactory2_iface
;
return
S_OK
;
hr
=
IDWriteFactory2_QueryInterface
(
&
factory
->
IDWriteFactory2_iface
,
riid
,
(
void
**
)
ret
);
IDWriteFactory2_Release
(
&
factory
->
IDWriteFactory2_iface
);
return
hr
;
}
dlls/dwrite/tests/font.c
View file @
7c6dcab7
...
...
@@ -2312,6 +2312,11 @@ static void test_shared_isolated(void)
hr
=
DWriteCreateFactory
(
DWRITE_FACTORY_TYPE_SHARED
,
&
IID_IDWriteFactory
,
(
IUnknown
**
)
&
shared2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
shared
==
shared2
,
"got %p, and %p
\n
"
,
shared
,
shared2
);
IDWriteFactory_Release
(
shared2
);
hr
=
DWriteCreateFactory
(
DWRITE_FACTORY_TYPE_SHARED
,
&
IID_IUnknown
,
(
IUnknown
**
)
&
shared2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
shared
==
shared2
,
"got %p, and %p
\n
"
,
shared
,
shared2
);
IDWriteFactory_Release
(
shared
);
IDWriteFactory_Release
(
shared2
);
...
...
@@ -2330,6 +2335,10 @@ static void test_shared_isolated(void)
ok
(
isolated
!=
isolated2
,
"got %p, and %p
\n
"
,
isolated
,
isolated2
);
IDWriteFactory_Release
(
isolated2
);
hr
=
DWriteCreateFactory
(
DWRITE_FACTORY_TYPE_ISOLATED
,
&
IID_IUnknown
,
(
IUnknown
**
)
&
isolated2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFactory_Release
(
isolated2
);
hr
=
DWriteCreateFactory
(
DWRITE_FACTORY_TYPE_SHARED
+
1
,
&
IID_IDWriteFactory
,
(
IUnknown
**
)
&
isolated2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
shared
!=
isolated2
,
"got %p, and %p
\n
"
,
shared
,
isolated2
);
...
...
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