Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-12-18 23:32:04 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-12-18 23:32:04 +0300
commitf16706de978322fb69a39bae0dd817fb2fdaeaf2 (patch)
tree057ab687428b320ffe92db406a7767039756e398 /winsup/cygwin/spawn.cc
parent333a47d316455824fb63bf35938a1c8ea870b84b (diff)
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.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 88b9bf21f..928499614 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -420,9 +420,9 @@ spawn_guts (const char *prog_arg, const char *const *argv,
moreinfo->argv = newargv;
if (mode != _P_OVERLAY ||
- !DuplicateHandle (hMainProc, myself.shared_handle (), hMainProc,
- &moreinfo->myself_pinfo, 0, TRUE,
- DUPLICATE_SAME_ACCESS))
+ !DuplicateHandle (GetCurrentProcess (), myself.shared_handle (),
+ GetCurrentProcess (), &moreinfo->myself_pinfo,
+ 0, TRUE, DUPLICATE_SAME_ACCESS))
moreinfo->myself_pinfo = NULL;
else
VerifyHandle (moreinfo->myself_pinfo);
@@ -445,7 +445,7 @@ spawn_guts (const char *prog_arg, const char *const *argv,
si.cb = sizeof (si);
- c_flags = GetPriorityClass (hMainProc);
+ c_flags = GetPriorityClass (GetCurrentProcess ());
sigproc_printf ("priority class %d", c_flags);
c_flags |= CREATE_SEPARATE_WOW_VDM | CREATE_UNICODE_ENVIRONMENT;
@@ -473,9 +473,9 @@ spawn_guts (const char *prog_arg, const char *const *argv,
generating its own pids again? */
if (cygheap->pid_handle)
/* already done previously */;
- else if (DuplicateHandle (hMainProc, hMainProc, hMainProc,
- &cygheap->pid_handle, PROCESS_QUERY_INFORMATION,
- TRUE, 0))
+ else if (DuplicateHandle (GetCurrentProcess (), GetCurrentProcess (),
+ GetCurrentProcess (), &cygheap->pid_handle,
+ PROCESS_QUERY_INFORMATION, TRUE, 0))
ProtectHandleINH (cygheap->pid_handle);
else
system_printf ("duplicate to pid_handle failed, %E");
@@ -729,8 +729,8 @@ loop:
the fields filled out by child.remember do not disappear and so there
is not a brief period during which the pid is not available.
However, we should try to find another way to do this eventually. */
- DuplicateHandle (hMainProc, child.shared_handle (), pi.hProcess,
- NULL, 0, 0, DUPLICATE_SAME_ACCESS);
+ DuplicateHandle (GetCurrentProcess (), child.shared_handle (),
+ pi.hProcess, NULL, 0, 0, DUPLICATE_SAME_ACCESS);
child->start_time = time (NULL); /* Register child's starting time. */
child->nice = myself->nice;
if (!child.remember (mode == _P_DETACH))