From f16706de978322fb69a39bae0dd817fb2fdaeaf2 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 18 Dec 2009 20:32:04 +0000 Subject: 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. --- winsup/cygwin/flock.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/flock.cc') diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc index 11a2a5731..e31add840 100644 --- a/winsup/cygwin/flock.cc +++ b/winsup/cygwin/flock.cc @@ -155,7 +155,8 @@ allow_others_to_sync () to avoid having to alloc 64K from the stack. */ tmp_pathbuf tp; PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR) tp.w_get (); - status = NtQuerySecurityObject (hMainProc, DACL_SECURITY_INFORMATION, sd, + status = NtQuerySecurityObject (NtCurrentProcess (), + DACL_SECURITY_INFORMATION, sd, NT_MAX_PATH * sizeof (WCHAR), &len); if (!NT_SUCCESS (status)) { @@ -182,7 +183,7 @@ allow_others_to_sync () } dacl->AclSize = (char *) ace - (char *) dacl; /* Write the DACL back. */ - status = NtSetSecurityObject (hMainProc, DACL_SECURITY_INFORMATION, sd); + status = NtSetSecurityObject (NtCurrentProcess (), DACL_SECURITY_INFORMATION, sd); if (!NT_SUCCESS (status)) { debug_printf ("NtSetSecurityObject: %p", status); -- cgit v1.2.3