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
cef19de8
Commit
cef19de8
authored
Jul 04, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory allocation problems.
parent
d3239926
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
assoc.c
dlls/shlwapi/assoc.c
+7
-7
reg.c
dlls/shlwapi/reg.c
+4
-4
url.c
dlls/shlwapi/url.c
+5
-5
No files found.
dlls/shlwapi/assoc.c
View file @
cef19de8
...
...
@@ -75,7 +75,7 @@ static IQueryAssociations* IQueryAssociations_Constructor(void)
{
IQueryAssociationsImpl
*
iface
;
iface
=
(
IQueryAssociationsImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IQueryAssociationsImpl
));
iface
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IQueryAssociationsImpl
));
iface
->
lpVtbl
=
&
IQueryAssociations_vtbl
;
iface
->
ref
=
1
;
iface
->
hkeySource
=
NULL
;
...
...
@@ -95,7 +95,7 @@ static BOOL SHLWAPI_ParamAToW(LPCSTR lpszParam, LPWSTR lpszBuff, DWORD dwLen,
{
if
(
lpszParam
)
{
DWORD
dwStrLen
=
lstrlenA
(
lpszParam
);
DWORD
dwStrLen
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszParam
,
-
1
,
NULL
,
0
);
if
(
dwStrLen
<
dwLen
)
{
...
...
@@ -104,12 +104,12 @@ static BOOL SHLWAPI_ParamAToW(LPCSTR lpszParam, LPWSTR lpszBuff, DWORD dwLen,
else
{
/* Create a new buffer big enough for the string */
*
lpszOut
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
(
dwStrLen
+
1
)
*
sizeof
(
WCHAR
));
*
lpszOut
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwStrLen
*
sizeof
(
WCHAR
));
if
(
!*
lpszOut
)
return
FALSE
;
}
MultiByteToWideChar
(
0
,
0
,
lpszParam
,
-
1
,
*
lpszOut
,
-
1
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszParam
,
-
1
,
*
lpszOut
,
dwStrLen
);
}
else
*
lpszOut
=
NULL
;
...
...
@@ -298,7 +298,7 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc,
DWORD
dwLenOut
=
*
pcchOut
;
if
(
dwLenOut
>=
MAX_PATH
)
lpszReturnW
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
lpszReturnW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
dwLenOut
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
lpszReturnW
)
...
...
@@ -389,7 +389,7 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc
{
DWORD
dwLenOut
=
*
pcchOut
;
if
(
dwLenOut
>=
MAX_PATH
)
lpszReturnW
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
lpszReturnW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
dwLenOut
+
1
)
*
sizeof
(
WCHAR
));
if
(
lpszReturnW
)
...
...
dlls/shlwapi/reg.c
View file @
cef19de8
...
...
@@ -1204,8 +1204,8 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue,
}
else
{
nBytesToAlloc
=
lstrlenA
(
pvData
)
*
sizeof
(
CHAR
);
szData
=
(
LPSTR
)
LocalAlloc
(
GMEM_ZEROINIT
,
nBytesToAlloc
+
1
);
nBytesToAlloc
=
(
lstrlenA
(
pvData
)
+
1
)
*
sizeof
(
CHAR
);
szData
=
(
LPSTR
)
LocalAlloc
(
GMEM_ZEROINIT
,
nBytesToAlloc
);
lstrcpyA
(
szData
,
pvData
);
dwExpDataLen
=
ExpandEnvironmentStringsA
(
szData
,
pvData
,
*
pcbData
/
sizeof
(
CHAR
));
if
(
dwExpDataLen
>
*
pcbData
)
dwRet
=
ERROR_MORE_DATA
;
...
...
@@ -1265,8 +1265,8 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
}
else
{
nBytesToAlloc
=
lstrlenW
(
pvData
)
*
sizeof
(
WCHAR
);
szData
=
(
LPWSTR
)
LocalAlloc
(
GMEM_ZEROINIT
,
nBytesToAlloc
+
1
);
nBytesToAlloc
=
(
lstrlenW
(
pvData
)
+
1
)
*
sizeof
(
WCHAR
);
szData
=
(
LPWSTR
)
LocalAlloc
(
GMEM_ZEROINIT
,
nBytesToAlloc
);
lstrcpyW
(
szData
,
pvData
);
dwExpDataLen
=
ExpandEnvironmentStringsW
(
szData
,
pvData
,
*
pcbData
/
sizeof
(
WCHAR
)
);
if
(
dwExpDataLen
>
*
pcbData
)
dwRet
=
ERROR_MORE_DATA
;
...
...
dlls/shlwapi/url.c
View file @
cef19de8
...
...
@@ -369,8 +369,8 @@ DWORD WINAPI ParseURLW(LPCWSTR x, UNKNOWN_SHLWAPI_2 *y)
/* see if known scheme and return indicator number */
len
=
WideCharToMultiByte
(
0
,
0
,
y
->
ap1
,
y
->
sizep1
,
0
,
0
,
0
,
0
);
cmpstr
=
(
LPSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
1
);
WideCharToMultiByte
(
0
,
0
,
y
->
ap1
,
y
->
sizep1
,
cmpstr
,
len
+
1
,
0
,
0
);
cmpstr
=
(
LPSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
0
,
0
,
y
->
ap1
,
y
->
sizep1
,
cmpstr
,
len
,
0
,
0
);
y
->
fcncde
=
URL_SCHEME_UNKNOWN
;
inet_pro
=
shlwapi_schemes
;
while
(
inet_pro
->
scheme_name
)
{
...
...
@@ -422,7 +422,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized,
if
(
!
pszUrl
||
!
pszCanonicalized
||
!
pcchCanonicalized
)
return
E_INVALIDARG
;
base
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
base
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
2
*
INTERNET_MAX_URL_LENGTH
)
*
sizeof
(
WCHAR
));
canonical
=
base
+
INTERNET_MAX_URL_LENGTH
;
...
...
@@ -1482,7 +1482,7 @@ HRESULT WINAPI UrlApplySchemeA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWOR
TRACE
(
"(in %s, out size %ld, flags %08lx) using W version
\n
"
,
debugstr_a
(
pszIn
),
*
pcchOut
,
dwFlags
);
in
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
in
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
2
*
INTERNET_MAX_URL_LENGTH
)
*
sizeof
(
WCHAR
));
out
=
in
+
INTERNET_MAX_URL_LENGTH
;
...
...
@@ -1968,7 +1968,7 @@ HRESULT WINAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut,
LPWSTR
in
,
out
;
DWORD
ret
,
len
,
len2
;
in
=
(
LPWSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
in
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
2
*
INTERNET_MAX_URL_LENGTH
)
*
sizeof
(
WCHAR
));
out
=
in
+
INTERNET_MAX_URL_LENGTH
;
...
...
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