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
a79b761c
Commit
a79b761c
authored
Nov 22, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/pager: Use CRT allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
80de4101
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
pager.c
dlls/comctl32/pager.c
+10
-10
No files found.
dlls/comctl32/pager.c
View file @
a79b761c
...
...
@@ -53,6 +53,7 @@
*/
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -62,7 +63,6 @@
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
pager
);
...
...
@@ -576,7 +576,7 @@ PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
INT
ret
;
/* allocate memory for info structure */
infoPtr
=
heap_alloc_zero
(
sizeof
(
*
infoPtr
));
infoPtr
=
calloc
(
1
,
sizeof
(
*
infoPtr
));
if
(
!
infoPtr
)
return
-
1
;
SetWindowLongPtrW
(
hwnd
,
0
,
(
DWORD_PTR
)
infoPtr
);
...
...
@@ -611,8 +611,8 @@ static LRESULT
PAGER_Destroy
(
PAGER_INFO
*
infoPtr
)
{
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
heap_
free
(
infoPtr
->
pwszBuffer
);
heap_
free
(
infoPtr
);
free
(
infoPtr
->
pwszBuffer
);
free
(
infoPtr
);
return
0
;
}
...
...
@@ -1099,9 +1099,9 @@ static UINT PAGER_GetAnsiNtfCode(UINT code)
static
BOOL
PAGER_AdjustBuffer
(
PAGER_INFO
*
infoPtr
,
INT
size
)
{
if
(
!
infoPtr
->
pwszBuffer
)
infoPtr
->
pwszBuffer
=
heap_
alloc
(
size
);
infoPtr
->
pwszBuffer
=
m
alloc
(
size
);
else
if
(
infoPtr
->
nBufferSize
<
size
)
infoPtr
->
pwszBuffer
=
heap_
realloc
(
infoPtr
->
pwszBuffer
,
size
);
infoPtr
->
pwszBuffer
=
realloc
(
infoPtr
->
pwszBuffer
,
size
);
if
(
!
infoPtr
->
pwszBuffer
)
return
FALSE
;
if
(
infoPtr
->
nBufferSize
<
size
)
infoPtr
->
nBufferSize
=
size
;
...
...
@@ -1153,7 +1153,7 @@ static LRESULT PAGER_SendConvertedNotify(PAGER_INFO *infoPtr, NMHDR *hdr, UINT *
if
((
*
text
&&
flags
&
(
CONVERT_SEND
|
ZERO_SEND
))
||
(
!*
text
&&
flags
&
SEND_EMPTY_IF_NULL
))
{
bufferSize
=
textMax
?
*
textMax
:
lstrlenW
(
*
text
)
+
1
;
sendBuffer
=
heap_alloc_zero
(
bufferSize
);
sendBuffer
=
calloc
(
1
,
bufferSize
);
if
(
!
sendBuffer
)
goto
done
;
if
(
!
(
flags
&
ZERO_SEND
))
WideCharToMultiByte
(
CP_ACP
,
0
,
*
text
,
-
1
,
sendBuffer
,
bufferSize
,
NULL
,
FALSE
);
*
text
=
(
WCHAR
*
)
sendBuffer
;
...
...
@@ -1167,18 +1167,18 @@ static LRESULT PAGER_SendConvertedNotify(PAGER_INFO *infoPtr, NMHDR *hdr, UINT *
if
(
*
text
==
oldText
)
{
bufferSize
=
lstrlenA
((
CHAR
*
)
*
text
)
+
1
;
receiveBuffer
=
heap_
alloc
(
bufferSize
);
receiveBuffer
=
m
alloc
(
bufferSize
);
if
(
!
receiveBuffer
)
goto
done
;
memcpy
(
receiveBuffer
,
*
text
,
bufferSize
);
MultiByteToWideChar
(
CP_ACP
,
0
,
receiveBuffer
,
bufferSize
,
oldText
,
oldTextMax
);
heap_
free
(
receiveBuffer
);
free
(
receiveBuffer
);
}
else
MultiByteToWideChar
(
CP_ACP
,
0
,
(
CHAR
*
)
*
text
,
-
1
,
oldText
,
oldTextMax
);
}
done:
heap_
free
(
sendBuffer
);
free
(
sendBuffer
);
*
text
=
oldText
;
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