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
c2f6d059
Commit
c2f6d059
authored
Jan 20, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compobj.dll16: COM cleanup for the IMalloc16 iface.
parent
4156a804
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
compobj.c
dlls/compobj.dll16/compobj.c
+24
-14
No files found.
dlls/compobj.dll16/compobj.c
View file @
c2f6d059
...
...
@@ -88,17 +88,20 @@ static LPMALLOC16 currentMalloc16=NULL;
typedef
struct
{
/* IUnknown fields */
const
IMalloc16Vtbl
*
lpVtbl
;
DWORD
ref
;
/* IMalloc16 fields */
IMalloc16
IMalloc16_iface
;
DWORD
ref
;
}
IMalloc16Impl
;
static
inline
IMalloc16Impl
*
impl_from_IMalloc16
(
IMalloc16
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IMalloc16Impl
,
IMalloc16_iface
);
}
/******************************************************************************
* IMalloc16_QueryInterface [COMPOBJ.500]
*/
HRESULT
CDECL
IMalloc16_fnQueryInterface
(
IMalloc16
*
iface
,
REFIID
refiid
,
LPVOID
*
obj
)
{
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
)
;
TRACE
(
"(%p)->QueryInterface(%s,%p)
\n
"
,
This
,
debugstr_guid
(
refiid
),
obj
);
if
(
!
memcmp
(
&
IID_IUnknown
,
refiid
,
sizeof
(
IID_IUnknown
))
||
...
...
@@ -114,7 +117,8 @@ HRESULT CDECL IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *
* IMalloc16_AddRef [COMPOBJ.501]
*/
ULONG
CDECL
IMalloc16_fnAddRef
(
IMalloc16
*
iface
)
{
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->AddRef()
\n
"
,
This
);
return
1
;
/* cannot be freed */
}
...
...
@@ -123,7 +127,8 @@ ULONG CDECL IMalloc16_fnAddRef(IMalloc16* iface) {
* IMalloc16_Release [COMPOBJ.502]
*/
ULONG
CDECL
IMalloc16_fnRelease
(
IMalloc16
*
iface
)
{
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->Release()
\n
"
,
This
);
return
1
;
/* cannot be freed */
}
...
...
@@ -132,7 +137,8 @@ ULONG CDECL IMalloc16_fnRelease(IMalloc16* iface) {
* IMalloc16_Alloc [COMPOBJ.503]
*/
SEGPTR
CDECL
IMalloc16_fnAlloc
(
IMalloc16
*
iface
,
DWORD
cb
)
{
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->Alloc(%d)
\n
"
,
This
,
cb
);
return
MapLS
(
HeapAlloc
(
GetProcessHeap
(),
0
,
cb
)
);
}
...
...
@@ -143,7 +149,7 @@ SEGPTR CDECL IMalloc16_fnAlloc(IMalloc16* iface,DWORD cb) {
VOID
CDECL
IMalloc16_fnFree
(
IMalloc16
*
iface
,
SEGPTR
pv
)
{
void
*
ptr
=
MapSL
(
pv
);
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
)
;
TRACE
(
"(%p)->Free(%08x)
\n
"
,
This
,
pv
);
UnMapLS
(
pv
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
...
...
@@ -155,7 +161,8 @@ VOID CDECL IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv)
SEGPTR
CDECL
IMalloc16_fnRealloc
(
IMalloc16
*
iface
,
SEGPTR
pv
,
DWORD
cb
)
{
SEGPTR
ret
;
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->Realloc(%08x,%d)
\n
"
,
This
,
pv
,
cb
);
if
(
!
pv
)
ret
=
IMalloc16_fnAlloc
(
iface
,
cb
);
...
...
@@ -174,7 +181,8 @@ SEGPTR CDECL IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb)
*/
DWORD
CDECL
IMalloc16_fnGetSize
(
IMalloc16
*
iface
,
SEGPTR
pv
)
{
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->GetSize(%08x)
\n
"
,
This
,
pv
);
return
HeapSize
(
GetProcessHeap
(),
0
,
MapSL
(
pv
)
);
}
...
...
@@ -183,7 +191,8 @@ DWORD CDECL IMalloc16_fnGetSize(IMalloc16* iface,SEGPTR pv)
* IMalloc16_DidAlloc [COMPOBJ.507]
*/
INT16
CDECL
IMalloc16_fnDidAlloc
(
IMalloc16
*
iface
,
LPVOID
pv
)
{
IMalloc16
*
This
=
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->DidAlloc(%p)
\n
"
,
This
,
pv
);
return
(
INT16
)
-
1
;
}
...
...
@@ -192,7 +201,8 @@ INT16 CDECL IMalloc16_fnDidAlloc(IMalloc16* iface,LPVOID pv) {
* IMalloc16_HeapMinimize [COMPOBJ.508]
*/
LPVOID
CDECL
IMalloc16_fnHeapMinimize
(
IMalloc16
*
iface
)
{
IMalloc16Impl
*
This
=
(
IMalloc16Impl
*
)
iface
;
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->HeapMinimize()
\n
"
,
This
);
return
NULL
;
}
...
...
@@ -224,7 +234,7 @@ IMalloc16_Constructor(void)
#undef VTENT
msegvt16
=
MapLS
(
&
vt16
);
}
This
->
lpVtbl
=
(
const
IMalloc16Vtbl
*
)
msegvt16
;
This
->
IMalloc16_iface
.
lpVtbl
=
(
const
IMalloc16Vtbl
*
)
msegvt16
;
This
->
ref
=
1
;
return
(
LPMALLOC16
)
MapLS
(
This
);
}
...
...
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