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
63322dba
Commit
63322dba
authored
May 30, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Store global arena base as a pointer.
parent
7373ced5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
global16.c
dlls/kernel32/global16.c
+8
-8
toolhelp.h
dlls/kernel32/toolhelp.h
+2
-2
No files found.
dlls/kernel32/global16.c
View file @
63322dba
...
@@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(global);
...
@@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(global);
/* Global arena block */
/* Global arena block */
typedef
struct
typedef
struct
{
{
DWORD_PTR
base
;
/* Base address (0 if discarded) */
void
*
base
;
/* Base address (0 if discarded) */
DWORD
size
;
/* Size in bytes (0 indicates a free block) */
DWORD
size
;
/* Size in bytes (0 indicates a free block) */
HGLOBAL16
handle
;
/* Handle for this block */
HGLOBAL16
handle
;
/* Handle for this block */
HGLOBAL16
hOwner
;
/* Owner of this block */
HGLOBAL16
hOwner
;
/* Owner of this block */
...
@@ -134,7 +134,7 @@ void debug_handles(void)
...
@@ -134,7 +134,7 @@ void debug_handles(void)
*
*
* Create a global heap block for a fixed range of linear memory.
* Create a global heap block for a fixed range of linear memory.
*/
*/
HGLOBAL16
GLOBAL_CreateBlock
(
WORD
flags
,
const
void
*
ptr
,
DWORD
size
,
HGLOBAL16
GLOBAL_CreateBlock
(
WORD
flags
,
void
*
ptr
,
DWORD
size
,
HGLOBAL16
hOwner
,
unsigned
char
selflags
)
HGLOBAL16
hOwner
,
unsigned
char
selflags
)
{
{
WORD
sel
,
selcount
;
WORD
sel
,
selcount
;
...
@@ -154,7 +154,7 @@ HGLOBAL16 GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
...
@@ -154,7 +154,7 @@ HGLOBAL16 GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
/* Fill the arena block */
/* Fill the arena block */
pArena
->
base
=
(
DWORD_PTR
)
ptr
;
pArena
->
base
=
ptr
;
pArena
->
size
=
GetSelectorLimit16
(
sel
)
+
1
;
pArena
->
size
=
GetSelectorLimit16
(
sel
)
+
1
;
pArena
->
handle
=
(
flags
&
GMEM_MOVEABLE
)
?
sel
-
1
:
sel
;
pArena
->
handle
=
(
flags
&
GMEM_MOVEABLE
)
?
sel
-
1
:
sel
;
pArena
->
hOwner
=
hOwner
;
pArena
->
hOwner
=
hOwner
;
...
@@ -195,7 +195,7 @@ BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle )
...
@@ -195,7 +195,7 @@ BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle )
/***********************************************************************
/***********************************************************************
* GLOBAL_MoveBlock
* GLOBAL_MoveBlock
*/
*/
BOOL16
GLOBAL_MoveBlock
(
HGLOBAL16
handle
,
const
void
*
ptr
,
DWORD
size
)
BOOL16
GLOBAL_MoveBlock
(
HGLOBAL16
handle
,
void
*
ptr
,
DWORD
size
)
{
{
WORD
sel
;
WORD
sel
;
GLOBALARENA
*
pArena
;
GLOBALARENA
*
pArena
;
...
@@ -207,7 +207,7 @@ BOOL16 GLOBAL_MoveBlock( HGLOBAL16 handle, const void *ptr, DWORD size )
...
@@ -207,7 +207,7 @@ BOOL16 GLOBAL_MoveBlock( HGLOBAL16 handle, const void *ptr, DWORD size )
if
(
pArena
->
selCount
!=
1
)
if
(
pArena
->
selCount
!=
1
)
return
FALSE
;
return
FALSE
;
pArena
->
base
=
(
DWORD
)
ptr
;
pArena
->
base
=
ptr
;
pArena
->
size
=
size
;
pArena
->
size
=
size
;
SELECTOR_ReallocBlock
(
sel
,
ptr
,
size
);
SELECTOR_ReallocBlock
(
sel
,
ptr
,
size
);
return
TRUE
;
return
TRUE
;
...
@@ -428,7 +428,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
...
@@ -428,7 +428,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
As we may have used HEAP_REALLOC_IN_PLACE_ONLY, areas may overlap*/
As we may have used HEAP_REALLOC_IN_PLACE_ONLY, areas may overlap*/
if
(
pNewArena
!=
pArena
)
memmove
(
pNewArena
,
pArena
,
sizeof
(
GLOBALARENA
)
);
if
(
pNewArena
!=
pArena
)
memmove
(
pNewArena
,
pArena
,
sizeof
(
GLOBALARENA
)
);
pNewArena
->
base
=
(
DWORD
)
ptr
;
pNewArena
->
base
=
ptr
;
pNewArena
->
size
=
GetSelectorLimit16
(
sel
)
+
1
;
pNewArena
->
size
=
GetSelectorLimit16
(
sel
)
+
1
;
pNewArena
->
selCount
=
selcount
;
pNewArena
->
selCount
=
selcount
;
pNewArena
->
handle
=
(
pNewArena
->
flags
&
GA_MOVEABLE
)
?
sel
-
1
:
sel
;
pNewArena
->
handle
=
(
pNewArena
->
flags
&
GA_MOVEABLE
)
?
sel
-
1
:
sel
;
...
@@ -983,7 +983,7 @@ BOOL16 WINAPI GlobalNext16( GLOBALENTRY *pGlobal, WORD wFlags)
...
@@ -983,7 +983,7 @@ BOOL16 WINAPI GlobalNext16( GLOBALENTRY *pGlobal, WORD wFlags)
pGlobal
->
dwNext
=
i
;
pGlobal
->
dwNext
=
i
;
}
}
pGlobal
->
dwAddress
=
pArena
->
base
;
pGlobal
->
dwAddress
=
(
DWORD_PTR
)
pArena
->
base
;
pGlobal
->
dwBlockSize
=
pArena
->
size
;
pGlobal
->
dwBlockSize
=
pArena
->
size
;
pGlobal
->
hBlock
=
pArena
->
handle
;
pGlobal
->
hBlock
=
pArena
->
handle
;
pGlobal
->
wcLock
=
pArena
->
lockCount
;
pGlobal
->
wcLock
=
pArena
->
lockCount
;
...
@@ -1022,7 +1022,7 @@ BOOL16 WINAPI GlobalEntryHandle16( GLOBALENTRY *pGlobal, HGLOBAL16 hItem )
...
@@ -1022,7 +1022,7 @@ BOOL16 WINAPI GlobalEntryHandle16( GLOBALENTRY *pGlobal, HGLOBAL16 hItem )
{
{
GLOBALARENA
*
pArena
=
GET_ARENA_PTR
(
hItem
);
GLOBALARENA
*
pArena
=
GET_ARENA_PTR
(
hItem
);
pGlobal
->
dwAddress
=
pArena
->
base
;
pGlobal
->
dwAddress
=
(
DWORD_PTR
)
pArena
->
base
;
pGlobal
->
dwBlockSize
=
pArena
->
size
;
pGlobal
->
dwBlockSize
=
pArena
->
size
;
pGlobal
->
hBlock
=
pArena
->
handle
;
pGlobal
->
hBlock
=
pArena
->
handle
;
pGlobal
->
wcLock
=
pArena
->
lockCount
;
pGlobal
->
wcLock
=
pArena
->
lockCount
;
...
...
dlls/kernel32/toolhelp.h
View file @
63322dba
...
@@ -103,10 +103,10 @@ BOOL16 WINAPI GlobalEntryModule16( GLOBALENTRY *pGlobal, HMODULE16 hModule,
...
@@ -103,10 +103,10 @@ BOOL16 WINAPI GlobalEntryModule16( GLOBALENTRY *pGlobal, HMODULE16 hModule,
WORD
wSeg
);
WORD
wSeg
);
/* FIXME: Wine internal functions */
/* FIXME: Wine internal functions */
extern
HGLOBAL16
GLOBAL_CreateBlock
(
UINT16
flags
,
const
void
*
ptr
,
DWORD
size
,
extern
HGLOBAL16
GLOBAL_CreateBlock
(
UINT16
flags
,
void
*
ptr
,
DWORD
size
,
HGLOBAL16
hOwner
,
unsigned
char
selflags
);
HGLOBAL16
hOwner
,
unsigned
char
selflags
);
extern
BOOL16
GLOBAL_FreeBlock
(
HGLOBAL16
handle
);
extern
BOOL16
GLOBAL_FreeBlock
(
HGLOBAL16
handle
);
extern
BOOL16
GLOBAL_MoveBlock
(
HGLOBAL16
handle
,
const
void
*
ptr
,
DWORD
size
);
extern
BOOL16
GLOBAL_MoveBlock
(
HGLOBAL16
handle
,
void
*
ptr
,
DWORD
size
);
extern
HGLOBAL16
GLOBAL_Alloc
(
WORD
flags
,
DWORD
size
,
HGLOBAL16
hOwner
,
unsigned
char
selflags
);
extern
HGLOBAL16
GLOBAL_Alloc
(
WORD
flags
,
DWORD
size
,
HGLOBAL16
hOwner
,
unsigned
char
selflags
);
/* Local heap */
/* Local heap */
...
...
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