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
195f183c
Commit
195f183c
authored
Jan 22, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jan 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Use the default OLE allocator to allocate BSTRs.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eae84e7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
oleaut.c
dlls/oleaut32/oleaut.c
+11
-16
No files found.
dlls/oleaut32/oleaut.c
View file @
195f183c
...
...
@@ -174,7 +174,7 @@ static bstr_t *alloc_bstr(size_t size)
}
}
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bstr_alloc_size
(
size
));
ret
=
CoTaskMemAlloc
(
bstr_alloc_size
(
size
));
if
(
ret
)
ret
->
size
=
size
;
return
ret
;
...
...
@@ -321,7 +321,7 @@ void WINAPI SysFreeString(BSTR str)
LeaveCriticalSection
(
&
cs_bstr_cache
);
}
HeapFree
(
GetProcessHeap
(),
0
,
bstr
);
CoTaskMemFree
(
bstr
);
}
/******************************************************************************
...
...
@@ -388,30 +388,25 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
{
/* Detect integer overflow. */
if
(
len
>=
((
UINT_MAX
-
sizeof
(
WCHAR
)
-
sizeof
(
DWORD
))
/
sizeof
(
WCHAR
)))
return
0
;
return
FALSE
;
if
(
*
old
!=
NULL
)
{
BSTR
old_copy
=
*
old
;
DWORD
newbytelen
=
len
*
sizeof
(
WCHAR
);
bstr_t
*
old_bstr
=
bstr_from_str
(
*
old
);
bstr_t
*
bstr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
old_bstr
,
bstr_alloc_size
(
newbytelen
));
bstr_t
*
bstr
=
CoTaskMemRealloc
(
old_bstr
,
bstr_alloc_size
(
newbytelen
));
if
(
!
bstr
)
return
FALSE
;
*
old
=
bstr
->
u
.
str
;
bstr
->
size
=
newbytelen
;
/* Subtle hidden feature: The old string data is still there
* when 'in' is NULL!
* Some Microsoft program needs it.
* FIXME: Is it a sideeffect of BSTR caching?
*/
if
(
str
&&
old_copy
!=
str
)
memmove
(
*
old
,
str
,
newbytelen
);
(
*
old
)[
len
]
=
0
;
/* The old string data is still there when str is NULL */
if
(
str
&&
old_bstr
->
u
.
str
!=
str
)
memmove
(
bstr
->
u
.
str
,
str
,
newbytelen
);
bstr
->
u
.
str
[
len
]
=
0
;
}
else
{
/*
* Allocate the new string
*/
*
old
=
SysAllocStringLen
(
str
,
len
);
}
return
1
;
return
TRUE
;
}
/******************************************************************************
...
...
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