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
8f207560
Commit
8f207560
authored
Nov 21, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Test MsiRecordGetString on an integer record fields with a NULL output buffer.
parent
99129d20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
record.c
dlls/msi/record.c
+7
-4
record.c
dlls/msi/tests/record.c
+9
-0
No files found.
dlls/msi/record.c
View file @
8f207560
...
...
@@ -273,7 +273,7 @@ UINT MSI_RecordSetInteger( MSIRECORD *rec, unsigned int iField, int iVal )
if
(
iField
>
rec
->
count
)
return
ERROR_INVALID_PARAMETER
;
MSI_FreeField
(
&
rec
->
fields
[
iField
]
);
rec
->
fields
[
iField
].
type
=
MSIFIELD_INT
;
rec
->
fields
[
iField
].
u
.
iVal
=
iVal
;
...
...
@@ -346,7 +346,8 @@ UINT MSI_RecordGetStringA(MSIRECORD *rec, unsigned int iField,
case
MSIFIELD_INT
:
wsprintfA
(
buffer
,
"%d"
,
rec
->
fields
[
iField
].
u
.
iVal
);
len
=
lstrlenA
(
buffer
);
lstrcpynA
(
szValue
,
buffer
,
*
pcchValue
);
if
(
szValue
)
lstrcpynA
(
szValue
,
buffer
,
*
pcchValue
);
break
;
case
MSIFIELD_WSTR
:
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
rec
->
fields
[
iField
].
u
.
szwVal
,
-
1
,
...
...
@@ -421,11 +422,13 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, unsigned int iField,
case
MSIFIELD_INT
:
wsprintfW
(
buffer
,
szFormat
,
rec
->
fields
[
iField
].
u
.
iVal
);
len
=
lstrlenW
(
buffer
);
lstrcpynW
(
szValue
,
buffer
,
*
pcchValue
);
if
(
szValue
)
lstrcpynW
(
szValue
,
buffer
,
*
pcchValue
);
break
;
case
MSIFIELD_WSTR
:
len
=
lstrlenW
(
rec
->
fields
[
iField
].
u
.
szwVal
);
lstrcpynW
(
szValue
,
rec
->
fields
[
iField
].
u
.
szwVal
,
*
pcchValue
);
if
(
szValue
)
lstrcpynW
(
szValue
,
rec
->
fields
[
iField
].
u
.
szwVal
,
*
pcchValue
);
break
;
case
MSIFIELD_NULL
:
len
=
1
;
...
...
dlls/msi/tests/record.c
View file @
8f207560
...
...
@@ -250,6 +250,10 @@ static void test_msirecord(void)
/* same record, try converting integers to strings */
r
=
MsiRecordSetInteger
(
h
,
0
,
32
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to set integer at 0 to 32
\n
"
);
sz
=
1
;
r
=
MsiRecordGetString
(
h
,
0
,
NULL
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get string from integer
\n
"
);
ok
(
sz
==
2
,
"length wrong
\n
"
);
buf
[
0
]
=
0
;
sz
=
sizeof
buf
;
r
=
MsiRecordGetString
(
h
,
0
,
buf
,
&
sz
);
...
...
@@ -258,10 +262,15 @@ static void test_msirecord(void)
r
=
MsiRecordSetInteger
(
h
,
0
,
-
32
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to set integer at 0 to 32
\n
"
);
buf
[
0
]
=
0
;
sz
=
1
;
r
=
MsiRecordGetString
(
h
,
0
,
NULL
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get string from integer
\n
"
);
ok
(
sz
==
3
,
"length wrong
\n
"
);
sz
=
sizeof
buf
;
r
=
MsiRecordGetString
(
h
,
0
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get string from integer
\n
"
);
ok
(
0
==
strcmp
(
buf
,
"-32"
),
"failed to get string from integer
\n
"
);
buf
[
0
]
=
0
;
/* same record, now try streams */
r
=
MsiRecordSetStream
(
h
,
0
,
NULL
);
...
...
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