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
0d56df21
Commit
0d56df21
authored
Feb 11, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Successfully return an empty string when requesting a record index beyond the record's size.
parent
2750ed16
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
record.c
dlls/msi/record.c
+14
-2
record.c
dlls/msi/tests/record.c
+28
-0
No files found.
dlls/msi/record.c
View file @
0d56df21
...
...
@@ -338,7 +338,13 @@ UINT MSI_RecordGetStringA(MSIRECORD *rec, UINT iField,
TRACE
(
"%p %d %p %p
\n
"
,
rec
,
iField
,
szValue
,
pcchValue
);
if
(
iField
>
rec
->
count
)
return
ERROR_INVALID_PARAMETER
;
{
if
(
szValue
&&
*
pcchValue
>
0
)
szValue
[
0
]
=
0
;
*
pcchValue
=
0
;
return
ERROR_SUCCESS
;
}
ret
=
ERROR_SUCCESS
;
switch
(
rec
->
fields
[
iField
].
type
)
...
...
@@ -414,7 +420,13 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField,
TRACE
(
"%p %d %p %p
\n
"
,
rec
,
iField
,
szValue
,
pcchValue
);
if
(
iField
>
rec
->
count
)
return
ERROR_INVALID_PARAMETER
;
{
if
(
szValue
&&
*
pcchValue
>
0
)
szValue
[
0
]
=
0
;
*
pcchValue
=
0
;
return
ERROR_SUCCESS
;
}
ret
=
ERROR_SUCCESS
;
switch
(
rec
->
fields
[
iField
].
type
)
...
...
dlls/msi/tests/record.c
View file @
0d56df21
...
...
@@ -351,7 +351,35 @@ static void test_msirecord(void)
DeleteFile
(
filename
);
/* Delete it for sure, when everything else is closed. */
}
static
void
test_MsiRecordGetString
(
void
)
{
MSIHANDLE
rec
;
CHAR
buf
[
MAX_PATH
];
DWORD
sz
;
UINT
r
;
rec
=
MsiCreateRecord
(
2
);
ok
(
rec
!=
0
,
"Expected a valid handle
\n
"
);
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiRecordGetString
(
rec
,
1
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiRecordGetString
(
rec
,
10
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
MsiCloseHandle
(
rec
);
}
START_TEST
(
record
)
{
test_msirecord
();
test_MsiRecordGetString
();
}
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