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
c37ada25
Commit
c37ada25
authored
Mar 08, 2010
by
Christian Costa
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Avoid using strlen for specifying templates or objects size.
parent
41fdff86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+13
-13
No files found.
dlls/d3dxof/tests/d3dxof.c
View file @
c37ada25
...
...
@@ -111,11 +111,11 @@ static void test_refcount(void)
ref
=
IDirectXFile_Release
(
lpDirectXFile
);
ok
(
ref
==
1
,
"Got refcount %d, expected 1
\n
"
,
ref
);
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template
,
s
trlen
(
template
)
);
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template
,
s
izeof
(
template
)
-
1
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
dxflm
.
lpMemory
=
&
object
;
dxflm
.
dSize
=
s
trlen
(
object
)
;
dxflm
.
dSize
=
s
izeof
(
object
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
lpDirectXFile
,
&
dxflm
,
DXFILELOAD_FROMMEMORY
,
&
lpdxfeo
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
ref
=
getRefcount
(
(
IUnknown
*
)
lpDirectXFile
);
...
...
@@ -176,11 +176,11 @@ static void test_CreateEnumObject(void)
return
;
}
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template
,
s
trlen
(
template
)
);
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
template
,
s
izeof
(
template
)
-
1
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
dxflm
.
lpMemory
=
&
object
;
dxflm
.
dSize
=
s
trlen
(
object
)
;
dxflm
.
dSize
=
s
izeof
(
object
)
-
1
;
/* 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
);
...
...
@@ -225,10 +225,10 @@ static void test_file_types(void)
return
;
}
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_txt_file
,
s
trlen
(
empty_txt_file
)
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_txt_file
,
s
izeof
(
empty_txt_file
)
-
1
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_bin_file
,
s
trlen
(
empty_bin_file
)
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_bin_file
,
s
izeof
(
empty_bin_file
)
-
1
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_tzip_file
,
sizeof
(
empty_tzip_file
)
-
1
);
...
...
@@ -237,20 +237,20 @@ static void test_file_types(void)
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_bzip_file
,
sizeof
(
empty_bzip_file
)
-
1
);
todo_wine
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_cmp_file
,
s
trlen
(
empty_cmp_file
)
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_cmp_file
,
s
izeof
(
empty_cmp_file
)
-
1
);
ok
(
hr
==
DXFILEERR_BADFILETYPE
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_xxxx_file
,
s
trlen
(
empty_xxxx_file
)
);
hr
=
IDirectXFile_RegisterTemplates
(
dxfile
,
empty_xxxx_file
,
s
izeof
(
empty_xxxx_file
)
-
1
);
ok
(
hr
==
DXFILEERR_BADFILETYPE
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
lminfo
.
lpMemory
=
empty_txt_file
;
lminfo
.
dSize
=
s
trlen
(
empty_txt_file
)
;
lminfo
.
dSize
=
s
izeof
(
empty_txt_file
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
dxfile
,
&
lminfo
,
DXFILELOAD_FROMMEMORY
,
&
enum_object
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
if
(
hr
==
DXFILE_OK
)
IDirectXFileEnumObject_Release
(
enum_object
);
lminfo
.
lpMemory
=
empty_bin_file
;
lminfo
.
dSize
=
s
trlen
(
empty_bin_file
)
;
lminfo
.
dSize
=
s
izeof
(
empty_bin_file
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
dxfile
,
&
lminfo
,
DXFILELOAD_FROMMEMORY
,
&
enum_object
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
if
(
hr
==
DXFILE_OK
)
IDirectXFileEnumObject_Release
(
enum_object
);
...
...
@@ -268,12 +268,12 @@ static void test_file_types(void)
if
(
hr
==
DXFILE_OK
)
IDirectXFileEnumObject_Release
(
enum_object
);
lminfo
.
lpMemory
=
empty_cmp_file
;
lminfo
.
dSize
=
s
trlen
(
empty_cmp_file
)
;
lminfo
.
dSize
=
s
izeof
(
empty_cmp_file
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
dxfile
,
&
lminfo
,
DXFILELOAD_FROMMEMORY
,
&
enum_object
);
ok
(
hr
==
DXFILEERR_BADFILETYPE
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
lminfo
.
lpMemory
=
empty_xxxx_file
;
lminfo
.
dSize
=
s
trlen
(
empty_xxxx_file
)
;
lminfo
.
dSize
=
s
izeof
(
empty_xxxx_file
)
-
1
;
hr
=
IDirectXFile_CreateEnumObject
(
dxfile
,
&
lminfo
,
DXFILELOAD_FROMMEMORY
,
&
enum_object
);
ok
(
hr
==
DXFILEERR_BADFILETYPE
,
"IDirectXFile_CreateEnumObject: %x
\n
"
,
hr
);
...
...
@@ -421,7 +421,7 @@ static void test_dump(void)
goto
exit
;
}
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
pvData
,
strlen
(
pvData
)
);
hr
=
IDirectXFile_RegisterTemplates
(
lpDirectXFile
,
pvData
,
cbSize
);
ok
(
hr
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates: %x
\n
"
,
hr
);
hr
=
IDirectXFile_CreateEnumObject
(
lpDirectXFile
,
(
LPVOID
)
"objects.txt"
,
DXFILELOAD_FROMFILE
,
&
lpDirectXFileEnumObject
);
...
...
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