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
4210cafc
Commit
4210cafc
authored
Dec 07, 2007
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Rename the wrappers around HeapAlloc() &Co to use the new standard naming.
parent
4051a09e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
21 deletions
+22
-21
clipboard.c
dlls/riched20/clipboard.c
+4
-4
editor.c
dlls/riched20/editor.c
+7
-6
editor.h
dlls/riched20/editor.h
+6
-6
reader.c
dlls/riched20/reader.c
+3
-3
richole.c
dlls/riched20/richole.c
+2
-2
No files found.
dlls/riched20/clipboard.c
View file @
4210cafc
...
...
@@ -77,7 +77,7 @@ static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
if
(
!
ref
)
{
GlobalFree
(
This
->
fmtetc
);
richedit
_free
(
This
);
heap
_free
(
This
);
}
return
ref
;
...
...
@@ -152,7 +152,7 @@ static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT fmtetc_cnt, I
EnumFormatImpl
*
ret
;
TRACE
(
"
\n
"
);
ret
=
richedit
_alloc
(
sizeof
(
EnumFormatImpl
));
ret
=
heap
_alloc
(
sizeof
(
EnumFormatImpl
));
ret
->
lpVtbl
=
&
VT_EnumFormatImpl
;
ret
->
ref
=
1
;
ret
->
cur
=
0
;
...
...
@@ -195,7 +195,7 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
if
(
This
->
unicode
)
GlobalFree
(
This
->
unicode
);
if
(
This
->
rtf
)
GlobalFree
(
This
->
rtf
);
if
(
This
->
fmtetc
)
GlobalFree
(
This
->
fmtetc
);
richedit
_free
(
This
);
heap
_free
(
This
);
}
return
ref
;
...
...
@@ -388,7 +388,7 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const CHARRANGE *lpchrg, LPDATAO
DataObjectImpl
*
obj
;
TRACE
(
"(%p,%d,%d)
\n
"
,
editor
,
lpchrg
->
cpMin
,
lpchrg
->
cpMax
);
obj
=
richedit
_alloc
(
sizeof
(
DataObjectImpl
));
obj
=
heap
_alloc
(
sizeof
(
DataObjectImpl
));
if
(
cfRTF
==
0
)
cfRTF
=
RegisterClipboardFormatA
(
"Rich Text Format"
);
...
...
dlls/riched20/editor.c
View file @
4210cafc
...
...
@@ -2013,8 +2013,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
LPWSTR
bufferW
=
NULL
;
if
(
unicode
)
bufferW
=
richedit_alloc
((
wParam
+
2
)
*
sizeof
(
WCHAR
));
else
bufferA
=
richedit_alloc
(
wParam
+
2
);
bufferW
=
heap_alloc
((
wParam
+
2
)
*
sizeof
(
WCHAR
));
else
bufferA
=
heap_alloc
(
wParam
+
2
);
ex
.
cb
=
wParam
+
(
unicode
?
2
*
sizeof
(
WCHAR
)
:
2
);
ex
.
flags
=
GT_USECRLF
;
...
...
@@ -2033,8 +2034,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
memcpy
((
LPSTR
)
lParam
,
bufferA
,
wParam
);
if
(
strlen
(
bufferA
)
>=
wParam
)
rc
=
0
;
}
if
(
bufferA
!=
NULL
)
richedit
_free
(
bufferA
);
if
(
bufferW
!=
NULL
)
richedit
_free
(
bufferW
);
heap
_free
(
bufferA
);
heap
_free
(
bufferW
);
return
rc
;
}
case
EM_GETTEXTEX
:
...
...
@@ -2066,7 +2067,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
/* potentially each char may be a CR, why calculate the exact value with O(N) when
we can just take a bigger buffer? :) */
int
crlfmul
=
(
ex
->
flags
&
GT_USECRLF
)
?
2
:
1
;
LPWSTR
buffer
=
richedit
_alloc
((
crlfmul
*
nCount
+
1
)
*
sizeof
(
WCHAR
));
LPWSTR
buffer
=
heap
_alloc
((
crlfmul
*
nCount
+
1
)
*
sizeof
(
WCHAR
));
DWORD
buflen
=
ex
->
cb
;
LRESULT
rc
;
DWORD
flags
=
0
;
...
...
@@ -2075,7 +2076,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
rc
=
WideCharToMultiByte
(
ex
->
codepage
,
flags
,
buffer
,
-
1
,
(
LPSTR
)
lParam
,
ex
->
cb
,
ex
->
lpDefaultChar
,
ex
->
lpUsedDefaultChar
);
if
(
rc
)
rc
--
;
/* do not count 0 terminator */
richedit
_free
(
buffer
);
heap
_free
(
buffer
);
return
rc
;
}
}
...
...
dlls/riched20/editor.h
View file @
4210cafc
...
...
@@ -23,24 +23,24 @@
extern
HANDLE
me_heap
;
static
inline
void
*
richedit
_alloc
(
size_t
len
)
static
inline
void
*
heap
_alloc
(
size_t
len
)
{
return
HeapAlloc
(
me_heap
,
0
,
len
);
}
static
inline
BOOL
richedit
_free
(
void
*
ptr
)
static
inline
BOOL
heap
_free
(
void
*
ptr
)
{
return
HeapFree
(
me_heap
,
0
,
ptr
);
}
static
inline
void
*
richedit
_realloc
(
void
*
ptr
,
size_t
len
)
static
inline
void
*
heap
_realloc
(
void
*
ptr
,
size_t
len
)
{
return
HeapReAlloc
(
me_heap
,
0
,
ptr
,
len
);
}
#define ALLOC_OBJ(type)
richedit
_alloc(sizeof(type))
#define ALLOC_N_OBJ(type, count)
richedit
_alloc((count)*sizeof(type))
#define FREE_OBJ(ptr)
richedit
_free(ptr)
#define ALLOC_OBJ(type)
heap
_alloc(sizeof(type))
#define ALLOC_N_OBJ(type, count)
heap
_alloc((count)*sizeof(type))
#define FREE_OBJ(ptr)
heap
_free(ptr)
#define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \
&& (run)->style->fmt.dwEffects & CFE_HIDDEN)
...
...
dlls/riched20/reader.c
View file @
4210cafc
...
...
@@ -85,9 +85,9 @@ static void RTFPutCodePageChar(RTF_Info *info, int c);
* Return pointer to block of size bytes, or NULL if there's
* not enough memory available.
*/
#define RTFAlloc(size)
richedit
_alloc(size)
#define RTFReAlloc(ptr, size)
richedit
_realloc(ptr, size)
#define RTFFree(ptr)
richedit
_free(ptr)
#define RTFAlloc(size)
heap
_alloc(size)
#define RTFReAlloc(ptr, size)
heap
_realloc(ptr, size)
#define RTFFree(ptr)
heap
_free(ptr)
/*
* Saves a string on the heap and returns a pointer to it.
...
...
dlls/riched20/richole.c
View file @
4210cafc
...
...
@@ -112,7 +112,7 @@ IRichEditOle_fnRelease(IRichEditOle *me)
if
(
!
ref
)
{
TRACE
(
"Destroying %p
\n
"
,
This
);
richedit
_free
(
This
);
heap
_free
(
This
);
}
return
ref
;
}
...
...
@@ -529,7 +529,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
{
IRichEditOleImpl
*
reo
;
reo
=
richedit
_alloc
(
sizeof
(
IRichEditOleImpl
));
reo
=
heap
_alloc
(
sizeof
(
IRichEditOleImpl
));
if
(
!
reo
)
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