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
018bc9a0
Commit
018bc9a0
authored
May 27, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
May 27, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test and fix the size of stream fields in a record.
parent
d757bfee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
record.c
dlls/msi/record.c
+13
-0
record.c
dlls/msi/tests/record.c
+6
-0
No files found.
dlls/msi/record.c
View file @
018bc9a0
...
...
@@ -410,6 +410,17 @@ UINT WINAPI MsiRecordGetStringW(MSIHANDLE handle, unsigned int iField,
return
ret
;
}
static
UINT
msi_get_stream_size
(
IStream
*
stm
)
{
STATSTG
stat
;
HRESULT
r
;
r
=
IStream_Stat
(
stm
,
&
stat
,
STATFLAG_NONAME
);
if
(
FAILED
(
r
)
)
return
0
;
return
stat
.
cbSize
.
QuadPart
;
}
UINT
MSI_RecordDataSize
(
MSIRECORD
*
rec
,
unsigned
int
iField
)
{
TRACE
(
"%p %d
\n
"
,
rec
,
iField
);
...
...
@@ -425,6 +436,8 @@ UINT MSI_RecordDataSize(MSIRECORD *rec, unsigned int iField)
return
lstrlenW
(
rec
->
fields
[
iField
].
u
.
szwVal
);
case
MSIFIELD_NULL
:
break
;
case
MSIFIELD_STREAM
:
return
msi_get_stream_size
(
rec
->
fields
[
iField
].
u
.
stream
);
}
return
0
;
}
...
...
dlls/msi/tests/record.c
View file @
018bc9a0
...
...
@@ -220,6 +220,10 @@ void test_msirecord(void)
r
=
MsiRecordReadStream
(
h
,
0
,
buf
,
&
sz
);
ok
(
r
==
ERROR_INVALID_DATATYPE
,
"read non-stream type
\n
"
);
ok
(
sz
==
sizeof
buf
,
"set sz
\n
"
);
r
=
MsiRecordDataSize
(
h
,
-
1
);
ok
(
r
==
0
,
"MsiRecordDataSize returned wrong size
\n
"
);
r
=
MsiRecordDataSize
(
h
,
0
);
ok
(
r
==
4
,
"MsiRecordDataSize returned wrong size
\n
"
);
/* same record, now close it */
r
=
MsiCloseHandle
(
h
);
...
...
@@ -279,6 +283,8 @@ void test_msirecord(void)
r
=
MsiRecordReadStream
(
h
,
1
,
NULL
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"bytes left wrong after reset
\n
"
);
ok
(
sz
==
26
,
"couldn't get size of stream
\n
"
);
r
=
MsiRecordDataSize
(
h
,
1
);
ok
(
r
==
26
,
"MsiRecordDataSize returned wrong size
\n
"
);
/* now close the stream record */
r
=
MsiCloseHandle
(
h
);
...
...
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