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
06ea6e6e
Commit
06ea6e6e
authored
Sep 16, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a few pointer truncation bugs for 64-bit platforms.
parent
cdf92942
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
heap.c
dlls/ntdll/heap.c
+3
-3
virtual.c
dlls/ntdll/virtual.c
+5
-4
No files found.
dlls/ntdll/heap.c
View file @
06ea6e6e
...
...
@@ -244,7 +244,7 @@ static void HEAP_Dump( HEAP *heap )
{
ARENA_INUSE
*
pArena
=
(
ARENA_INUSE
*
)
ptr
;
DPRINTF
(
"%p Used %08lx back=%08lx
\n
"
,
pArena
,
pArena
->
size
&
ARENA_SIZE_MASK
,
*
((
DWORD
*
)
pArena
-
1
)
);
pArena
,
pArena
->
size
&
ARENA_SIZE_MASK
,
*
((
UINT_PTR
*
)
pArena
-
1
)
);
ptr
+=
sizeof
(
*
pArena
)
+
(
pArena
->
size
&
ARENA_SIZE_MASK
);
arenaSize
+=
sizeof
(
ARENA_INUSE
);
usedSize
+=
pArena
->
size
&
ARENA_SIZE_MASK
;
...
...
@@ -476,7 +476,7 @@ static void HEAP_CreateFreeBlock( SUBHEAP *subheap, void *ptr, SIZE_T size )
DWORD
*
pNext
=
(
DWORD
*
)((
char
*
)
ptr
+
size
);
*
pNext
|=
ARENA_FLAG_PREV_FREE
;
mark_block_initialized
(
pNext
-
1
,
sizeof
(
ARENA_FREE
*
)
);
*
(
ARENA_FREE
**
)(
pNext
-
1
)
=
pFree
;
*
(
(
ARENA_FREE
**
)
pNext
-
1
)
=
pFree
;
}
/* Last, insert the new block into the free list */
...
...
@@ -851,7 +851,7 @@ static BOOL HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
{
ERR
(
"Heap %p: arena %p has wrong back ptr %08lx
\n
"
,
subheap
->
heap
,
pArena
,
*
((
DWORD
*
)((
char
*
)(
pArena
+
1
)
+
(
pArena
->
size
&
ARENA_SIZE_MASK
))
-
1
));
*
((
UINT_PTR
*
)((
char
*
)(
pArena
+
1
)
+
(
pArena
->
size
&
ARENA_SIZE_MASK
))
-
1
));
return
FALSE
;
}
}
...
...
dlls/ntdll/virtual.c
View file @
06ea6e6e
...
...
@@ -120,15 +120,15 @@ static RTL_CRITICAL_SECTION csVirtual = { &critsect_debug, -1, 0, 0, 0, 0 };
# define USER_SPACE_LIMIT ((void *)0x80000000)
/* top of the user address space */
#else
static
UINT
page_shift
;
static
UINT
page_mask
;
static
UINT
page_size
;
static
UINT_PTR
page_mask
;
# define ADDRESS_SPACE_LIMIT 0
/* no limit needed on other platforms */
# define USER_SPACE_LIMIT 0
/* no limit needed on other platforms */
#endif
/* __i386__ */
#define granularity_mask 0xffff
/* Allocation granularity (usually 64k) */
static
const
UINT_PTR
granularity_mask
=
0xffff
;
/* Allocation granularity (usually 64k) */
#define ROUND_ADDR(addr,mask) \
((void *)((UINT_PTR)(addr) & ~(mask)))
((void *)((UINT_PTR)(addr) & ~(
UINT_PTR)(
mask)))
#define ROUND_SIZE(addr,size) \
(((UINT)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask)
...
...
@@ -1125,13 +1125,14 @@ NTSTATUS VIRTUAL_alloc_teb( void **ret, size_t size, BOOL first )
void
*
ptr
;
NTSTATUS
status
;
struct
file_view
*
view
;
size_t
align_size
=
page_size
;
size_t
align_size
;
BYTE
vprot
=
VPROT_READ
|
VPROT_WRITE
|
VPROT_COMMITTED
;
if
(
first
)
virtual_init
();
*
ret
=
NULL
;
size
=
ROUND_SIZE
(
0
,
size
);
align_size
=
page_size
;
while
(
align_size
<
size
)
align_size
*=
2
;
for
(;;)
...
...
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