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
9055e9e3
Commit
9055e9e3
authored
Jan 22, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Set the heap debug flags based on the GlobalFlag value.
parent
e7810c8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
heap.c
dlls/ntdll/heap.c
+33
-0
loader.c
dlls/ntdll/loader.c
+1
-0
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
No files found.
dlls/ntdll/heap.c
View file @
9055e9e3
...
...
@@ -155,6 +155,12 @@ typedef struct tagHEAP
#define HEAP_DEF_SIZE 0x110000
/* Default heap size = 1Mb + 64Kb */
#define COMMIT_MASK 0xffff
/* bitmask for commit/decommit granularity */
/* some undocumented flags (names are made up) */
#define HEAP_PAGE_ALLOCS 0x01000000
#define HEAP_VALIDATE 0x10000000
#define HEAP_VALIDATE_ALL 0x20000000
#define HEAP_VALIDATE_PARAMS 0x40000000
static
HEAP
*
processHeap
;
/* main process heap */
static
BOOL
HEAP_IsRealArena
(
HEAP
*
heapPtr
,
DWORD
flags
,
LPCVOID
block
,
BOOL
quiet
);
...
...
@@ -1233,6 +1239,32 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
/***********************************************************************
* heap_set_debug_flags
*/
void
heap_set_debug_flags
(
HANDLE
handle
)
{
HEAP
*
heap
=
HEAP_GetPtr
(
handle
);
ULONG
global_flags
=
RtlGetNtGlobalFlags
();
ULONG
flags
=
0
;
if
(
global_flags
&
FLG_HEAP_ENABLE_TAIL_CHECK
)
flags
|=
HEAP_TAIL_CHECKING_ENABLED
;
if
(
global_flags
&
FLG_HEAP_ENABLE_FREE_CHECK
)
flags
|=
HEAP_FREE_CHECKING_ENABLED
;
if
(
global_flags
&
FLG_HEAP_DISABLE_COALESCING
)
flags
|=
HEAP_DISABLE_COALESCE_ON_FREE
;
if
(
global_flags
&
FLG_HEAP_PAGE_ALLOCS
)
flags
|=
HEAP_PAGE_ALLOCS
|
HEAP_GROWABLE
;
if
(
global_flags
&
FLG_HEAP_VALIDATE_PARAMETERS
)
flags
|=
HEAP_VALIDATE
|
HEAP_VALIDATE_PARAMS
|
HEAP_TAIL_CHECKING_ENABLED
|
HEAP_FREE_CHECKING_ENABLED
;
if
(
global_flags
&
FLG_HEAP_VALIDATE_ALL
)
flags
|=
HEAP_VALIDATE
|
HEAP_VALIDATE_ALL
|
HEAP_TAIL_CHECKING_ENABLED
|
HEAP_FREE_CHECKING_ENABLED
;
heap
->
flags
|=
flags
;
heap
->
force_flags
|=
flags
&
~
(
HEAP_VALIDATE
|
HEAP_DISABLE_COALESCE_ON_FREE
);
}
/***********************************************************************
* RtlCreateHeap (NTDLL.@)
*
* Create a new Heap.
...
...
@@ -1278,6 +1310,7 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
list_init
(
&
processHeap
->
entry
);
}
heap_set_debug_flags
(
subheap
->
heap
);
return
subheap
->
heap
;
}
...
...
dlls/ntdll/loader.c
View file @
9055e9e3
...
...
@@ -2656,6 +2656,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
if
((
status
=
fixup_imports
(
wm
,
load_path
))
!=
STATUS_SUCCESS
)
goto
error
;
if
((
status
=
alloc_process_tls
())
!=
STATUS_SUCCESS
)
goto
error
;
if
((
status
=
alloc_thread_tls
())
!=
STATUS_SUCCESS
)
goto
error
;
heap_set_debug_flags
(
GetProcessHeap
()
);
status
=
wine_call_on_stack
(
attach_process_dlls
,
wm
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
if
(
status
!=
STATUS_SUCCESS
)
goto
error
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
9055e9e3
...
...
@@ -70,6 +70,7 @@ extern void actctx_init(void);
extern
void
virtual_init
(
void
);
extern
void
virtual_init_threading
(
void
);
extern
void
fill_cpu_info
(
void
);
extern
void
heap_set_debug_flags
(
HANDLE
handle
);
/* server support */
extern
timeout_t
server_start_time
;
...
...
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