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
4407ea63
Commit
4407ea63
authored
Sep 21, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure not to free a a pointer that has been modified.
Check that the text identifier doesn't contain invalid characters.
parent
0c2fcf2e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
dialog.c
dlls/msi/dialog.c
+22
-14
No files found.
dlls/msi/dialog.c
View file @
4407ea63
...
@@ -179,22 +179,29 @@ static LPWSTR msi_get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, in
...
@@ -179,22 +179,29 @@ static LPWSTR msi_get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, in
* Extract the {\style} string from the front of the text to display and
* Extract the {\style} string from the front of the text to display and
* update the pointer.
* update the pointer.
*/
*/
static
LPWSTR
msi_dialog_get_style
(
LP
WSTR
*
tex
t
)
static
LPWSTR
msi_dialog_get_style
(
LP
CWSTR
p
,
LPCWSTR
*
res
t
)
{
{
LPWSTR
ret
=
NULL
;
LPWSTR
ret
=
NULL
;
LP
WSTR
p
=
*
text
,
q
;
LP
CWSTR
q
,
i
;
DWORD
len
;
DWORD
len
;
if
(
!*
text
)
*
rest
=
p
;
if
(
!
p
)
return
ret
;
return
ret
;
if
(
*
p
++
!=
'{'
)
if
(
*
p
++
!=
'{'
)
return
ret
;
return
ret
;
q
=
strchrW
(
p
,
'}'
);
q
=
strchrW
(
p
,
'}'
);
if
(
!
q
)
if
(
!
q
)
return
ret
;
return
ret
;
*
text
=
++
q
;
if
(
*
p
++
!=
'\\'
)
if
(
*
p
++
!=
'\\'
)
return
ret
;
return
ret
;
/* little bit of sanity checking to stop us getting confused with RTF */
for
(
i
=
p
;
i
<
q
;
i
++
)
if
(
*
i
==
'}'
||
*
i
==
'\\'
)
return
ret
;
*
rest
=
++
q
;
len
=
q
-
p
;
len
=
q
-
p
;
ret
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
ret
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
...
@@ -299,7 +306,8 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
...
@@ -299,7 +306,8 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
DWORD
style
,
HWND
parent
)
DWORD
style
,
HWND
parent
)
{
{
DWORD
x
,
y
,
width
,
height
;
DWORD
x
,
y
,
width
,
height
;
LPWSTR
font
=
NULL
,
title
=
NULL
;
LPWSTR
font
=
NULL
,
title_font
=
NULL
;
LPCWSTR
title
=
NULL
;
msi_control
*
control
;
msi_control
*
control
;
style
|=
WS_CHILD
;
style
|=
WS_CHILD
;
...
@@ -327,8 +335,8 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
...
@@ -327,8 +335,8 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
if
(
text
)
if
(
text
)
{
{
deformat_string
(
dialog
->
package
,
text
,
&
title
);
deformat_string
(
dialog
->
package
,
text
,
&
title
_font
);
font
=
msi_dialog_get_style
(
&
title
);
font
=
msi_dialog_get_style
(
title_font
,
&
title
);
}
}
control
->
hwnd
=
CreateWindowW
(
szCls
,
title
,
style
,
control
->
hwnd
=
CreateWindowW
(
szCls
,
title
,
style
,
...
@@ -340,8 +348,8 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
...
@@ -340,8 +348,8 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
msi_dialog_set_font
(
dialog
,
control
->
hwnd
,
msi_dialog_set_font
(
dialog
,
control
->
hwnd
,
font
?
font
:
dialog
->
default_font
);
font
?
font
:
dialog
->
default_font
);
msi_free
(
title_font
);
msi_free
(
font
);
msi_free
(
font
);
msi_free
(
title
);
return
control
;
return
control
;
}
}
...
@@ -1056,16 +1064,16 @@ msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font )
...
@@ -1056,16 +1064,16 @@ msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font )
/* office 2003 uses "73931<````=````=````=````=`````>@@@@@" */
/* office 2003 uses "73931<````=````=````=````=`````>@@@@@" */
static
UINT
msi_dialog_maskedit_control
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
)
static
UINT
msi_dialog_maskedit_control
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
)
{
{
LPWSTR
mask
,
title
=
NULL
,
val
=
NULL
,
font
;
LPWSTR
font_mask
,
val
=
NULL
,
font
;
struct
msi_maskedit_info
*
info
=
NULL
;
struct
msi_maskedit_info
*
info
=
NULL
;
UINT
ret
=
ERROR_SUCCESS
;
UINT
ret
=
ERROR_SUCCESS
;
msi_control
*
control
;
msi_control
*
control
;
LPCWSTR
prop
;
LPCWSTR
prop
,
mask
;
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
mask
=
msi_get_deformatted_field
(
dialog
->
package
,
rec
,
10
);
font_
mask
=
msi_get_deformatted_field
(
dialog
->
package
,
rec
,
10
);
font
=
msi_dialog_get_style
(
&
mask
);
font
=
msi_dialog_get_style
(
font_mask
,
&
mask
);
if
(
!
mask
)
if
(
!
mask
)
{
{
ERR
(
"mask template is empty
\n
"
);
ERR
(
"mask template is empty
\n
"
);
...
@@ -1117,8 +1125,8 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
...
@@ -1117,8 +1125,8 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
end:
end:
if
(
ret
!=
ERROR_SUCCESS
)
if
(
ret
!=
ERROR_SUCCESS
)
msi_free
(
info
);
msi_free
(
info
);
msi_free
(
title
);
msi_free
(
font_mask
);
msi_free
(
mask
);
msi_free
(
font
);
return
ret
;
return
ret
;
}
}
...
...
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