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
d8aa8535
Commit
d8aa8535
authored
Nov 26, 2003
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Nov 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the IMalloc::ReAlloc() to follow the documented behavior.
parent
cba157e9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
ifs.c
dlls/ole32/ifs.c
+6
-1
ole16.c
dlls/ole32/ole16.c
+18
-11
No files found.
dlls/ole32/ifs.c
View file @
d8aa8535
...
...
@@ -209,7 +209,12 @@ static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,DWORD cb) {
pv
=
pRealMemory
;
}
pNewMemory
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pv
,
cb
);
if
(
!
pv
)
pNewMemory
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cb
);
else
if
(
cb
)
pNewMemory
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pv
,
cb
);
else
{
HeapFree
(
GetProcessHeap
(),
0
,
pv
);
pNewMemory
=
NULL
;
}
if
(
Malloc32
.
pSpy
)
{
pNewMemory
=
IMallocSpy_PostRealloc
(
Malloc32
.
pSpy
,
pNewMemory
,
TRUE
);
...
...
dlls/ole32/ole16.c
View file @
d8aa8535
...
...
@@ -113,28 +113,35 @@ SEGPTR WINAPI IMalloc16_fnAlloc(IMalloc16* iface,DWORD cb) {
}
/******************************************************************************
* IMalloc16_
Realloc [COMPOBJ.504
]
* IMalloc16_
Free [COMPOBJ.505
]
*/
SEGPTR
WINAPI
IMalloc16_fnRealloc
(
IMalloc16
*
iface
,
SEGPTR
pv
,
DWORD
cb
)
VOID
WINAPI
IMalloc16_fnFree
(
IMalloc16
*
iface
,
SEGPTR
pv
)
{
SEGPTR
ret
;
void
*
ptr
=
MapSL
(
pv
)
;
ICOM_THIS
(
IMalloc16Impl
,
iface
);
TRACE
(
"(%p)->Realloc(%08lx,%ld)
\n
"
,
This
,
pv
,
cb
);
ret
=
MapLS
(
HeapReAlloc
(
GetProcessHeap
(),
0
,
MapSL
(
pv
),
cb
)
);
TRACE
(
"(%p)->Free(%08lx)
\n
"
,
This
,
pv
);
UnMapLS
(
pv
);
return
ret
;
HeapFree
(
GetProcessHeap
(),
0
,
ptr
)
;
}
/******************************************************************************
* IMalloc16_
Free [COMPOBJ.505
]
* IMalloc16_
Realloc [COMPOBJ.504
]
*/
VOID
WINAPI
IMalloc16_fnFree
(
IMalloc16
*
iface
,
SEGPTR
pv
)
SEGPTR
WINAPI
IMalloc16_fnRealloc
(
IMalloc16
*
iface
,
SEGPTR
pv
,
DWORD
cb
)
{
void
*
ptr
=
MapSL
(
pv
)
;
SEGPTR
ret
;
ICOM_THIS
(
IMalloc16Impl
,
iface
);
TRACE
(
"(%p)->Free(%08lx)
\n
"
,
This
,
pv
);
TRACE
(
"(%p)->Realloc(%08lx,%ld)
\n
"
,
This
,
pv
,
cb
);
if
(
!
pv
)
ret
=
IMalloc16_fnAlloc
(
iface
,
cb
);
else
if
(
cb
)
{
ret
=
MapLS
(
HeapReAlloc
(
GetProcessHeap
(),
0
,
MapSL
(
pv
),
cb
)
);
UnMapLS
(
pv
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
else
{
IMalloc16_fnFree
(
iface
,
pv
);
ret
=
0
;
}
return
ret
;
}
/******************************************************************************
...
...
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