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
0867e48d
Commit
0867e48d
authored
Sep 06, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix MsiSummaryInfoGetProperty to return ERROR_MORE_DATA if the
buffer is too small (based on a patch by Aric Stewart) - add a test case to show correct behaviour
parent
575b4116
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
suminfo.c
dlls/msi/suminfo.c
+4
-1
suminfo.c
dlls/msi/tests/suminfo.c
+20
-4
No files found.
dlls/msi/suminfo.c
View file @
0867e48d
...
@@ -544,6 +544,7 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
...
@@ -544,6 +544,7 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
{
{
MSISUMMARYINFO
*
si
;
MSISUMMARYINFO
*
si
;
PROPVARIANT
*
prop
;
PROPVARIANT
*
prop
;
UINT
ret
=
ERROR_SUCCESS
;
TRACE
(
"%ld %d %p %p %p %p %p
\n
"
,
handle
,
uiProperty
,
puiDataType
,
TRACE
(
"%ld %d %p %p %p %p %p
\n
"
,
handle
,
uiProperty
,
puiDataType
,
piValue
,
pftValue
,
str
,
pcchValueBuf
);
piValue
,
pftValue
,
str
,
pcchValueBuf
);
...
@@ -583,6 +584,8 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
...
@@ -583,6 +584,8 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
if
(
str
->
str
.
a
)
if
(
str
->
str
.
a
)
lstrcpynA
(
str
->
str
.
a
,
prop
->
u
.
pszVal
,
*
pcchValueBuf
);
lstrcpynA
(
str
->
str
.
a
,
prop
->
u
.
pszVal
,
*
pcchValueBuf
);
}
}
if
(
len
>=
*
pcchValueBuf
)
ret
=
ERROR_MORE_DATA
;
*
pcchValueBuf
=
len
;
*
pcchValueBuf
=
len
;
}
}
break
;
break
;
...
@@ -597,7 +600,7 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
...
@@ -597,7 +600,7 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
break
;
break
;
}
}
msiobj_release
(
&
si
->
hdr
);
msiobj_release
(
&
si
->
hdr
);
return
ERROR_SUCCESS
;
return
ret
;
}
}
UINT
WINAPI
MsiSummaryInfoGetPropertyA
(
UINT
WINAPI
MsiSummaryInfoGetPropertyA
(
...
...
dlls/msi/tests/suminfo.c
View file @
0867e48d
...
@@ -67,7 +67,7 @@ START_TEST(suminfo)
...
@@ -67,7 +67,7 @@ START_TEST(suminfo)
const
char
*
msifile
=
"winetest.msi"
;
const
char
*
msifile
=
"winetest.msi"
;
MSIHANDLE
hdb
=
0
,
hsuminfo
;
MSIHANDLE
hdb
=
0
,
hsuminfo
;
UINT
r
,
count
,
type
;
UINT
r
,
count
,
type
;
DWORD
dwcount
;
DWORD
sz
;
INT
val
;
INT
val
;
FILETIME
ft
;
FILETIME
ft
;
char
buf
[
0x10
];
char
buf
[
0x10
];
...
@@ -112,11 +112,11 @@ START_TEST(suminfo)
...
@@ -112,11 +112,11 @@ START_TEST(suminfo)
buf
[
0
]
=
'x'
;
buf
[
0
]
=
'x'
;
buf
[
1
]
=
0
;
buf
[
1
]
=
0
;
dwcount
=
0x10
;
sz
=
0x10
;
r
=
MsiSummaryInfoGetProperty
(
hsuminfo
,
PID_REVNUMBER
,
&
type
,
&
val
,
NULL
,
buf
,
&
dwcount
);
r
=
MsiSummaryInfoGetProperty
(
hsuminfo
,
PID_REVNUMBER
,
&
type
,
&
val
,
NULL
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"getpropcount failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"getpropcount failed
\n
"
);
ok
(
buf
[
0
]
==
'x'
,
"cleared buffer
\n
"
);
ok
(
buf
[
0
]
==
'x'
,
"cleared buffer
\n
"
);
ok
(
dwcount
==
0x10
,
"count wasn't zero
\n
"
);
ok
(
sz
==
0x10
,
"count wasn't zero
\n
"
);
ok
(
type
==
VT_EMPTY
,
"should be empty
\n
"
);
ok
(
type
==
VT_EMPTY
,
"should be empty
\n
"
);
r
=
MsiSummaryInfoSetProperty
(
hsuminfo
,
PID_TITLE
,
VT_LPSTR
,
0
,
NULL
,
"Mike"
);
r
=
MsiSummaryInfoSetProperty
(
hsuminfo
,
PID_TITLE
,
VT_LPSTR
,
0
,
NULL
,
"Mike"
);
...
@@ -177,6 +177,22 @@ START_TEST(suminfo)
...
@@ -177,6 +177,22 @@ START_TEST(suminfo)
r
=
MsiSummaryInfoSetProperty
(
hsuminfo
,
PID_TITLE
,
VT_LPSTR
,
0
,
NULL
,
"Mike"
);
r
=
MsiSummaryInfoSetProperty
(
hsuminfo
,
PID_TITLE
,
VT_LPSTR
,
0
,
NULL
,
"Mike"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiSummaryInfoSetProperty failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiSummaryInfoSetProperty failed
\n
"
);
sz
=
2
;
strcpy
(
buf
,
"x"
);
r
=
MsiSummaryInfoGetProperty
(
hsuminfo
,
PID_TITLE
,
&
type
,
NULL
,
NULL
,
buf
,
&
sz
);
ok
(
r
==
ERROR_MORE_DATA
,
"MsiSummaryInfoSetProperty failed
\n
"
);
ok
(
sz
==
4
,
"count was wrong
\n
"
);
ok
(
type
==
VT_LPSTR
,
"type was wrong
\n
"
);
ok
(
!
strcmp
(
buf
,
"M"
),
"buffer was wrong
\n
"
);
sz
=
4
;
strcpy
(
buf
,
"x"
);
r
=
MsiSummaryInfoGetProperty
(
hsuminfo
,
PID_TITLE
,
&
type
,
NULL
,
NULL
,
buf
,
&
sz
);
ok
(
r
==
ERROR_MORE_DATA
,
"MsiSummaryInfoSetProperty failed
\n
"
);
ok
(
sz
==
4
,
"count was wrong
\n
"
);
ok
(
type
==
VT_LPSTR
,
"type was wrong
\n
"
);
ok
(
!
strcmp
(
buf
,
"Mik"
),
"buffer was wrong
\n
"
);
r
=
MsiSummaryInfoSetProperty
(
hsuminfo
,
PID_TITLE
,
VT_LPSTR
,
0
,
NULL
,
"JungAh"
);
r
=
MsiSummaryInfoSetProperty
(
hsuminfo
,
PID_TITLE
,
VT_LPSTR
,
0
,
NULL
,
"JungAh"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiSummaryInfoSetProperty failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiSummaryInfoSetProperty failed
\n
"
);
...
...
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