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
a1f4a2d1
Commit
a1f4a2d1
authored
Nov 23, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Use CRT allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
8fe1c228
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
monthcal.c
dlls/comctl32/monthcal.c
+13
-15
No files found.
dlls/comctl32/monthcal.c
View file @
a1f4a2d1
...
...
@@ -46,7 +46,6 @@
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
monthcal
);
...
...
@@ -1946,7 +1945,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
=
heap_alloc_zero
(
nmds
.
cDayState
*
sizeof
(
MONTHDAYSTATE
));
nmds
.
prgDayState
=
state
=
calloc
(
nmds
.
cDayState
,
sizeof
(
MONTHDAYSTATE
));
MONTHCAL_GetMinDate
(
infoPtr
,
&
nmds
.
stStart
);
nmds
.
stStart
.
wDay
=
1
;
...
...
@@ -1955,7 +1954,7 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
memcpy
(
infoPtr
->
monthdayState
,
nmds
.
prgDayState
,
MONTHCAL_GetMonthRange
(
infoPtr
,
GMR_DAYSTATE
,
0
)
*
sizeof
(
MONTHDAYSTATE
));
heap_
free
(
state
);
free
(
state
);
}
/* no valid range check performed */
...
...
@@ -2593,9 +2592,9 @@ static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr)
{
infoPtr
->
dim
.
cx
=
x
;
infoPtr
->
dim
.
cy
=
y
;
infoPtr
->
calendars
=
heap_
realloc
(
infoPtr
->
calendars
,
MONTHCAL_GetCalCount
(
infoPtr
)
*
sizeof
(
CALENDAR_INFO
));
infoPtr
->
calendars
=
realloc
(
infoPtr
->
calendars
,
MONTHCAL_GetCalCount
(
infoPtr
)
*
sizeof
(
CALENDAR_INFO
));
infoPtr
->
monthdayState
=
heap_
realloc
(
infoPtr
->
monthdayState
,
infoPtr
->
monthdayState
=
realloc
(
infoPtr
->
monthdayState
,
MONTHCAL_GetMonthRange
(
infoPtr
,
GMR_DAYSTATE
,
0
)
*
sizeof
(
MONTHDAYSTATE
));
MONTHCAL_NotifyDayState
(
infoPtr
);
...
...
@@ -2750,7 +2749,7 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
MONTHCAL_INFO
*
infoPtr
;
/* allocate memory for info structure */
infoPtr
=
heap_alloc_zero
(
sizeof
(
*
infoPtr
));
infoPtr
=
calloc
(
1
,
sizeof
(
*
infoPtr
));
SetWindowLongPtrW
(
hwnd
,
0
,
(
DWORD_PTR
)
infoPtr
);
if
(
infoPtr
==
NULL
)
{
...
...
@@ -2762,9 +2761,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
=
heap_alloc_zero
(
sizeof
(
CALENDAR_INFO
));
infoPtr
->
calendars
=
calloc
(
1
,
sizeof
(
*
infoPtr
->
calendars
));
if
(
!
infoPtr
->
calendars
)
goto
fail
;
infoPtr
->
monthdayState
=
heap_alloc_zero
(
3
*
sizeof
(
MONTHDAYSTATE
));
infoPtr
->
monthdayState
=
calloc
(
3
,
sizeof
(
*
infoPtr
->
monthdayState
));
if
(
!
infoPtr
->
monthdayState
)
goto
fail
;
/* initialize info structure */
...
...
@@ -2805,9 +2804,9 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
return
0
;
fail:
heap_
free
(
infoPtr
->
monthdayState
);
heap_
free
(
infoPtr
->
calendars
);
heap_
free
(
infoPtr
);
free
(
infoPtr
->
monthdayState
);
free
(
infoPtr
->
calendars
);
free
(
infoPtr
);
return
0
;
}
...
...
@@ -2816,9 +2815,8 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr)
{
INT
i
;
/* free month calendar info data */
heap_free
(
infoPtr
->
monthdayState
);
heap_free
(
infoPtr
->
calendars
);
free
(
infoPtr
->
monthdayState
);
free
(
infoPtr
->
calendars
);
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
CloseThemeData
(
GetWindowTheme
(
infoPtr
->
hwndSelf
));
...
...
@@ -2826,7 +2824,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
]);
heap_
free
(
infoPtr
);
free
(
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