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
808bbeb0
Commit
808bbeb0
authored
Nov 18, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Store an array of adapters in dxgi_factory.
parent
1a11131d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
dxgi_main.c
dlls/dxgi/dxgi_main.c
+45
-0
dxgi_private.h
dlls/dxgi/dxgi_private.h
+2
-0
factory.c
dlls/dxgi/factory.c
+7
-0
No files found.
dlls/dxgi/dxgi_main.c
View file @
808bbeb0
...
...
@@ -80,6 +80,7 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
{
struct
dxgi_factory
*
object
;
HRESULT
hr
;
UINT
i
;
TRACE
(
"riid %s, factory %p
\n
"
,
debugstr_guid
(
riid
),
factory
);
...
...
@@ -87,6 +88,7 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
if
(
!
object
)
{
ERR
(
"Failed to allocate DXGI factory object memory
\n
"
);
*
factory
=
NULL
;
return
E_OUTOFMEMORY
;
}
...
...
@@ -95,7 +97,37 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
EnterCriticalSection
(
&
dxgi_cs
);
object
->
wined3d
=
WineDirect3DCreate
(
10
,
(
IUnknown
*
)
object
);
object
->
adapter_count
=
IWineD3D_GetAdapterCount
(
object
->
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
object
->
adapters
=
HeapAlloc
(
GetProcessHeap
(),
0
,
object
->
adapter_count
*
sizeof
(
*
object
->
adapters
));
if
(
!
object
->
adapters
)
{
ERR
(
"Failed to allocate DXGI adapter array memory
\n
"
);
hr
=
E_OUTOFMEMORY
;
goto
fail
;
}
for
(
i
=
0
;
i
<
object
->
adapter_count
;
++
i
)
{
struct
dxgi_adapter
*
adapter
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
**
object
->
adapters
));
if
(
!
adapter
)
{
UINT
j
;
ERR
(
"Failed to allocate DXGI adapter memory
\n
"
);
for
(
j
=
0
;
j
<
i
;
++
j
)
{
HeapFree
(
GetProcessHeap
(),
0
,
object
->
adapters
[
j
]);
}
hr
=
E_OUTOFMEMORY
;
goto
fail
;
}
adapter
->
vtbl
=
&
dxgi_adapter_vtbl
;
adapter
->
refcount
=
1
;
adapter
->
ordinal
=
i
;
object
->
adapters
[
i
]
=
(
IDXGIAdapter
*
)
adapter
;
}
TRACE
(
"Created IDXGIFactory %p
\n
"
,
object
);
...
...
@@ -103,6 +135,19 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
IDXGIFactory_Release
((
IDXGIFactory
*
)
object
);
return
hr
;
fail:
HeapFree
(
GetProcessHeap
(),
0
,
object
->
adapters
);
if
(
object
->
wined3d
)
{
EnterCriticalSection
(
&
dxgi_cs
);
IWineD3D_Release
(
object
->
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
}
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
factory
=
NULL
;
return
hr
;
}
static
BOOL
get_layer
(
enum
dxgi_device_layer_id
id
,
struct
dxgi_device_layer
*
layer
)
...
...
dlls/dxgi/dxgi_private.h
View file @
808bbeb0
...
...
@@ -46,6 +46,8 @@ struct dxgi_factory
const
struct
IWineDXGIFactoryVtbl
*
vtbl
;
LONG
refcount
;
IWineD3D
*
wined3d
;
UINT
adapter_count
;
IDXGIAdapter
**
adapters
;
};
/* IDXGIDevice */
...
...
dlls/dxgi/factory.c
View file @
808bbeb0
...
...
@@ -65,6 +65,13 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface)
if
(
!
refcount
)
{
UINT
i
;
for
(
i
=
0
;
i
<
This
->
adapter_count
;
++
i
)
{
IDXGIAdapter_Release
(
This
->
adapters
[
i
]);
}
EnterCriticalSection
(
&
dxgi_cs
);
IWineD3D_Release
(
This
->
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
...
...
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