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
12d73316
Commit
12d73316
authored
Dec 23, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix parameter validation for CoGetMalloc().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f6bfc309
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
ifs.c
dlls/ole32/ifs.c
+10
-5
compobj.c
dlls/ole32/tests/compobj.c
+5
-10
No files found.
dlls/ole32/ifs.c
View file @
12d73316
...
...
@@ -368,17 +368,22 @@ static const IMallocVtbl VT_IMalloc32 =
* Retrieves the current IMalloc interface for the process.
*
* PARAMS
*
dwMemContext [I]
*
lpMalloc
[O] Address where memory allocator object will be stored.
*
context [I] Should always be MEMCTX_TASK.
*
imalloc
[O] Address where memory allocator object will be stored.
*
* RETURNS
* Success: S_OK.
* Failure: HRESULT code.
*/
HRESULT
WINAPI
CoGetMalloc
(
DWORD
dwMemContext
,
LPMALLOC
*
lpM
alloc
)
HRESULT
WINAPI
CoGetMalloc
(
DWORD
context
,
IMalloc
**
im
alloc
)
{
*
lpMalloc
=
&
Malloc32
.
IMalloc_iface
;
return
S_OK
;
if
(
context
!=
MEMCTX_TASK
)
{
*
imalloc
=
NULL
;
return
E_INVALIDARG
;
}
*
imalloc
=
&
Malloc32
.
IMalloc_iface
;
return
S_OK
;
}
/***********************************************************************
...
...
dlls/ole32/tests/compobj.c
View file @
12d73316
...
...
@@ -2629,34 +2629,29 @@ if (0) /* crashes on native */
imalloc
=
(
void
*
)
0xdeadbeef
;
hr
=
CoGetMalloc
(
0
,
&
imalloc
);
todo_wine
{
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
imalloc
==
NULL
,
"got %p
\n
"
,
imalloc
);
}
imalloc
=
(
void
*
)
0xdeadbeef
;
hr
=
CoGetMalloc
(
MEMCTX_SHARED
,
&
imalloc
);
todo_wine
{
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
imalloc
==
NULL
,
"got %p
\n
"
,
imalloc
);
}
imalloc
=
(
void
*
)
0xdeadbeef
;
hr
=
CoGetMalloc
(
MEMCTX_MACSYSTEM
,
&
imalloc
);
todo_wine
{
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
imalloc
==
NULL
,
"got %p
\n
"
,
imalloc
);
}
imalloc
=
(
void
*
)
0xdeadbeef
;
hr
=
CoGetMalloc
(
MEMCTX_UNKNOWN
,
&
imalloc
);
todo_wine
{
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
imalloc
==
NULL
,
"got %p
\n
"
,
imalloc
);
}
imalloc
=
(
void
*
)
0xdeadbeef
;
hr
=
CoGetMalloc
(
MEMCTX_SAME
,
&
imalloc
);
todo_wine
{
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
imalloc
==
NULL
,
"got %p
\n
"
,
imalloc
);
}
imalloc
=
NULL
;
hr
=
CoGetMalloc
(
MEMCTX_TASK
,
&
imalloc
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
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