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
67488dec
Commit
67488dec
authored
Mar 09, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Mar 13, 2012
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Do not allow separator to terminate the string. Only the double quote can do that.
parent
0ff72271
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
1 deletion
+66
-1
parsing.c
dlls/d3dxof/parsing.c
+2
-1
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+64
-0
No files found.
dlls/d3dxof/parsing.c
View file @
67488dec
...
...
@@ -605,8 +605,9 @@ static BOOL is_string(parse_buffer* buf)
if
(
*
buf
->
buffer
!=
'"'
)
return
FALSE
;
while
((
pos
+
1
)
<
buf
->
rem_bytes
&&
!
is_operator
(
c
=
*
(
buf
->
buffer
+
pos
+
1
))
)
while
((
pos
+
1
)
<
buf
->
rem_bytes
)
{
c
=
*
(
buf
->
buffer
+
pos
+
1
);
if
(
c
==
'"'
)
{
ok
=
1
;
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
67488dec
...
...
@@ -118,6 +118,27 @@ static char object_syntax_empty_array_nosemicolon[] =
"1234;
\n
"
"}
\n
"
;
static
char
template_syntax_string
[]
=
"xof 0302txt 0064
\n
"
"template Filename
\n
"
"{
\n
"
"<3D82AB43-62DA-11CF-AB39-0020AF71E433>
\n
"
"STRING filename;
\n
"
"}
\n
"
;
static
char
object_syntax_string_normal
[]
=
"xof 0302txt 0064
\n
"
"Filename
\n
"
"{
\n
"
"
\"
foobar
\"
;
\n
"
"}
\n
"
;
static
char
object_syntax_string_with_separator
[]
=
"xof 0302txt 0064
\n
"
"Filename
\n
"
"{
\n
"
"
\"
foo;bar
\"
;
\n
"
"}
\n
"
;
static
void
init_function_pointers
(
void
)
{
...
...
@@ -493,6 +514,8 @@ static void test_syntax(void)
LPDIRECTXFILEENUMOBJECT
lpdxfeo
;
LPDIRECTXFILEDATA
lpdxfd
;
DXFILELOADMEMORY
dxflm
;
DWORD
size
;
char
**
string
;
if
(
!
pDirectXFileCreate
)
{
...
...
@@ -541,6 +564,47 @@ static void test_syntax(void)
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template_syntax_string
,
sizeof
(
template_syntax_string
)
-
1
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
dxflm
.
lpMemory
=
&
object_syntax_string_normal
;
dxflm
.
dSize
=
sizeof
(
object_syntax_string_normal
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
lpDirectXFile
,
&
dxflm
,
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
**
)
&
string
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
sizeof
(
char
*
),
"Got wrong data size %d
\n
"
,
size
);
ok
(
!
strcmp
(
*
string
,
"foobar"
),
"Got string %s, expected foobar
\n
"
,
*
string
);
ref
=
IDirectXFileEnumObject_Release
(
lpdxfeo
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
if
(
hr
==
DXFILE_OK
)
{
ref
=
IDirectXFileData_Release
(
lpdxfd
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
dxflm
.
lpMemory
=
&
object_syntax_string_with_separator
;
dxflm
.
dSize
=
sizeof
(
object_syntax_string_with_separator
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
lpDirectXFile
,
&
dxflm
,
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
**
)
&
string
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileData_GetData: %x
\n
"
,
hr
);
ok
(
size
==
sizeof
(
char
*
),
"Got wrong data size %d
\n
"
,
size
);
ok
(
!
strcmp
(
*
string
,
"foo;bar"
),
"Got string %s, expected foo;bar
\n
"
,
*
string
);
ref
=
IDirectXFileEnumObject_Release
(
lpdxfeo
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
if
(
hr
==
DXFILE_OK
)
{
ref
=
IDirectXFileData_Release
(
lpdxfd
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
ref
=
IDirectXFile_Release
(
lpDirectXFile
);
ok
(
ref
==
0
,
"Got refcount %d, expected 0
\n
"
,
ref
);
}
...
...
Vitaly Lipatov
@lav
mentioned in commit
1345ad4a
·
Sep 03, 2020
mentioned in commit
1345ad4a
mentioned in commit 1345ad4a6d6471430fc591f797dde3501435d58c
Toggle commit list
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