Bug fix: added temp structure to cope with debug traces during thread

startup.
This commit is contained in:
Alexandre Julliard 2000-01-29 20:02:07 +00:00
parent 0dd3655fd0
commit 01de6dce46
1 changed files with 8 additions and 1 deletions

View File

@ -18,14 +18,21 @@ struct debug_info
char output[500]; /* current output line */ char output[500]; /* current output line */
}; };
static struct debug_info tmp;
static inline struct debug_info *get_info(void) static inline struct debug_info *get_info(void)
{ {
struct debug_info *info = NtCurrentTeb()->debug_info; struct debug_info *info = NtCurrentTeb()->debug_info;
if (!info) if (!info)
{ {
NtCurrentTeb()->debug_info = info = HeapAlloc( GetProcessHeap(), 0, sizeof(*info) ); /* setup the temp structure in case HeapAlloc wants to print something */
NtCurrentTeb()->debug_info = &tmp;
tmp.str_pos = tmp.strings;
tmp.out_pos = tmp.output;
info = HeapAlloc( GetProcessHeap(), 0, sizeof(*info) );
info->str_pos = info->strings; info->str_pos = info->strings;
info->out_pos = info->output; info->out_pos = info->output;
NtCurrentTeb()->debug_info = info;
} }
return info; return info;
} }