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
7e8d79fa
Commit
7e8d79fa
authored
Dec 09, 2007
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Rename the wrappers around HeapAlloc() &Co to use the standard names.
parent
41937c57
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
57 deletions
+57
-57
chm.c
dlls/hhctrl.ocx/chm.c
+14
-14
content.c
dlls/hhctrl.ocx/content.c
+11
-11
help.c
dlls/hhctrl.ocx/help.c
+17
-17
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+5
-5
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+7
-7
webbrowser.c
dlls/hhctrl.ocx/webbrowser.c
+3
-3
No files found.
dlls/hhctrl.ocx/chm.c
View file @
7e8d79fa
...
...
@@ -39,10 +39,10 @@ static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
if
(
chm
->
strings_size
<=
(
offset
>>
BLOCK_BITS
))
{
if
(
chm
->
strings
)
chm
->
strings
=
h
hctrl
_realloc_zero
(
chm
->
strings
,
chm
->
strings
=
h
eap
_realloc_zero
(
chm
->
strings
,
chm
->
strings_size
=
((
offset
>>
BLOCK_BITS
)
+
1
)
*
sizeof
(
char
*
));
else
chm
->
strings
=
h
hctrl
_alloc_zero
(
chm
->
strings
=
h
eap
_alloc_zero
(
chm
->
strings_size
=
((
offset
>>
BLOCK_BITS
)
+
1
)
*
sizeof
(
char
*
));
}
...
...
@@ -59,13 +59,13 @@ static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
return
NULL
;
}
chm
->
strings
[
offset
>>
BLOCK_BITS
]
=
h
hctrl
_alloc
(
BLOCK_SIZE
);
chm
->
strings
[
offset
>>
BLOCK_BITS
]
=
h
eap
_alloc
(
BLOCK_SIZE
);
hres
=
IStream_Read
(
chm
->
strings_stream
,
chm
->
strings
[
offset
>>
BLOCK_BITS
],
BLOCK_SIZE
,
&
read
);
if
(
FAILED
(
hres
))
{
WARN
(
"Read failed: %08x
\n
"
,
hres
);
h
hctrl
_free
(
chm
->
strings
[
offset
>>
BLOCK_BITS
]);
h
eap
_free
(
chm
->
strings
[
offset
>>
BLOCK_BITS
]);
chm
->
strings
[
offset
>>
BLOCK_BITS
]
=
NULL
;
return
NULL
;
}
...
...
@@ -97,7 +97,7 @@ static BOOL ReadChmSystem(CHMInfo *chm)
IStream_Read
(
stream
,
&
ver
,
sizeof
(
ver
),
&
read
);
TRACE
(
"version is %x
\n
"
,
ver
);
buf
=
h
hctrl
_alloc
(
8
*
sizeof
(
DWORD
));
buf
=
h
eap
_alloc
(
8
*
sizeof
(
DWORD
));
buf_size
=
8
*
sizeof
(
DWORD
);
while
(
1
)
{
...
...
@@ -106,7 +106,7 @@ static BOOL ReadChmSystem(CHMInfo *chm)
break
;
if
(
entry
.
len
>
buf_size
)
buf
=
h
hctrl
_realloc
(
buf
,
buf_size
=
entry
.
len
);
buf
=
h
eap
_realloc
(
buf
,
buf_size
=
entry
.
len
);
hres
=
IStream_Read
(
stream
,
buf
,
entry
.
len
,
&
read
);
if
(
hres
!=
S_OK
)
...
...
@@ -142,7 +142,7 @@ static BOOL ReadChmSystem(CHMInfo *chm)
}
}
h
hctrl
_free
(
buf
);
h
eap
_free
(
buf
);
IStream_Release
(
stream
);
return
SUCCEEDED
(
hres
);
...
...
@@ -171,12 +171,12 @@ LPWSTR FindContextAlias(CHMInfo *chm, DWORD index)
return
NULL
;
}
buf
=
h
hctrl
_alloc
(
size
);
buf
=
h
eap
_alloc
(
size
);
hres
=
IStream_Read
(
ivb_stream
,
buf
,
size
,
&
read
);
IStream_Release
(
ivb_stream
);
if
(
FAILED
(
hres
))
{
WARN
(
"Read failed: %08x
\n
"
,
hres
);
h
hctrl
_free
(
buf
);
h
eap
_free
(
buf
);
return
NULL
;
}
...
...
@@ -189,7 +189,7 @@ LPWSTR FindContextAlias(CHMInfo *chm, DWORD index)
}
}
h
hctrl
_free
(
buf
);
h
eap
_free
(
buf
);
TRACE
(
"returning %s
\n
"
,
debugstr_a
(
ret
));
return
strdupAtoW
(
ret
);
...
...
@@ -340,7 +340,7 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
static
const
WCHAR
wszSTRINGS
[]
=
{
'#'
,
'S'
,
'T'
,
'R'
,
'I'
,
'N'
,
'G'
,
'S'
,
0
};
CHMInfo
*
ret
=
h
hctrl
_alloc_zero
(
sizeof
(
CHMInfo
));
CHMInfo
*
ret
=
h
eap
_alloc_zero
(
sizeof
(
CHMInfo
));
res
=
GetFullPathNameW
(
szFile
,
sizeof
(
file
),
file
,
NULL
);
ret
->
szFile
=
strdupW
(
file
);
...
...
@@ -389,11 +389,11 @@ CHMInfo *CloseCHM(CHMInfo *chm)
int
i
;
for
(
i
=
0
;
i
<
chm
->
strings_size
;
i
++
)
h
hctrl
_free
(
chm
->
strings
[
i
]);
h
eap
_free
(
chm
->
strings
[
i
]);
}
h
hctrl
_free
(
chm
->
strings
);
h
hctrl
_free
(
chm
);
h
eap
_free
(
chm
->
strings
);
h
eap
_free
(
chm
);
return
NULL
;
}
dlls/hhctrl.ocx/content.c
View file @
7e8d79fa
...
...
@@ -41,10 +41,10 @@ static void free_content_item(ContentItem *item)
free_content_item
(
item
->
child
);
h
hctrl
_free
(
item
->
name
);
h
hctrl
_free
(
item
->
local
);
h
hctrl
_free
(
item
->
merge
.
chm_file
);
h
hctrl
_free
(
item
->
merge
.
chm_index
);
h
eap
_free
(
item
->
name
);
h
eap
_free
(
item
->
local
);
h
eap
_free
(
item
->
merge
.
chm_file
);
h
eap
_free
(
item
->
merge
.
chm_index
);
item
=
next
;
}
...
...
@@ -60,7 +60,7 @@ static void strbuf_init(strbuf_t *buf)
{
buf
->
size
=
8
;
buf
->
len
=
0
;
buf
->
buf
=
h
hctrl
_alloc
(
buf
->
size
);
buf
->
buf
=
h
eap
_alloc
(
buf
->
size
);
}
static
void
strbuf_zero
(
strbuf_t
*
buf
)
...
...
@@ -70,14 +70,14 @@ static void strbuf_zero(strbuf_t *buf)
static
void
strbuf_free
(
strbuf_t
*
buf
)
{
h
hctrl
_free
(
buf
->
buf
);
h
eap
_free
(
buf
->
buf
);
}
static
void
strbuf_append
(
strbuf_t
*
buf
,
const
char
*
data
,
int
len
)
{
if
(
buf
->
len
+
len
>
buf
->
size
)
{
buf
->
size
=
buf
->
len
+
len
;
buf
->
buf
=
h
hctrl
_realloc
(
buf
->
buf
,
buf
->
size
);
buf
->
buf
=
h
eap
_realloc
(
buf
->
buf
,
buf
->
size
);
}
memcpy
(
buf
->
buf
+
buf
->
len
,
data
,
len
);
...
...
@@ -208,13 +208,13 @@ static void parse_obj_node_param(ContentItem *item, ContentItem *hhc_root, const
}
wlen
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
len
,
NULL
,
0
);
*
param
=
h
hctrl
_alloc
((
wlen
+
1
)
*
sizeof
(
WCHAR
));
*
param
=
h
eap
_alloc
((
wlen
+
1
)
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
len
,
*
param
,
wlen
);
(
*
param
)[
wlen
]
=
0
;
if
(
param
==
&
merge
)
{
SetChmPath
(
&
item
->
merge
,
hhc_root
->
merge
.
chm_file
,
merge
);
h
hctrl
_free
(
merge
);
h
eap
_free
(
merge
);
}
}
...
...
@@ -258,7 +258,7 @@ static ContentItem *parse_sitemap_object(HHInfo *info, stream_t *stream, Content
strbuf_init
(
&
node
);
strbuf_init
(
&
node_name
);
item
=
h
hctrl
_alloc_zero
(
sizeof
(
ContentItem
));
item
=
h
eap
_alloc_zero
(
sizeof
(
ContentItem
));
while
(
next_node
(
stream
,
&
node
))
{
get_node_name
(
&
node
,
&
node_name
);
...
...
@@ -421,7 +421,7 @@ void InitContent(HHInfo *info)
IStream
*
stream
;
insert_type_t
insert_type
;
info
->
content
=
h
hctrl
_alloc_zero
(
sizeof
(
ContentItem
));
info
->
content
=
h
eap
_alloc_zero
(
sizeof
(
ContentItem
));
SetChmPath
(
&
info
->
content
->
merge
,
info
->
pCHMInfo
->
szFile
,
info
->
WinType
.
pszToc
);
stream
=
GetChmStream
(
info
->
pCHMInfo
,
info
->
pCHMInfo
->
szFile
,
&
info
->
content
->
merge
);
...
...
dlls/hhctrl.ocx/help.c
View file @
7e8d79fa
...
...
@@ -56,7 +56,7 @@ static LPWSTR HH_LoadString(DWORD dwID)
iSize
=
LoadStringW
(
hhctrl_hinstance
,
dwID
,
NULL
,
0
);
iSize
+=
2
;
/* some strings (tab text) needs double-null termination */
string
=
h
hctrl
_alloc
(
iSize
*
sizeof
(
WCHAR
));
string
=
h
eap
_alloc
(
iSize
*
sizeof
(
WCHAR
));
LoadStringW
(
hhctrl_hinstance
,
dwID
,
string
,
iSize
);
return
string
;
...
...
@@ -95,8 +95,8 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
SetChmPath
(
&
chm_path
,
info
->
pCHMInfo
->
szFile
,
surl
);
ret
=
NavigateToChm
(
info
,
chm_path
.
chm_file
,
chm_path
.
chm_index
);
h
hctrl
_free
(
chm_path
.
chm_file
);
h
hctrl
_free
(
chm_path
.
chm_index
);
h
eap
_free
(
chm_path
.
chm_file
);
h
eap
_free
(
chm_path
.
chm_index
);
return
ret
;
}
...
...
@@ -577,7 +577,7 @@ static BOOL HH_AddToolbar(HHInfo *pHHInfo)
szBuf
[
dwLen
+
2
]
=
0
;
/* Double-null terminate */
buttons
[
dwIndex
].
iString
=
(
DWORD
)
SendMessageW
(
hToolbar
,
TB_ADDSTRINGW
,
0
,
(
LPARAM
)
szBuf
);
h
hctrl
_free
(
szBuf
);
h
eap
_free
(
szBuf
);
}
SendMessageW
(
hToolbar
,
TB_ADDBUTTONSW
,
dwNumButtons
,
(
LPARAM
)
&
buttons
);
...
...
@@ -623,7 +623,7 @@ static DWORD NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD index)
ret
=
SendMessageW
(
hwndTabCtrl
,
TCM_INSERTITEMW
,
index
,
(
LPARAM
)
&
tie
);
h
hctrl
_free
(
tabText
);
h
eap
_free
(
tabText
);
return
ret
;
}
...
...
@@ -922,16 +922,16 @@ void ReleaseHelpViewer(HHInfo *info)
return
;
/* Free allocated strings */
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszType
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszCaption
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszToc
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszIndex
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszFile
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszHome
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszJump1
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszJump2
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszUrlJump1
);
h
hctrl
_free
((
LPWSTR
)
info
->
WinType
.
pszUrlJump2
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszType
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszCaption
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszToc
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszIndex
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszFile
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszHome
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszJump1
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszJump2
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszUrlJump1
);
h
eap
_free
((
LPWSTR
)
info
->
WinType
.
pszUrlJump2
);
if
(
info
->
pCHMInfo
)
CloseCHM
(
info
->
pCHMInfo
);
...
...
@@ -942,13 +942,13 @@ void ReleaseHelpViewer(HHInfo *info)
if
(
info
->
WinType
.
hwndHelp
)
DestroyWindow
(
info
->
WinType
.
hwndHelp
);
h
hctrl
_free
(
info
);
h
eap
_free
(
info
);
OleUninitialize
();
}
HHInfo
*
CreateHelpViewer
(
LPCWSTR
filename
)
{
HHInfo
*
info
=
h
hctrl
_alloc_zero
(
sizeof
(
HHInfo
));
HHInfo
*
info
=
h
eap
_alloc_zero
(
sizeof
(
HHInfo
));
OleInitialize
(
NULL
);
...
...
dlls/hhctrl.ocx/hhctrl.c
View file @
7e8d79fa
...
...
@@ -147,7 +147,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
return
NULL
;
NavigateToUrl
(
info
,
url
);
h
hctrl
_free
(
url
);
h
eap
_free
(
url
);
return
NULL
;
/* FIXME */
}
...
...
@@ -180,7 +180,7 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD_PTR data
if
(
filename
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
);
wfile
=
h
hctrl
_alloc
(
len
*
sizeof
(
WCHAR
));
wfile
=
h
eap
_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
wfile
,
len
);
}
...
...
@@ -205,7 +205,7 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD_PTR data
case
HH_GET_WIN_HANDLE
:
case
HH_SAFE_DISPLAY_TOPIC
:
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
const
char
*
)
data
,
-
1
,
NULL
,
0
);
wdata
=
h
hctrl
_alloc
(
len
*
sizeof
(
WCHAR
));
wdata
=
h
eap
_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
(
const
char
*
)
data
,
-
1
,
wdata
,
len
);
break
;
...
...
@@ -227,8 +227,8 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD_PTR data
result
=
HtmlHelpW
(
caller
,
wfile
,
command
,
wdata
?
(
DWORD_PTR
)
wdata
:
data
);
h
hctrl
_free
(
wfile
);
h
hctrl
_free
(
wdata
);
h
eap
_free
(
wfile
);
h
eap
_free
(
wdata
);
return
result
;
}
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
7e8d79fa
...
...
@@ -124,27 +124,27 @@ BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR);
/* memory allocation functions */
static
inline
void
*
h
hctrl
_alloc
(
size_t
len
)
static
inline
void
*
h
eap
_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
h
hctrl
_alloc_zero
(
size_t
len
)
static
inline
void
*
h
eap
_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
void
*
h
hctrl
_realloc
(
void
*
mem
,
size_t
len
)
static
inline
void
*
h
eap
_realloc
(
void
*
mem
,
size_t
len
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
len
);
}
static
inline
void
*
h
hctrl
_realloc_zero
(
void
*
mem
,
size_t
len
)
static
inline
void
*
h
eap
_realloc_zero
(
void
*
mem
,
size_t
len
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mem
,
len
);
}
static
inline
BOOL
h
hctrl
_free
(
void
*
mem
)
static
inline
BOOL
h
eap
_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
...
...
@@ -158,7 +158,7 @@ static inline LPWSTR strdupW(LPCWSTR str)
return
NULL
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
h
hctrl
_alloc
(
size
);
ret
=
h
eap
_alloc
(
size
);
memcpy
(
ret
,
str
,
size
);
return
ret
;
...
...
@@ -173,7 +173,7 @@ static inline LPWSTR strdupAtoW(LPCSTR str)
return
NULL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
h
hctrl
_alloc
(
len
*
sizeof
(
WCHAR
));
ret
=
h
eap
_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
return
ret
;
...
...
dlls/hhctrl.ocx/webbrowser.c
View file @
7e8d79fa
...
...
@@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite *iface)
if
(
refCount
)
return
refCount
;
h
hctrl
_free
(
This
);
h
eap
_free
(
This
);
return
0
;
}
...
...
@@ -576,7 +576,7 @@ BOOL InitWebBrowser(HHInfo *info, HWND hwndParent)
HRESULT
hr
;
RECT
rc
;
iOleClientSiteImpl
=
h
hctrl
_alloc_zero
(
sizeof
(
IOleClientSiteImpl
));
iOleClientSiteImpl
=
h
eap
_alloc_zero
(
sizeof
(
IOleClientSiteImpl
));
if
(
!
iOleClientSiteImpl
)
return
FALSE
;
...
...
@@ -625,7 +625,7 @@ BOOL InitWebBrowser(HHInfo *info, HWND hwndParent)
error:
ReleaseWebBrowser
(
info
);
h
hctrl
_free
(
iOleClientSiteImpl
);
h
eap
_free
(
iOleClientSiteImpl
);
return
FALSE
;
}
...
...
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