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
48c4248d
Commit
48c4248d
authored
Nov 09, 2008
by
Christian Costa
Committed by
Alexandre Julliard
Nov 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Finish strings support.
parent
e4748c3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
d3dxof.c
dlls/d3dxof/d3dxof.c
+27
-10
d3dxof_private.h
dlls/d3dxof/d3dxof_private.h
+4
-0
No files found.
dlls/d3dxof/d3dxof.c
View file @
48c4248d
...
...
@@ -668,22 +668,21 @@ static BOOL is_integer(parse_buffer* buf)
static
BOOL
is_string
(
parse_buffer
*
buf
)
{
char
tmp
[
32
];
DWORD
pos
=
1
;
DWORD
pos
=
0
;
char
c
;
BOOL
ok
=
0
;
if
(
*
buf
->
buffer
!=
'"'
)
return
FALSE
;
tmp
[
0
]
=
'"'
;
while
(
!
is_separator
(
c
=
*
(
buf
->
buffer
+
pos
))
&&
(
pos
<
32
))
while
(
!
is_separator
(
c
=
*
(
buf
->
buffer
+
pos
+
1
))
&&
(
pos
<
31
))
{
tmp
[
pos
++
]
=
c
;
if
(
c
==
'"'
)
{
ok
=
1
;
break
;
}
tmp
[
pos
++
]
=
c
;
}
tmp
[
pos
]
=
0
;
...
...
@@ -693,8 +692,8 @@ static BOOL is_string(parse_buffer* buf)
return
FALSE
;
}
buf
->
buffer
+=
pos
;
buf
->
rem_bytes
-=
pos
;
buf
->
buffer
+=
pos
+
2
;
buf
->
rem_bytes
-=
pos
+
2
;
TRACE
(
"Found string %s
\n
"
,
tmp
);
strcpy
((
char
*
)
buf
->
value
,
tmp
);
...
...
@@ -1884,7 +1883,6 @@ static BOOL parse_object_members_list(parse_buffer * buf)
}
else
if
(
token
==
TOKEN_LPSTR
)
{
static
char
fake_string
[]
=
"Fake string"
;
get_TOKEN
(
buf
);
TRACE
(
"%s = %s
\n
"
,
pt
->
members
[
i
].
name
,
(
char
*
)
buf
->
value
);
/* Assume larger size */
...
...
@@ -1895,8 +1893,15 @@ static BOOL parse_object_members_list(parse_buffer * buf)
}
if
(
pt
->
members
[
i
].
type
==
TOKEN_LPSTR
)
{
/* Use a fake string for now */
*
(((
LPCSTR
*
)(
buf
->
cur_pdata
)))
=
fake_string
;
int
len
=
strlen
((
char
*
)
buf
->
value
)
+
1
;
if
((
buf
->
cur_pstrings
-
buf
->
pstrings
+
len
)
>
MAX_STRINGS_BUFFER
)
{
WARN
(
"Buffer too small %p %p %d
\n
"
,
buf
->
cur_pstrings
,
buf
->
pstrings
,
len
);
return
FALSE
;
}
strcpy
((
char
*
)
buf
->
cur_pstrings
,
(
char
*
)
buf
->
value
);
*
(((
LPCSTR
*
)(
buf
->
cur_pdata
)))
=
(
char
*
)
buf
->
cur_pstrings
;
buf
->
cur_pstrings
+=
len
;
buf
->
cur_pdata
+=
4
;
}
else
...
...
@@ -2067,6 +2072,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
IDirectXFileDataImpl
*
object
;
HRESULT
hr
;
LPBYTE
pdata
;
LPBYTE
pstrings
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
ppDataObj
);
...
...
@@ -2082,6 +2088,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
This
->
buf
.
pxo_tab
=
&
This
->
xobjects
[
This
->
nb_xobjects
][
0
];
This
->
buf
.
cur_subobject
=
0
;
This
->
buf
.
pxo
=
&
This
->
buf
.
pxo_tab
[
This
->
buf
.
cur_subobject
++
];
This
->
buf
.
level
=
0
;
pdata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_DATA_SIZE
);
if
(
!
pdata
)
...
...
@@ -2090,12 +2097,21 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
return
DXFILEERR_BADALLOC
;
}
This
->
buf
.
cur_pdata
=
pdata
;
This
->
buf
.
level
=
0
;
pstrings
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_STRINGS_BUFFER
);
if
(
!
pstrings
)
{
WARN
(
"Out of memory
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
buf
.
pxo
->
pdata
);
return
DXFILEERR_BADALLOC
;
}
This
->
buf
.
cur_pstrings
=
This
->
buf
.
pstrings
=
pstrings
;
if
(
!
parse_object
(
&
This
->
buf
))
{
TRACE
(
"Object is not correct
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
buf
.
pxo
->
pdata
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
buf
.
pstrings
);
return
DXFILEERR_PARSEERROR
;
}
...
...
@@ -2106,6 +2122,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
return
DXFILEERR_BADALLOC
;
}
object
->
pstrings
=
pstrings
;
object
->
pobj
=
This
->
buf
.
pxo
;
object
->
cur_enum_object
=
0
;
object
->
level
=
0
;
...
...
dlls/d3dxof/d3dxof_private.h
View file @
48c4248d
...
...
@@ -40,6 +40,7 @@
#define MAX_TEMPLATES 200
#define MAX_OBJECTS 200
#define MAX_SUBOBJECTS 120
#define MAX_STRINGS_BUFFER 200
typedef
struct
{
DWORD
type
;
...
...
@@ -101,6 +102,7 @@ typedef struct {
int
cur_enum_object
;
BOOL
from_ref
;
ULONG
level
;
LPBYTE
pstrings
;
}
IDirectXFileDataImpl
;
typedef
struct
{
...
...
@@ -124,6 +126,7 @@ typedef struct {
BOOL
txt
;
ULONG
cur_subobject
;
LPBYTE
cur_pdata
;
LPBYTE
cur_pstrings
;
BYTE
value
[
100
];
xobject
*
pxo_globals
;
ULONG
nb_pxo_globals
;
...
...
@@ -132,6 +135,7 @@ typedef struct {
xobject
*
pxo
;
xtemplate
*
pxt
[
MAX_SUBOBJECTS
];
ULONG
level
;
LPBYTE
pstrings
;
}
parse_buffer
;
typedef
struct
{
...
...
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