Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess

according to context.  Throughout, replace hMainThread with
	GetCurrentThread/NtCurrentThread according to context.
	* dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to
	hMainProc.  Drop duplication of GetCurrentThread to hMainThread.
	* dtable.cc (dtable::stdio_init): Remove useless comment.
	* globals.cc (hMainProc): Remove.
	(hMainThread): Remove.
	* ntdll.h (NtCurrentProcess): Define.
	(NtCurrentThread: Define.
This commit is contained in:
Corinna Vinschen
2009-12-18 20:32:04 +00:00
parent 333a47d316
commit f16706de97
28 changed files with 103 additions and 89 deletions

View File

@ -263,8 +263,9 @@ slow_pid_reuse (HANDLE h)
windows from reusing the same pid. */
if (last_fork_procs[nfork_procs])
ForceCloseHandle1 (last_fork_procs[nfork_procs], fork_stupidity);
if (DuplicateHandle (hMainProc, h, hMainProc, &last_fork_procs[nfork_procs],
0, FALSE, DUPLICATE_SAME_ACCESS))
if (DuplicateHandle (GetCurrentProcess (), h,
GetCurrentProcess (), &last_fork_procs[nfork_procs],
0, FALSE, DUPLICATE_SAME_ACCESS))
ProtectHandle1 (last_fork_procs[nfork_procs], fork_stupidity);
else
{
@ -287,7 +288,7 @@ frok::parent (volatile char * volatile stack_here)
pinfo child;
static char errbuf[256];
int c_flags = GetPriorityClass (hMainProc);
int c_flags = GetPriorityClass (GetCurrentProcess ());
debug_printf ("priority class %d", c_flags);
/* If we don't have a console, then don't create a console for the