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
62029ff5
Commit
62029ff5
authored
Dec 13, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use FIELD_OFFSET for the size of structs with a varlength array.
parent
c34769cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
dialog.c
dlls/msi/dialog.c
+2
-2
record.c
dlls/msi/record.c
+2
-3
where.c
dlls/msi/where.c
+1
-1
No files found.
dlls/msi/dialog.c
View file @
62029ff5
...
@@ -1135,7 +1135,7 @@ static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
...
@@ -1135,7 +1135,7 @@ static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
msi_dialog_map_events
(
dialog
,
name
);
msi_dialog_map_events
(
dialog
,
name
);
control
=
msi_alloc
(
sizeof
(
*
control
)
+
strlenW
(
name
)
*
sizeof
(
WCHAR
)
);
control
=
msi_alloc
(
FIELD_OFFSET
(
msi_control
,
name
[
strlenW
(
name
)
+
1
]
)
);
if
(
!
control
)
if
(
!
control
)
return
ERROR_OUTOFMEMORY
;
return
ERROR_OUTOFMEMORY
;
...
@@ -3735,7 +3735,7 @@ msi_dialog *msi_dialog_create( MSIPACKAGE* package,
...
@@ -3735,7 +3735,7 @@ msi_dialog *msi_dialog_create( MSIPACKAGE* package,
msi_dialog_register_class
();
msi_dialog_register_class
();
/* allocate the structure for the dialog to use */
/* allocate the structure for the dialog to use */
dialog
=
msi_alloc_zero
(
sizeof
*
dialog
+
sizeof
(
WCHAR
)
*
strlenW
(
szDialogName
)
);
dialog
=
msi_alloc_zero
(
FIELD_OFFSET
(
msi_dialog
,
name
[
strlenW
(
szDialogName
)
+
1
]
)
);
if
(
!
dialog
)
if
(
!
dialog
)
return
NULL
;
return
NULL
;
strcpyW
(
dialog
->
name
,
szDialogName
);
strcpyW
(
dialog
->
name
,
szDialogName
);
...
...
dlls/msi/record.c
View file @
62029ff5
...
@@ -79,15 +79,14 @@ void MSI_CloseRecord( MSIOBJECTHDR *arg )
...
@@ -79,15 +79,14 @@ void MSI_CloseRecord( MSIOBJECTHDR *arg )
MSIRECORD
*
MSI_CreateRecord
(
UINT
cParams
)
MSIRECORD
*
MSI_CreateRecord
(
UINT
cParams
)
{
{
MSIRECORD
*
rec
;
MSIRECORD
*
rec
;
UINT
len
;
TRACE
(
"%d
\n
"
,
cParams
);
TRACE
(
"%d
\n
"
,
cParams
);
if
(
cParams
>
65535
)
if
(
cParams
>
65535
)
return
NULL
;
return
NULL
;
len
=
sizeof
(
MSIRECORD
)
+
sizeof
(
MSIFIELD
)
*
cParams
;
rec
=
alloc_msiobject
(
MSIHANDLETYPE_RECORD
,
FIELD_OFFSET
(
MSIRECORD
,
fields
[
cParams
+
1
]),
rec
=
alloc_msiobject
(
MSIHANDLETYPE_RECORD
,
len
,
MSI_CloseRecord
);
MSI_CloseRecord
);
if
(
rec
)
if
(
rec
)
rec
->
count
=
cParams
;
rec
->
count
=
cParams
;
return
rec
;
return
rec
;
...
...
dlls/msi/where.c
View file @
62029ff5
...
@@ -1068,7 +1068,7 @@ static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns)
...
@@ -1068,7 +1068,7 @@ static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns)
if
(
count
==
0
)
if
(
count
==
0
)
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
orderinfo
=
msi_alloc
(
sizeof
(
MSIORDERINFO
)
+
(
count
-
1
)
*
sizeof
(
union
ext_column
));
orderinfo
=
msi_alloc
(
FIELD_OFFSET
(
MSIORDERINFO
,
columns
[
count
]
));
if
(
!
orderinfo
)
if
(
!
orderinfo
)
return
ERROR_OUTOFMEMORY
;
return
ERROR_OUTOFMEMORY
;
...
...
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