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
4843f031
Commit
4843f031
authored
Jul 19, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Use proper allocators for storing source in ErrorInfoImpl.
parent
12f1fbb7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
8 deletions
+34
-8
errorinfo.c
dlls/ole32/errorinfo.c
+34
-8
No files found.
dlls/ole32/errorinfo.c
View file @
4843f031
...
...
@@ -41,6 +41,32 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
WCHAR
*
heap_strdupW
(
const
WCHAR
*
str
)
{
WCHAR
*
ret
=
NULL
;
if
(
str
)
{
size_t
size
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
/* this code is from SysAllocStringLen (ole2disp.c in oleaut32) */
static
BSTR
ERRORINFO_SysAllocString
(
const
OLECHAR
*
in
)
{
...
...
@@ -129,7 +155,7 @@ typedef struct ErrorInfoImpl
LONG
ref
;
GUID
m_Guid
;
BSTR
bstrS
ource
;
WCHAR
*
s
ource
;
BSTR
bstrDescription
;
BSTR
bstrHelpFile
;
DWORD
m_dwHelpContext
;
...
...
@@ -203,7 +229,7 @@ static ULONG WINAPI IErrorInfoImpl_Release(
{
TRACE
(
"-- destroying IErrorInfo(%p)
\n
"
,
This
);
ERRORINFO_SysFreeString
(
This
->
bstrS
ource
);
heap_free
(
This
->
s
ource
);
ERRORINFO_SysFreeString
(
This
->
bstrDescription
);
ERRORINFO_SysFreeString
(
This
->
bstrHelpFile
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -231,7 +257,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetSource(
TRACE
(
"(%p)->(pBstrSource=%p)
\n
"
,
This
,
pBstrSource
);
if
(
pBstrSource
==
NULL
)
return
E_INVALIDARG
;
*
pBstrSource
=
ERRORINFO_SysAllocString
(
This
->
bstrS
ource
);
*
pBstrSource
=
SysAllocString
(
This
->
s
ource
);
return
S_OK
;
}
...
...
@@ -329,9 +355,9 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetSource(
{
ErrorInfoImpl
*
This
=
impl_from_ICreateErrorInfo
(
iface
);
TRACE
(
"(%p): %s
\n
"
,
This
,
debugstr_w
(
szSource
));
if
(
This
->
bstrSource
!=
NULL
)
ERRORINFO_SysFreeString
(
This
->
bstrS
ource
);
This
->
bstrSource
=
ERRORINFO_SysAllocString
(
szSource
);
heap_free
(
This
->
s
ource
);
This
->
source
=
heap_strdupW
(
szSource
);
return
S_OK
;
}
...
...
@@ -423,7 +449,7 @@ static const ISupportErrorInfoVtbl SupportErrorInfoVtbl =
static
IErrorInfo
*
IErrorInfoImpl_Constructor
(
void
)
{
ErrorInfoImpl
*
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ErrorInfoImpl
));
ErrorInfoImpl
*
This
=
heap_alloc
(
sizeof
(
ErrorInfoImpl
));
if
(
!
This
)
return
NULL
;
...
...
@@ -431,7 +457,7 @@ static IErrorInfo* IErrorInfoImpl_Constructor(void)
This
->
ICreateErrorInfo_iface
.
lpVtbl
=
&
CreateErrorInfoVtbl
;
This
->
ISupportErrorInfo_iface
.
lpVtbl
=
&
SupportErrorInfoVtbl
;
This
->
ref
=
1
;
This
->
bstrS
ource
=
NULL
;
This
->
s
ource
=
NULL
;
This
->
bstrDescription
=
NULL
;
This
->
bstrHelpFile
=
NULL
;
This
->
m_dwHelpContext
=
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