* cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely
since hProcImpToken isn't initialized here. * shared.cc (open_shared): Always print mapname instead of name in debug output.
This commit is contained in:
parent
e0be0a1d50
commit
f1cdab8563
@ -1,3 +1,10 @@
|
|||||||
|
2005-09-27 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely
|
||||||
|
since hProcImpToken isn't initialized here.
|
||||||
|
* shared.cc (open_shared): Always print mapname instead of name in
|
||||||
|
debug output.
|
||||||
|
|
||||||
2005-09-27 Christopher Faylor <cgf@timesys.com>
|
2005-09-27 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* strace.cc (strace::vsprntf): Avoid printing a zero pid.
|
* strace.cc (strace::vsprntf): Avoid printing a zero pid.
|
||||||
|
@ -170,7 +170,7 @@ cygheap_init ()
|
|||||||
if (!cygheap->shared_prefix)
|
if (!cygheap->shared_prefix)
|
||||||
cygheap->shared_prefix = cstrdup (
|
cygheap->shared_prefix = cstrdup (
|
||||||
wincap.has_terminal_services ()
|
wincap.has_terminal_services ()
|
||||||
&& (set_process_privilege (SE_CREATE_GLOBAL_PRIV, true) >= 0
|
&& (set_privilege (hProcToken, SE_CREATE_GLOBAL_PRIV, true) >= 0
|
||||||
|| GetLastError () == ERROR_NO_SUCH_PRIVILEGE)
|
|| GetLastError () == ERROR_NO_SUCH_PRIVILEGE)
|
||||||
? "Global\\" : "");
|
? "Global\\" : "");
|
||||||
}
|
}
|
||||||
|
@ -89,15 +89,14 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
|
|||||||
VirtualFree (addr, 0, MEM_RELEASE);
|
VirtualFree (addr, 0, MEM_RELEASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char map_buf[CYG_MAX_PATH];
|
||||||
|
char *mapname = NULL;
|
||||||
|
|
||||||
if (shared_h)
|
if (shared_h)
|
||||||
m = SH_JUSTOPEN;
|
m = SH_JUSTOPEN;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *mapname;
|
if (name)
|
||||||
char map_buf[CYG_MAX_PATH];
|
|
||||||
if (!name)
|
|
||||||
mapname = NULL;
|
|
||||||
else
|
|
||||||
mapname = shared_name (map_buf, name, n);
|
mapname = shared_name (map_buf, name, n);
|
||||||
if (m == SH_JUSTOPEN)
|
if (m == SH_JUSTOPEN)
|
||||||
shared_h = OpenFileMapping (access, FALSE, mapname);
|
shared_h = OpenFileMapping (access, FALSE, mapname);
|
||||||
@ -133,7 +132,7 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!shared)
|
if (!shared)
|
||||||
api_fatal ("MapViewOfFileEx '%s'(%p), %E. Terminating.", name, shared_h);
|
api_fatal ("MapViewOfFileEx '%s'(%p), %E. Terminating.", mapname, shared_h);
|
||||||
|
|
||||||
if (m == SH_CYGWIN_SHARED && offsets[0] && wincap.needs_memory_protection ())
|
if (m == SH_CYGWIN_SHARED && offsets[0] && wincap.needs_memory_protection ())
|
||||||
{
|
{
|
||||||
@ -155,7 +154,7 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_printf ("name %s, n %d, shared %p (wanted %p), h %p", name, n, shared, addr, shared_h);
|
debug_printf ("name %s, n %d, shared %p (wanted %p), h %p", mapname, n, shared, addr, shared_h);
|
||||||
|
|
||||||
return shared;
|
return shared;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user