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
9788815b
Commit
9788815b
authored
Dec 20, 2001
by
Uwe Bonnes
Committed by
Alexandre Julliard
Dec 20, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GlobalReAlloc16: If heap has GlobalPageLock set, try only with
HEAP_REALLOC_IN_PLACE_ONLY flag set.
parent
1bd9474e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
global.c
memory/global.c
+19
-9
No files found.
memory/global.c
View file @
9788815b
...
...
@@ -266,7 +266,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
)
{
WORD
selcount
;
DWORD
oldsize
;
void
*
ptr
;
void
*
ptr
,
*
newptr
;
GLOBALARENA
*
pArena
,
*
pNewArena
;
WORD
sel
=
GlobalHandleToSel16
(
handle
);
...
...
@@ -318,19 +318,28 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
ptr
=
(
void
*
)
pArena
->
base
;
oldsize
=
pArena
->
size
;
TRACE
(
"old
size %08lx
\n
"
,
old
size
);
TRACE
(
"old
base %p oldsize %08lx newsize %08lx
\n
"
,
ptr
,
oldsize
,
size
);
if
(
ptr
&&
(
size
==
oldsize
))
return
handle
;
/* Nothing to do */
if
(
pArena
->
flags
&
GA_DOSMEM
)
ptr
=
DOSMEM_ResizeBlock
(
ptr
,
size
,
NULL
);
new
ptr
=
DOSMEM_ResizeBlock
(
ptr
,
size
,
NULL
);
else
ptr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
ptr
,
size
);
if
(
!
ptr
)
/* if more then one reader (e.g. some pointer has been given out by GetVDMPointer32W16),
only try to realloc in place */
newptr
=
HeapReAlloc
(
GetProcessHeap
(),
(
pArena
->
pageLockCount
>
0
)
?
HEAP_REALLOC_IN_PLACE_ONLY
:
0
,
ptr
,
size
);
if
(
!
newptr
)
{
SELECTOR_FreeBlock
(
sel
);
memset
(
pArena
,
0
,
sizeof
(
GLOBALARENA
)
);
FIXME
(
"Realloc failed lock %d
\n
"
,
pArena
->
pageLockCount
);
if
(
pArena
->
pageLockCount
<
1
)
{
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
SELECTOR_FreeBlock
(
sel
);
memset
(
pArena
,
0
,
sizeof
(
GLOBALARENA
)
);
}
return
0
;
}
ptr
=
newptr
;
/* Reallocate the selector(s) */
...
...
@@ -350,9 +359,10 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
return
0
;
}
/* Fill the new arena block */
/* Fill the new arena block
As we may have used HEAP_REALLOC_IN_PLACE_ONLY, areas may overlap*/
if
(
pNewArena
!=
pArena
)
mem
cpy
(
pNewArena
,
pArena
,
sizeof
(
GLOBALARENA
)
);
if
(
pNewArena
!=
pArena
)
mem
move
(
pNewArena
,
pArena
,
sizeof
(
GLOBALARENA
)
);
pNewArena
->
base
=
(
DWORD
)
ptr
;
pNewArena
->
size
=
GetSelectorLimit16
(
sel
)
+
1
;
pNewArena
->
selCount
=
selcount
;
...
...
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