newlib/winsup/cygwin/shared_info.h
Corinna Vinschen 8895d962d5 * cygheap.cc (init_cygheap::init_installation_root): Convert function
init_installation_root into a cygheap method.
	* cygheap.h (struct init_cygheap): Move installation_root,
	installation_key, and installation_key_buf from shared
	.cygwin_dll_common DLL section to cygheap.  Declare new method
	init_installation_root.
	* dtable.cc (handle_to_fn): Accommodate the move of installation strings
	to the cygheap.
	* external.cc (cygwin_internal): Ditto.
	* fhandler_console.cc (fhandler_console::open_shared_console): Ditto.
	* fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Ditto.
	* fhandler_tty.cc: Ditto, throughout.
	* mount.cc (mount_info::init): Ditto.
	* pipe.cc (fhandler_pipe::create): Ditto.
	* shared.cc: Ditto, throughout.
	(installation_root): Remove.
	(installation_key): Move to cygheap.
	(installation_key_buf): Ditto.
	(installation_root_inited): Remove.
	(SPIN_WAIT): Remove.
	(init_installation_root): Move to cygheap.
	(memory_init): Call cygheap->init_installation_root right after
	cygheap->user.init.  Drop call of init_installation_root function.
	* shared_info.h (init_installation_root): Drop declaration.
	(installation_root): Ditto.
	(installation_key): Ditto.
	* uinfo.cc (pwdgrp::load): Accommodate the move of installation strings
	to the cygheap.
2012-02-14 11:27:43 +00:00

96 lines
2.4 KiB
C++

/* shared_info.h: shared info for cygwin
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009,
2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "tty.h"
#include "security.h"
#include "mtinfo.h"
#include "limits.h"
#include "mount.h"
#define CURR_USER_MAGIC 0x6467403bU
class user_info
{
void initialize ();
public:
LONG version;
DWORD cb;
bool warned_msdos;
bool warned_notty;
mount_info mountinfo;
friend void dll_crt0_1 (void *);
static void create (bool);
};
/******** Shared Info ********/
/* Data accessible to all tasks */
#define CURR_SHARED_MAGIC 0x8fe4d9eeU
#define USER_VERSION 1
/* NOTE: Do not make gratuitous changes to the names or organization of the
below class. The layout is checksummed to determine compatibility between
different cygwin versions. */
class shared_info
{
LONG version;
DWORD cb;
public:
tty_list tty;
LONG last_used_bindresvport;
DWORD obcaseinsensitive;
mtinfo mt;
void initialize ();
void init_obcaseinsensitive ();
unsigned heap_chunk_size ();
static void create ();
};
extern shared_info *cygwin_shared;
extern user_info *user_shared;
#define mount_table (&(user_shared->mountinfo))
extern HANDLE cygwin_user_h;
enum shared_locations
{
SH_CYGWIN_SHARED,
SH_USER_SHARED,
SH_MYSELF,
SH_SHARED_CONSOLE,
SH_TOTAL_SIZE,
SH_JUSTCREATE,
SH_JUSTOPEN
};
void memory_init (bool) __attribute__ ((regparm(1)));
void __stdcall shared_destroy ();
#define shared_align_past(p) \
((char *) (system_info.dwAllocationGranularity * \
(((DWORD) ((p) + 1) + system_info.dwAllocationGranularity - 1) / \
system_info.dwAllocationGranularity)))
HANDLE get_shared_parent_dir ();
HANDLE get_session_parent_dir ();
char *__stdcall shared_name (char *, const char *, int);
WCHAR *__stdcall shared_name (WCHAR *, const WCHAR *, int);
void *__stdcall open_shared (const WCHAR *, int, HANDLE&, DWORD,
shared_locations, PSECURITY_ATTRIBUTES = &sec_all,
DWORD = FILE_MAP_READ | FILE_MAP_WRITE);
void *__stdcall open_shared (const WCHAR *, int, HANDLE&, DWORD,
shared_locations *, PSECURITY_ATTRIBUTES = &sec_all,
DWORD = FILE_MAP_READ | FILE_MAP_WRITE);
extern void user_shared_create (bool reinit);