mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-14 17:59:28 +08:00
6e75c72b89
(mainly in fhandler*) start fixing gcc 4.7.2 mismatch between regparm definitions and declarations. * gendef: Define some functions to take @ declaration to accommodate _regN defines which use __stdcall. * gentls_offsets: Define __regN macros as empty. * autoload.cc (wsock_init): Remove unneeded regparm attribute. * winsup.h (__reg1): Define. (__reg2): Define. (__reg3): Define. * advapi32.cc (DuplicateTokenEx): Coerce some initializers to avoid warnings from gcc 4.7.2. * exceptions.cc (status_info): Declare struct to use NTSTATUS. (cygwin_exception::dump_exception): Coerce e->ExceptionCode to NTSTATUS. * fhandler_clipboard.cc (cygnativeformat): Redefine as UINT to avoid gcc 4.7.2 warnings. (fhandler_dev_clipboard::read): Ditto.
96 lines
2.3 KiB
C++
96 lines
2.3 KiB
C++
/* shared_info.h: shared info for cygwin
|
|
|
|
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
|
2011, 2012, 2013 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 __reg1 memory_init (bool);
|
|
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);
|