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
3e6d9558
Commit
3e6d9558
authored
Feb 10, 2009
by
Christian Costa
Committed by
Alexandre Julliard
Feb 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Add support for DXFILELOAD_FROMRESOURCE source.
parent
279e4903
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
d3dxof.c
dlls/d3dxof/d3dxof.c
+35
-0
d3dxof_private.h
dlls/d3dxof/d3dxof_private.h
+1
-0
No files found.
dlls/d3dxof/d3dxof.c
View file @
3e6d9558
...
...
@@ -131,6 +131,7 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
HANDLE
hFile
=
INVALID_HANDLE_VALUE
;
HANDLE
file_mapping
=
0
;
LPBYTE
buffer
=
NULL
;
HGLOBAL
resource_data
=
0
;
LPBYTE
file_buffer
;
DWORD
file_size
;
...
...
@@ -169,6 +170,36 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
}
file_buffer
=
buffer
;
}
else
if
(
dwLoadOptions
==
DXFILELOAD_FROMRESOURCE
)
{
HRSRC
resource_info
;
LPDXFILELOADRESOURCE
lpdxflr
=
pvSource
;
TRACE
(
"Source in resource (module = %p, name = %s, type = %s
\n
"
,
lpdxflr
->
hModule
,
debugstr_a
(
lpdxflr
->
lpName
),
debugstr_a
(
lpdxflr
->
lpType
));
resource_info
=
FindResourceA
(
lpdxflr
->
hModule
,
lpdxflr
->
lpName
,
lpdxflr
->
lpType
);
if
(
!
resource_info
)
{
hr
=
DXFILEERR_RESOURCENOTFOUND
;
goto
error
;
}
file_size
=
SizeofResource
(
lpdxflr
->
hModule
,
resource_info
);
resource_data
=
LoadResource
(
lpdxflr
->
hModule
,
resource_info
);
if
(
!
resource_data
)
{
hr
=
DXFILEERR_BADRESOURCE
;
goto
error
;
}
file_buffer
=
LockResource
(
resource_data
);
if
(
!
file_buffer
)
{
hr
=
DXFILEERR_BADRESOURCE
;
goto
error
;
}
}
else
if
(
dwLoadOptions
==
DXFILELOAD_FROMMEMORY
)
{
lpdxflm
=
pvSource
;
...
...
@@ -289,6 +320,8 @@ error:
CloseHandle
(
file_mapping
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
hFile
);
if
(
resource_data
)
FreeResource
(
resource_data
);
*
ppEnumObj
=
NULL
;
return
hr
;
...
...
@@ -977,6 +1010,8 @@ static ULONG WINAPI IDirectXFileEnumObjectImpl_Release(IDirectXFileEnumObject* i
CloseHandle
(
This
->
file_mapping
);
CloseHandle
(
This
->
hFile
);
}
else
if
(
This
->
source
==
DXFILELOAD_FROMRESOURCE
)
FreeResource
(
This
->
resource_data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
dlls/d3dxof/d3dxof_private.h
View file @
3e6d9558
...
...
@@ -151,6 +151,7 @@ typedef struct {
HANDLE
hFile
;
HANDLE
file_mapping
;
LPBYTE
buffer
;
HGLOBAL
resource_data
;
parse_buffer
buf
;
IDirectXFileImpl
*
pDirectXFile
;
ULONG
nb_xobjects
;
...
...
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