mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 07:41:51 +00:00
Sync to Wine-0_9_4:
Magnus Olsen <magnus@itkonsult-olsen.com> - msi: Fixed deformat_environment to not cut off string. Bill Medland <billmedland@mercuryspeed.com> - msi: Use a default dialog font if nothing is specified. - msi: Prevent array underflow in MsiFormat when measuring with zero-length buffer. svn path=/trunk/; revision=20349
This commit is contained in:
parent
1ec4f54cc9
commit
907803cd6d
2 changed files with 14 additions and 1 deletions
|
@ -1618,6 +1618,8 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
|
||||||
{
|
{
|
||||||
static const WCHAR df[] = {
|
static const WCHAR df[] = {
|
||||||
'D','e','f','a','u','l','t','U','I','F','o','n','t',0 };
|
'D','e','f','a','u','l','t','U','I','F','o','n','t',0 };
|
||||||
|
static const WCHAR dfv[] = {
|
||||||
|
'M','S',' ','S','h','e','l','l',' ','D','l','g',0 };
|
||||||
msi_dialog *dialog = (msi_dialog*) cs->lpCreateParams;
|
msi_dialog *dialog = (msi_dialog*) cs->lpCreateParams;
|
||||||
MSIRECORD *rec = NULL;
|
MSIRECORD *rec = NULL;
|
||||||
LPWSTR title = NULL;
|
LPWSTR title = NULL;
|
||||||
|
@ -1644,6 +1646,11 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
|
||||||
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
|
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
|
||||||
|
|
||||||
dialog->default_font = msi_dup_property( dialog->package, df );
|
dialog->default_font = msi_dup_property( dialog->package, df );
|
||||||
|
if (!dialog->default_font)
|
||||||
|
{
|
||||||
|
dialog->default_font = strdupW(dfv);
|
||||||
|
if (!dialog->default_font) return -1;
|
||||||
|
}
|
||||||
|
|
||||||
title = msi_get_deformatted_field( dialog->package, rec, 7 );
|
title = msi_get_deformatted_field( dialog->package, rec, 7 );
|
||||||
SetWindowTextW( hwnd, title );
|
SetWindowTextW( hwnd, title );
|
||||||
|
|
|
@ -639,10 +639,15 @@ UINT MSI_FormatRecordA( MSIPACKAGE* package, MSIRECORD* record, LPSTR buffer,
|
||||||
|
|
||||||
len = deformat_string_internal(package,rec,&deformated,strlenW(rec),
|
len = deformat_string_internal(package,rec,&deformated,strlenW(rec),
|
||||||
record, NULL);
|
record, NULL);
|
||||||
|
/* If len is zero then WideCharToMultiByte will return 0 indicating
|
||||||
|
* failure, but that will do just as well since we are ignoring
|
||||||
|
* possible errors.
|
||||||
|
*/
|
||||||
lenA = WideCharToMultiByte(CP_ACP,0,deformated,len,NULL,0,NULL,NULL);
|
lenA = WideCharToMultiByte(CP_ACP,0,deformated,len,NULL,0,NULL,NULL);
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
|
/* Ditto above */
|
||||||
WideCharToMultiByte(CP_ACP,0,deformated,len,buffer,*size,NULL, NULL);
|
WideCharToMultiByte(CP_ACP,0,deformated,len,buffer,*size,NULL, NULL);
|
||||||
if (*size>lenA)
|
if (*size>lenA)
|
||||||
{
|
{
|
||||||
|
@ -652,6 +657,7 @@ UINT MSI_FormatRecordA( MSIPACKAGE* package, MSIRECORD* record, LPSTR buffer,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = ERROR_MORE_DATA;
|
rc = ERROR_MORE_DATA;
|
||||||
|
if (*size)
|
||||||
buffer[(*size)-1] = 0;
|
buffer[(*size)-1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue