1 /* shared_info.h: shared info for cygwin
3 Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
25 /******** Shared Info ********/
26 /* Data accessible to all tasks */
28 #define SHARED_VERSION (unsigned)(cygwin_version.api_major << 8 | \
29 cygwin_version.api_minor)
30 #define SHARED_VERSION_MAGIC CYGWIN_VERSION_MAGIC (SHARED_MAGIC, SHARED_VERSION)
32 #define SHARED_INFO_CB 31136
34 #define CURR_SHARED_MAGIC 0x18da899eU
36 #define USER_VERSION 1 // increment when mount table changes and
37 #define USER_VERSION_MAGIC CYGWIN_VERSION_MAGIC (USER_MAGIC, USER_VERSION)
38 #define CURR_USER_MAGIC 0xb2232e71U
40 /* NOTE: Do not make gratuitous changes to the names or organization of the
41 below class. The layout is checksummed to determine compatibility between
42 different cygwin versions. */
49 bool heap_slop_inited;
51 DWORD sys_mount_table_counter;
53 LONG last_used_bindresvport;
54 DWORD obcaseinsensitive;
58 void init_obcaseinsensitive ();
59 unsigned heap_chunk_size ();
60 unsigned heap_slop_size ();
63 extern shared_info *cygwin_shared;
64 extern user_info *user_shared;
65 #define mount_table (&(user_shared->mountinfo))
66 extern HANDLE cygwin_user_h;
80 void memory_init (bool) __attribute__ ((regparm(1)));
81 void __stdcall shared_destroy ();
83 #define shared_align_past(p) \
84 ((char *) (system_info.dwAllocationGranularity * \
85 (((DWORD) ((p) + 1) + system_info.dwAllocationGranularity - 1) / \
86 system_info.dwAllocationGranularity)))
91 tty_min tty_min_state;
92 dev_console dev_state;
96 HANDLE get_shared_parent_dir ();
97 HANDLE get_session_parent_dir ();
98 char *__stdcall shared_name (char *, const char *, int);
99 WCHAR *__stdcall shared_name (WCHAR *, const WCHAR *, int);
100 void *__stdcall open_shared (const WCHAR *name, int n, HANDLE &shared_h,
101 DWORD size, shared_locations&,
102 PSECURITY_ATTRIBUTES psa = &sec_all,
103 DWORD access = FILE_MAP_READ | FILE_MAP_WRITE);
104 extern void user_shared_create (bool reinit);
105 extern void user_shared_initialize ();
106 extern void init_installation_root ();
107 extern WCHAR installation_root[PATH_MAX];
108 extern UNICODE_STRING installation_key;