Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c94763b4
Commit
c94763b4
authored
Oct 23, 2009
by
Christian Costa
Committed by
Alexandre Julliard
Oct 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Only consider 4 lowest bits in DXFILELOADOPTIONS + tests.
parent
b9561c9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
d3dxof.c
dlls/d3dxof/d3dxof.c
+3
-0
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+54
-0
No files found.
dlls/d3dxof/d3dxof.c
View file @
c94763b4
...
...
@@ -142,6 +142,9 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
if
(
!
ppEnumObj
)
return
DXFILEERR_BADVALUE
;
/* Only lowest 4 bits are relevant in DXFILELOADOPTIONS */
dwLoadOptions
&=
0xF
;
if
(
dwLoadOptions
==
DXFILELOAD_FROMFILE
)
{
TRACE
(
"Open source file '%s'
\n
"
,
(
char
*
)
pvSource
);
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
c94763b4
...
...
@@ -137,6 +137,59 @@ static void test_refcount(void)
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
static
void
test_CreateEnumObject
(
void
)
{
HRESULT
hr
;
ULONG
ref
;
LPDIRECTXFILE
lpDirectXFile
=
NULL
;
LPDIRECTXFILEENUMOBJECT
lpdxfeo
;
LPDIRECTXFILEDATA
lpdxfd
;
DXFILELOADMEMORY
dxflm
;
BYTE
*
pdata
;
DWORD
size
;
if
(
!
pDirectXFileCreate
)
{
win_skip
(
"DirectXFileCreate is not available
\n
"
);
return
;
}
hr
=
pDirectXFileCreate
(
&
lpDirectXFile
);
ok
(
hr
==
DXFILE_OK
,
"DirectXFileCreate: %x
\n
"
,
hr
);
if
(
!
lpDirectXFile
)
{
skip
(
"Couldn't create DirectXFile interface
\n
"
);
return
;
}
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template
,
strlen
(
template
));
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
dxflm
.
lpMemory
=
&
object
;
dxflm
.
dSize
=
strlen
(
object
);
/* Check that only lowest 4 bits are relevant in DXFILELOADOPTIONS */
hr
=
IDirectXFile_CreateEnumObject
(
lpDirectXFile
,
&
dxflm
,
0xFFFFFFF0
+
DXFILELOAD_FROMMEMORY
,
&
lpdxfeo
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
hr
=
IDirectXFileEnumObject_GetNextDataObject
(
lpdxfeo
,
&
lpdxfd
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileEnumObject_GetNextDataObject: %x
\n
"
,
hr
);
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
NULL
,
&
size
,
(
void
**
)
&
pdata
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
8
,
"Retreived data size is wrong
\n
"
);
ok
((
*
((
WORD
*
)
pdata
)
==
1
)
&&
(
*
((
WORD
*
)(
pdata
+
2
))
==
2
)
&&
(
*
((
DWORD
*
)(
pdata
+
4
))
==
3
),
"Retreived data is wrong
\n
"
);
ref
=
IDirectXFileEnumObject_Release
(
lpdxfeo
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
ref
=
IDirectXFile_Release
(
lpDirectXFile
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
ref
=
IDirectXFileData_Release
(
lpdxfd
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
/* Set it to 1 to expand the string when dumping the object. This is useful when there is
* only one string in a sub-object (very common). Use with care, this may lead to a crash. */
#define EXPAND_STRING 0
...
...
@@ -310,6 +363,7 @@ START_TEST(d3dxof)
init_function_pointers
();
test_refcount
();
test_CreateEnumObject
();
test_dump
();
FreeLibrary
(
hd3dxof
);
...
...
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