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
d581f1bf
Commit
d581f1bf
authored
Feb 15, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Feb 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Enable retrieving a particular member in GetData + tests.
parent
f8719181
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
6 deletions
+46
-6
d3dxof.c
dlls/d3dxof/d3dxof.c
+16
-5
parsing.c
dlls/d3dxof/parsing.c
+3
-0
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+27
-1
No files found.
dlls/d3dxof/d3dxof.c
View file @
d581f1bf
...
...
@@ -616,12 +616,23 @@ static HRESULT WINAPI IDirectXFileDataImpl_GetData(IDirectXFileData* iface, LPCS
if
(
szMember
)
{
FIXME
(
"Specifying a member is not supported yet!
\n
"
);
return
DXFILEERR_BADVALUE
;
int
i
;
for
(
i
=
0
;
i
<
This
->
pobj
->
nb_members
;
i
++
)
if
(
!
strcmp
(
This
->
pobj
->
members
[
i
].
name
,
szMember
))
break
;
if
(
i
==
This
->
pobj
->
nb_members
)
{
WARN
(
"Unknown member '%s'
\n
"
,
szMember
);
return
DXFILEERR_BADDATAREFERENCE
;
}
*
pcbSize
=
This
->
pobj
->
members
[
i
].
size
;
*
ppvData
=
This
->
pobj
->
root
->
pdata
+
This
->
pobj
->
members
[
i
].
start
;
}
else
{
*
pcbSize
=
This
->
pobj
->
size
;
*
ppvData
=
This
->
pobj
->
root
->
pdata
+
This
->
pobj
->
pos_data
;
}
*
pcbSize
=
This
->
pobj
->
size
;
*
ppvData
=
This
->
pobj
->
root
->
pdata
+
This
->
pobj
->
pos_data
;
return
DXFILE_OK
;
}
...
...
dlls/d3dxof/parsing.c
View file @
d581f1bf
...
...
@@ -1149,6 +1149,8 @@ static BOOL parse_object_members_list(parse_buffer * buf)
int
i
;
xtemplate
*
pt
=
buf
->
pxt
[
buf
->
level
];
buf
->
pxo
->
nb_members
=
pt
->
nb_members
;
for
(
i
=
0
;
i
<
pt
->
nb_members
;
i
++
)
{
int
k
;
...
...
@@ -1295,6 +1297,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
if
((
token
!=
TOKEN_SEMICOLON
)
&&
(
token
!=
TOKEN_COMMA
))
return
FALSE
;
}
buf
->
pxo
->
members
[
i
].
size
=
buf
->
cur_pos_data
-
buf
->
pxo
->
members
[
i
].
start
;
}
return
TRUE
;
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
d581f1bf
...
...
@@ -204,12 +204,38 @@ static void test_CreateEnumObject(void)
hr
=
IDirectXFileEnumObject_GetNextDataObject
(
lpdxfeo
,
&
lpdxfd
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileEnumObject_GetNextDataObject: %x
\n
"
,
hr
);
/* Get all data (szMember == NULL) */
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
NULL
,
&
size
,
(
void
**
)
&
pdata
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
8
,
"Retrieved data size is wrong
\n
"
);
ok
(
size
==
8
,
"Retrieved data size is wrong
(%u instead of 8)
\n
"
,
size
);
ok
((
*
((
WORD
*
)
pdata
)
==
1
)
&&
(
*
((
WORD
*
)(
pdata
+
2
))
==
2
)
&&
(
*
((
DWORD
*
)(
pdata
+
4
))
==
3
),
"Retrieved data is wrong
\n
"
);
/* Get only "major" member (szMember == "major") */
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
"major"
,
&
size
,
(
void
**
)
&
pdata
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
2
,
"Retrieved data size is wrong (%u instead of 2)
\n
"
,
size
);
ok
(
*
((
WORD
*
)
pdata
)
==
1
,
"Retrieved data is wrong (%u instead of 1)
\n
"
,
*
((
WORD
*
)
pdata
));
/* Get only "minor" member (szMember == "minor") */
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
"minor"
,
&
size
,
(
void
**
)
&
pdata
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
2
,
"Retrieved data size is wrong (%u instead of 2)
\n
"
,
size
);
ok
(
*
((
WORD
*
)
pdata
)
==
2
,
"Retrieved data is wrong (%u instead of 2)
\n
"
,
*
((
WORD
*
)
pdata
));
/* Get only "flags" member (szMember == "flags") */
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
"flags"
,
&
size
,
(
void
**
)
&
pdata
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
4
,
"Retrieved data size is wrong (%u instead of 4)
\n
"
,
size
);
ok
(
*
((
WORD
*
)
pdata
)
==
3
,
"Retrieved data is wrong (%u instead of 3)
\n
"
,
*
((
WORD
*
)
pdata
));
/* Try to get not existing member (szMember == "unknown") */
hr
=
IDirectXFileData_GetData
(
lpdxfd
,
"unknow"
,
&
size
,
(
void
**
)
&
pdata
);
ok
(
hr
==
DXFILEERR_BADDATAREFERENCE
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ref
=
IDirectXFileEnumObject_Release
(
lpdxfeo
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
...
...
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