Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
06d36b1a
Commit
06d36b1a
authored
Apr 16, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix spy callback arguments for IMalloc::GetSize().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e3bc9f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
14 deletions
+29
-14
ifs.c
dlls/ole32/ifs.c
+21
-14
compobj.c
dlls/ole32/tests/compobj.c
+8
-0
No files found.
dlls/ole32/ifs.c
View file @
06d36b1a
...
...
@@ -296,26 +296,33 @@ static void WINAPI IMalloc_fnFree(IMalloc *iface, void *pv)
* win95: size allocated (4 byte boundaries)
* win2k: size originally requested !!! (allocated on 8 byte boundaries)
*/
static
SIZE_T
WINAPI
IMalloc_fnGetSize
(
IMalloc
*
iface
,
void
*
pv
)
static
SIZE_T
WINAPI
IMalloc_fnGetSize
(
IMalloc
*
iface
,
void
*
mem
)
{
SIZE_T
cb
;
BOOL
fSpyed
=
FALSE
;
BOOL
spyed_block
=
FALSE
,
spy_active
=
FALSE
;
SIZE_T
size
;
TRACE
(
"(%p)
\n
"
,
pv
);
TRACE
(
"(%p)
\n
"
,
mem
);
if
(
Malloc32
.
pSpy
)
{
EnterCriticalSection
(
&
IMalloc32_SpyCS
);
pv
=
IMallocSpy_PreGetSize
(
Malloc32
.
pSpy
,
pv
,
fSpyed
);
}
if
(
!
mem
)
return
(
SIZE_T
)
-
1
;
if
(
Malloc32
.
pSpy
)
{
EnterCriticalSection
(
&
IMalloc32_SpyCS
);
spyed_block
=
!!
mallocspy_is_allocation_spyed
(
mem
);
spy_active
=
TRUE
;
mem
=
IMallocSpy_PreGetSize
(
Malloc32
.
pSpy
,
mem
,
spyed_block
);
}
cb
=
HeapSize
(
GetProcessHeap
(),
0
,
pv
);
size
=
HeapSize
(
GetProcessHeap
(),
0
,
mem
);
if
(
Malloc32
.
pSpy
)
{
cb
=
IMallocSpy_PostGetSize
(
Malloc32
.
pSpy
,
cb
,
fSpyed
);
LeaveCriticalSection
(
&
IMalloc32_SpyCS
);
}
if
(
spy_active
)
{
size
=
IMallocSpy_PostGetSize
(
Malloc32
.
pSpy
,
size
,
spyed_block
);
LeaveCriticalSection
(
&
IMalloc32_SpyCS
);
}
return
cb
;
return
size
;
}
/******************************************************************************
...
...
dlls/ole32/tests/compobj.c
View file @
06d36b1a
...
...
@@ -3068,6 +3068,7 @@ static void test_CoWaitForMultipleHandles(void)
static
void
test_CoGetMalloc
(
void
)
{
IMalloc
*
imalloc
;
SIZE_T
size
;
HRESULT
hr
;
char
*
ptr
;
int
ret
;
...
...
@@ -3121,6 +3122,13 @@ static void test_CoGetMalloc(void)
ret
=
IMalloc_DidAlloc
(
imalloc
,
ptr
+
4
);
ok
(
ret
==
0
,
"Unexpected return value %d.
\n
"
,
ret
);
/* GetSize() */
size
=
IMalloc_GetSize
(
imalloc
,
NULL
);
ok
(
size
==
(
SIZE_T
)
-
1
,
"Unexpected return value.
\n
"
);
size
=
IMalloc_GetSize
(
imalloc
,
ptr
);
ok
(
size
==
16
,
"Unexpected return value.
\n
"
);
IMalloc_Free
(
imalloc
,
ptr
);
IMalloc_Release
(
imalloc
);
...
...
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