2000-09-08 04:56:55 +02:00
|
|
|
/* shared_info.h: shared info for cygwin
|
2000-09-07 18:23:51 +02:00
|
|
|
|
2013-01-21 05:34:52 +01:00
|
|
|
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
|
|
|
2011, 2012, 2013 Red Hat, Inc.
|
2000-09-07 18:23:51 +02:00
|
|
|
|
|
|
|
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. */
|
|
|
|
|
2000-09-08 04:56:55 +02:00
|
|
|
#include "tty.h"
|
2003-09-10 04:12:26 +02:00
|
|
|
#include "security.h"
|
2008-04-18 22:13:37 +02:00
|
|
|
#include "mtinfo.h"
|
2008-07-24 20:25:52 +02:00
|
|
|
#include "limits.h"
|
2008-12-25 16:55:31 +01:00
|
|
|
#include "mount.h"
|
2000-09-07 18:23:51 +02:00
|
|
|
|
2013-05-23 16:23:01 +02:00
|
|
|
#define CURR_USER_MAGIC 0xab1fcce8U
|
2011-06-08 21:27:48 +02:00
|
|
|
|
2003-09-25 04:29:05 +02:00
|
|
|
class user_info
|
|
|
|
{
|
2010-03-15 22:29:15 +01:00
|
|
|
void initialize ();
|
2003-09-25 04:29:05 +02:00
|
|
|
public:
|
2010-03-15 22:29:15 +01:00
|
|
|
LONG version;
|
2003-09-25 04:29:05 +02:00
|
|
|
DWORD cb;
|
2006-08-01 20:00:44 +02:00
|
|
|
bool warned_msdos;
|
2011-06-08 21:27:48 +02:00
|
|
|
bool warned_notty;
|
2013-05-23 16:23:01 +02:00
|
|
|
bool warned_nonativesyms;
|
2003-09-25 04:29:05 +02:00
|
|
|
mount_info mountinfo;
|
2010-03-15 22:29:15 +01:00
|
|
|
friend void dll_crt0_1 (void *);
|
|
|
|
static void create (bool);
|
2003-09-25 04:29:05 +02:00
|
|
|
};
|
2011-06-08 21:27:48 +02:00
|
|
|
|
2000-09-07 18:23:51 +02:00
|
|
|
/******** Shared Info ********/
|
|
|
|
/* Data accessible to all tasks */
|
|
|
|
|
2001-12-26 22:35:16 +01:00
|
|
|
|
2011-08-09 14:00:27 +02:00
|
|
|
#define CURR_SHARED_MAGIC 0x8fe4d9eeU
|
2001-12-26 05:53:34 +01:00
|
|
|
|
2010-03-15 22:29:15 +01:00
|
|
|
#define USER_VERSION 1
|
2009-01-03 06:12:22 +01:00
|
|
|
|
2001-12-26 07:18:41 +01:00
|
|
|
/* 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. */
|
2000-09-07 18:23:51 +02:00
|
|
|
class shared_info
|
|
|
|
{
|
2010-03-15 22:29:15 +01:00
|
|
|
LONG version;
|
2001-12-26 22:35:16 +01:00
|
|
|
DWORD cb;
|
2001-05-25 05:13:14 +02:00
|
|
|
public:
|
2000-09-07 18:23:51 +02:00
|
|
|
tty_list tty;
|
2008-04-18 22:13:37 +02:00
|
|
|
LONG last_used_bindresvport;
|
2008-07-16 22:20:45 +02:00
|
|
|
DWORD obcaseinsensitive;
|
2008-04-18 22:13:37 +02:00
|
|
|
mtinfo mt;
|
|
|
|
|
2003-09-10 23:01:40 +02:00
|
|
|
void initialize ();
|
2008-07-16 22:20:45 +02:00
|
|
|
void init_obcaseinsensitive ();
|
2001-09-09 21:06:50 +02:00
|
|
|
unsigned heap_chunk_size ();
|
2010-03-15 22:29:15 +01:00
|
|
|
static void create ();
|
2000-09-07 18:23:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern shared_info *cygwin_shared;
|
2005-02-13 19:17:29 +01:00
|
|
|
extern user_info *user_shared;
|
2003-09-25 04:29:05 +02:00
|
|
|
#define mount_table (&(user_shared->mountinfo))
|
|
|
|
extern HANDLE cygwin_user_h;
|
2000-09-07 18:23:51 +02:00
|
|
|
|
2002-10-15 09:03:45 +02:00
|
|
|
enum shared_locations
|
|
|
|
{
|
2008-04-18 22:13:37 +02:00
|
|
|
SH_CYGWIN_SHARED,
|
2003-09-25 04:29:05 +02:00
|
|
|
SH_USER_SHARED,
|
2002-10-15 09:03:45 +02:00
|
|
|
SH_MYSELF,
|
2011-06-07 22:55:10 +02:00
|
|
|
SH_SHARED_CONSOLE,
|
2005-04-29 01:59:44 +02:00
|
|
|
SH_TOTAL_SIZE,
|
|
|
|
SH_JUSTCREATE,
|
|
|
|
SH_JUSTOPEN
|
|
|
|
|
2002-10-15 09:03:45 +02:00
|
|
|
};
|
2008-07-28 00:31:48 +02:00
|
|
|
|
2013-01-21 05:34:52 +01:00
|
|
|
void __reg1 memory_init (bool);
|
2008-07-27 16:52:46 +02:00
|
|
|
void __stdcall shared_destroy ();
|
2000-09-07 18:23:51 +02:00
|
|
|
|
2001-01-28 06:51:15 +01:00
|
|
|
#define shared_align_past(p) \
|
|
|
|
((char *) (system_info.dwAllocationGranularity * \
|
|
|
|
(((DWORD) ((p) + 1) + system_info.dwAllocationGranularity - 1) / \
|
|
|
|
system_info.dwAllocationGranularity)))
|
|
|
|
|
2008-04-18 22:13:37 +02:00
|
|
|
HANDLE get_shared_parent_dir ();
|
2008-04-21 14:46:58 +02:00
|
|
|
HANDLE get_session_parent_dir ();
|
2008-04-18 22:13:37 +02:00
|
|
|
char *__stdcall shared_name (char *, const char *, int);
|
2009-01-26 14:42:37 +01:00
|
|
|
WCHAR *__stdcall shared_name (WCHAR *, const WCHAR *, int);
|
2010-03-09 22:26:55 +01:00
|
|
|
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);
|
2008-07-28 00:31:48 +02:00
|
|
|
extern void user_shared_create (bool reinit);
|