Commit d389da09 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Store debug options in the PEB memory block.

parent 4e8fcc41
......@@ -292,7 +292,18 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_
*/
void dbg_init(void)
{
struct __wine_debug_channel *options, default_option = { default_flags };
setbuf( stdout, NULL );
setbuf( stderr, NULL );
if (nb_debug_options == -1) init_options();
options = (struct __wine_debug_channel *)((char *)NtCurrentTeb()->Peb + (is_win64 ? 2 : 1) * page_size);
memcpy( options, debug_options, nb_debug_options * sizeof(*options) );
free( debug_options );
debug_options = options;
options[nb_debug_options] = default_option;
ntdll_get_thread_data()->debug_info = (struct debug_info *)(options + nb_debug_options + 1);
init_done = TRUE;
}
......@@ -2894,7 +2894,6 @@ static TEB *init_teb( void *ptr, PEB *peb, BOOL is_wow )
*/
TEB *virtual_alloc_first_teb(void)
{
struct ntdll_thread_data *thread_data;
TEB *teb;
PEB *peb;
void *ptr;
......@@ -2921,8 +2920,6 @@ TEB *virtual_alloc_first_teb(void)
peb = init_peb( (char *)teb_block + 31 * block_size );
teb = init_teb( ptr, peb, FALSE );
*(ULONG_PTR *)&peb->CloudFileFlags = get_image_address();
thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch;
thread_data->debug_info = (struct debug_info *)((char *)teb_block + 31 * block_size + 2 * page_size);
return teb;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment