OSDN Git Service

Use datarootdir for locales.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / wincap.h
1 /* wincap.h: Header for OS capability class.
2
3    Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4    2009, 2010, 2011 Red Hat, Inc.
5
6 This file is part of Cygwin.
7
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
10 details. */
11
12 #ifndef _WINCAP_H
13 #define _WINCAP_H
14
15 struct wincaps
16 {
17   DWORD    max_sys_priv;
18   unsigned is_server                                    : 1;
19   unsigned has_physical_mem_access                      : 1;
20   unsigned has_create_global_privilege                  : 1;
21   unsigned has_ioctl_storage_get_media_types_ex         : 1;
22   unsigned has_disk_ex_ioctls                           : 1;
23   unsigned has_buggy_restart_scan                       : 1;
24   unsigned has_mandatory_integrity_control              : 1;
25   unsigned needs_logon_sid_in_sid_list                  : 1;
26   unsigned needs_count_in_si_lpres2                     : 1;
27   unsigned has_recycle_dot_bin                          : 1;
28   unsigned has_gaa_prefixes                             : 1;
29   unsigned has_gaa_on_link_prefix                       : 1;
30   unsigned supports_all_posix_ai_flags                  : 1;
31   unsigned has_restricted_stack_args                    : 1;
32   unsigned has_transactions                             : 1;
33   unsigned has_recvmsg                                  : 1;
34   unsigned has_sendmsg                                  : 1;
35   unsigned has_broken_udf                               : 1;
36   unsigned has_console_handle_problem                   : 1;
37   unsigned has_broken_alloc_console                     : 1;
38   unsigned has_always_all_codepages                     : 1;
39   unsigned has_localenames                              : 1;
40   unsigned has_fast_cwd                                 : 1;
41   unsigned has_restricted_raw_disk_access               : 1;
42   unsigned use_dont_resolve_hack                        : 1;
43   unsigned has_stack_size_param_is_a_reservation        : 1;
44   unsigned has_console_logon_sid                        : 1;
45   unsigned wow64_has_secondary_stack                    : 1;
46 };
47
48 class wincapc
49 {
50   SYSTEM_INFO      system_info;
51   OSVERSIONINFOEX  version;
52   char             osnam[40];
53   ULONG            wow64;
54   void             *caps;
55
56 public:
57   void init ();
58
59   const DWORD cpu_count () const { return system_info.dwNumberOfProcessors; }
60   const DWORD page_size () const { return system_info.dwPageSize; }
61   const DWORD allocation_granularity () const
62                               { return system_info.dwAllocationGranularity; }
63   const char *osname () const { return osnam; }
64   const bool is_wow64 () const { return wow64; }
65
66 #define IMPLEMENT(cap) cap() const { return ((wincaps *) this->caps)->cap; }
67
68   DWORD IMPLEMENT (max_sys_priv)
69   bool  IMPLEMENT (is_server)
70   bool  IMPLEMENT (has_physical_mem_access)
71   bool  IMPLEMENT (has_create_global_privilege)
72   bool  IMPLEMENT (has_ioctl_storage_get_media_types_ex)
73   bool  IMPLEMENT (has_disk_ex_ioctls)
74   bool  IMPLEMENT (has_buggy_restart_scan)
75   bool  IMPLEMENT (has_mandatory_integrity_control)
76   bool  IMPLEMENT (needs_logon_sid_in_sid_list)
77   bool  IMPLEMENT (needs_count_in_si_lpres2)
78   bool  IMPLEMENT (has_recycle_dot_bin)
79   bool  IMPLEMENT (has_gaa_prefixes)
80   bool  IMPLEMENT (has_gaa_on_link_prefix)
81   bool  IMPLEMENT (supports_all_posix_ai_flags)
82   bool  IMPLEMENT (has_restricted_stack_args)
83   bool  IMPLEMENT (has_transactions)
84   bool  IMPLEMENT (has_recvmsg)
85   bool  IMPLEMENT (has_sendmsg)
86   bool  IMPLEMENT (has_broken_udf)
87   bool  IMPLEMENT (has_console_handle_problem)
88   bool  IMPLEMENT (has_broken_alloc_console)
89   bool  IMPLEMENT (has_always_all_codepages)
90   bool  IMPLEMENT (has_localenames)
91   bool  IMPLEMENT (has_fast_cwd)
92   bool  IMPLEMENT (has_restricted_raw_disk_access)
93   bool  IMPLEMENT (use_dont_resolve_hack)
94   bool  IMPLEMENT (has_stack_size_param_is_a_reservation)
95   bool  IMPLEMENT (has_console_logon_sid)
96   bool  IMPLEMENT (wow64_has_secondary_stack)
97
98 #undef IMPLEMENT
99 };
100
101 extern wincapc wincap;
102
103 #endif /* _WINCAP_H */