Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
26cce555
Commit
26cce555
authored
Feb 06, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Use the global HeapAlloc() wrappers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
598d3699
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
monthcal.c
dlls/comctl32/monthcal.c
+14
-13
No files found.
dlls/comctl32/monthcal.c
View file @
26cce555
...
...
@@ -56,6 +56,7 @@
#include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
monthcal
);
...
...
@@ -1966,7 +1967,7 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
nmds
.
nmhdr
.
idFrom
=
GetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
GWLP_ID
);
nmds
.
nmhdr
.
code
=
MCN_GETDAYSTATE
;
nmds
.
cDayState
=
MONTHCAL_GetMonthRange
(
infoPtr
,
GMR_DAYSTATE
,
0
);
nmds
.
prgDayState
=
state
=
Alloc
(
nmds
.
cDayState
*
sizeof
(
MONTHDAYSTATE
));
nmds
.
prgDayState
=
state
=
heap_alloc_zero
(
nmds
.
cDayState
*
sizeof
(
MONTHDAYSTATE
));
MONTHCAL_GetMinDate
(
infoPtr
,
&
nmds
.
stStart
);
nmds
.
stStart
.
wDay
=
1
;
...
...
@@ -1975,7 +1976,7 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
memcpy
(
infoPtr
->
monthdayState
,
nmds
.
prgDayState
,
MONTHCAL_GetMonthRange
(
infoPtr
,
GMR_DAYSTATE
,
0
)
*
sizeof
(
MONTHDAYSTATE
));
F
ree
(
state
);
heap_f
ree
(
state
);
}
/* no valid range check performed */
...
...
@@ -2615,9 +2616,9 @@ static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr)
{
infoPtr
->
dim
.
cx
=
x
;
infoPtr
->
dim
.
cy
=
y
;
infoPtr
->
calendars
=
ReA
lloc
(
infoPtr
->
calendars
,
MONTHCAL_GetCalCount
(
infoPtr
)
*
sizeof
(
CALENDAR_INFO
));
infoPtr
->
calendars
=
heap_rea
lloc
(
infoPtr
->
calendars
,
MONTHCAL_GetCalCount
(
infoPtr
)
*
sizeof
(
CALENDAR_INFO
));
infoPtr
->
monthdayState
=
ReA
lloc
(
infoPtr
->
monthdayState
,
infoPtr
->
monthdayState
=
heap_rea
lloc
(
infoPtr
->
monthdayState
,
MONTHCAL_GetMonthRange
(
infoPtr
,
GMR_DAYSTATE
,
0
)
*
sizeof
(
MONTHDAYSTATE
));
MONTHCAL_NotifyDayState
(
infoPtr
);
...
...
@@ -2773,7 +2774,7 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
MONTHCAL_INFO
*
infoPtr
;
/* allocate memory for info structure */
infoPtr
=
Alloc
(
sizeof
(
MONTHCAL_INFO
));
infoPtr
=
heap_alloc_zero
(
sizeof
(
*
infoPtr
));
SetWindowLongPtrW
(
hwnd
,
0
,
(
DWORD_PTR
)
infoPtr
);
if
(
infoPtr
==
NULL
)
{
...
...
@@ -2785,9 +2786,9 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
infoPtr
->
hwndNotify
=
lpcs
->
hwndParent
;
infoPtr
->
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
infoPtr
->
dim
.
cx
=
infoPtr
->
dim
.
cy
=
1
;
infoPtr
->
calendars
=
Alloc
(
sizeof
(
CALENDAR_INFO
));
infoPtr
->
calendars
=
heap_alloc_zero
(
sizeof
(
CALENDAR_INFO
));
if
(
!
infoPtr
->
calendars
)
goto
fail
;
infoPtr
->
monthdayState
=
Alloc
(
3
*
sizeof
(
MONTHDAYSTATE
));
infoPtr
->
monthdayState
=
heap_alloc_zero
(
3
*
sizeof
(
MONTHDAYSTATE
));
if
(
!
infoPtr
->
monthdayState
)
goto
fail
;
/* initialize info structure */
...
...
@@ -2828,9 +2829,9 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
return
0
;
fail:
F
ree
(
infoPtr
->
monthdayState
);
F
ree
(
infoPtr
->
calendars
);
F
ree
(
infoPtr
);
heap_f
ree
(
infoPtr
->
monthdayState
);
heap_f
ree
(
infoPtr
->
calendars
);
heap_f
ree
(
infoPtr
);
return
0
;
}
...
...
@@ -2840,8 +2841,8 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr)
INT
i
;
/* free month calendar info data */
F
ree
(
infoPtr
->
monthdayState
);
F
ree
(
infoPtr
->
calendars
);
heap_f
ree
(
infoPtr
->
monthdayState
);
heap_f
ree
(
infoPtr
->
calendars
);
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
CloseThemeData
(
GetWindowTheme
(
infoPtr
->
hwndSelf
));
...
...
@@ -2849,7 +2850,7 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr)
for
(
i
=
0
;
i
<
BrushLast
;
i
++
)
DeleteObject
(
infoPtr
->
brushes
[
i
]);
for
(
i
=
0
;
i
<
PenLast
;
i
++
)
DeleteObject
(
infoPtr
->
pens
[
i
]);
F
ree
(
infoPtr
);
heap_f
ree
(
infoPtr
);
return
0
;
}
...
...
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