diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c9f1a7ca2..b9959684d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,52 @@ +2011-04-04 Corinna Vinschen + + Drop NT4 support. + * autoload.cc (DnsQuery_A): Fatal if not available. + (DnsRecordListFree): Ditto. + (DsGetDcNameW): Ditto. + (NetGetAnyDCName): Remove. + (NetGetDCName): Remove. + (EnumProcessModules): Fatal if not available. + (GetModuleFileNameExW): Ditto. + (GetModuleInformation): Ditto. + (GetProcessMemoryInfo): Ditto. + (QueryWorkingSet): Ditto. + (LsaRegisterLogonProcess): Ditto. + * fenv.cc (_feinitialise): Drop supports_sse condition. + * fhandler_disk_file.cc (path_conv::isgood_inode): Fix comment. + (fhandler_base::fstat_by_name): Drop has_fileid_dirinfo condition. + (fhandler_disk_file::opendir): Ditto. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Fix comment. + * fhandler_proc.cc (format_proc_partitions): Drop NT4-only code. + * fhandler_process.cc (get_process_state): Ditto. + * kernel32.cc (GetWindowsDirectoryW): Remove. + (GetWindowsDirectoryA): Remove. + * miscfuncs.cc (nice_to_winprio): Drop NT4-only code. + * mount.cc (fs_info::update): Fix comments. + * net.cc (get_2k_ifs): Drop NT4-only code. + * sec_auth.cc (get_logon_server): Ditto. + (lsaauth): Drop NT4-specific error handling. + * security.cc (alloc_sd): Set SE_DACL_PROTECTED unconditionally. + * select.cc (select_stuff::wait): Always use MWMO_INPUTAVAILABLE. + (peek_windows): Drop NT4-only condition in call to PeekMessage. + * syscalls.cc (gethostid): Remove NT4-only workaround. + * wincap.cc: Througout, drop has_dacl_protect, + has_broken_if_oper_status, has_process_io_counters, + has_terminal_services, has_extended_priority_class, has_guid_volumes, + has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse from + wincaps. + (wincap_nt4sp4): Remove. + (wincap_minimal): Set to wincap_2000. + (wincapc::init): Rely on availability of OSVERSIONINFOEX structure. + Treat error from GetVersionEx as fatal. Treat NT4 as fatal. + * wincap.h (struct wincaps): Drop has_dacl_protect, + has_broken_if_oper_status, has_process_io_counters, + has_terminal_services, has_extended_priority_class, has_guid_volumes, + has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse flags + and methods. + * winlean.h (GetWindowsDirectoryW) Define as GetSystemWindowsDirectoryW. + (GetWindowsDirectoryA): Define as GetSystemWindowsDirectoryA. + 2011-04-04 Corinna Vinschen * dtable.cc (dtable::init_std_file_from_handle): Fix a comment to diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 54c4cab32..53812e06b 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -383,8 +383,8 @@ LoadDLLfunc (RegisterEventSourceW, 8, advapi32) LoadDLLfunc (ReportEventW, 36, advapi32) #endif -LoadDLLfuncEx2 (DnsQuery_A, 24, dnsapi, 1, 127) // ERROR_PROC_NOT_FOUND -LoadDLLfuncEx (DnsRecordListFree, 8, dnsapi, 1) +LoadDLLfunc (DnsQuery_A, 24, dnsapi) +LoadDLLfunc (DnsRecordListFree, 8, dnsapi) // 50 = ERROR_NOT_SUPPORTED. Returned if OS doesn't support iphlpapi funcs LoadDLLfuncEx2 (GetAdaptersAddresses, 20, iphlpapi, 1, 50) @@ -407,10 +407,8 @@ LoadDLLfunc (WNetGetResourceInformationA, 16, mpr) LoadDLLfunc (WNetOpenEnumA, 20, mpr) /* 127 == ERROR_PROC_NOT_FOUND */ -LoadDLLfuncEx2 (DsGetDcNameW, 24, netapi32, 1, 127) +LoadDLLfunc (DsGetDcNameW, 24, netapi32) LoadDLLfunc (NetApiBufferFree, 4, netapi32) -LoadDLLfunc (NetGetAnyDCName, 12, netapi32) -LoadDLLfunc (NetGetDCName, 12, netapi32) LoadDLLfunc (NetUserGetGroups, 28, netapi32) LoadDLLfunc (NetUserGetInfo, 16, netapi32) LoadDLLfunc (NetUserGetLocalGroups, 32, netapi32) @@ -423,22 +421,17 @@ LoadDLLfunc (RtlSetCurrentTransaction, 4, ntdll) LoadDLLfunc (CoTaskMemFree, 4, ole32) -LoadDLLfuncEx (EnumProcessModules, 16, psapi, 1) -LoadDLLfuncEx (GetModuleFileNameExW, 16, psapi, 1) -LoadDLLfuncEx (GetModuleInformation, 16, psapi, 1) -LoadDLLfuncEx (GetProcessMemoryInfo, 12, psapi, 1) -LoadDLLfuncEx (QueryWorkingSet, 12, psapi, 1) +LoadDLLfunc (EnumProcessModules, 16, psapi) +LoadDLLfunc (GetModuleFileNameExW, 16, psapi) +LoadDLLfunc (GetModuleInformation, 16, psapi) +LoadDLLfunc (GetProcessMemoryInfo, 12, psapi) +LoadDLLfunc (QueryWorkingSet, 12, psapi) LoadDLLfunc (LsaDeregisterLogonProcess, 4, secur32) LoadDLLfunc (LsaFreeReturnBuffer, 4, secur32) LoadDLLfunc (LsaLogonUser, 56, secur32) LoadDLLfunc (LsaLookupAuthenticationPackage, 12, secur32) -/* secur32 functions return NTSTATUS values. However, the error code must - fit in 16 bits , see LoadDLLprime. - The calling function, lsaauth(), checks for STATUS_SUCCESS (0), so we - simply return some arbitrary non-0 value (127 == ERROR_PROC_NOT_FOUND) - from here, if the function can't be loaded. */ -LoadDLLfuncEx2 (LsaRegisterLogonProcess, 12, secur32, 1, 127) +LoadDLLfunc (LsaRegisterLogonProcess, 12, secur32) LoadDLLfunc (SHGetDesktopFolder, 4, shell32) diff --git a/winsup/cygwin/fenv.cc b/winsup/cygwin/fenv.cc index 87466365a..30bffcfce 100755 --- a/winsup/cygwin/fenv.cc +++ b/winsup/cygwin/fenv.cc @@ -423,7 +423,7 @@ _feinitialise (void) __asm__ volatile ("cpuid" : "=d" (edx), "+a" (eax) :: "%ecx", "%ebx"); /* If this flag isn't set, or if the OS doesn't support SSE (NT4, at least up to SP4) we'll avoid trying to execute any SSE. */ - if ((edx & (1 << 25)) != 0 && wincap.supports_sse ()) + if ((edx & (1 << 25)) != 0) use_sse = true; /* Reset FPU: extended prec, all exceptions cleared and masked off. */ diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 89283590b..1889a5d07 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -140,8 +140,7 @@ inline bool path_conv::isgood_inode (__ino64_t ino) const { /* We can't trust remote inode numbers of only 32 bit. That means, - all remote inode numbers when running under NT4, as well as remote NT4 - NTFS, as well as shares of Samba version < 3.0. + remote NT4 NTFS, as well as shares of Samba version < 3.0. The known exception are SFU NFS shares, which return the valid 32 bit inode number from the remote file system unchanged. */ return hasgood_inode () && (ino > UINT32_MAX || !isremote () || fs_is_nfs ()); @@ -404,8 +403,7 @@ fhandler_base::fstat_by_name (struct __stat64 *buf) WCHAR buf[NAME_MAX + 1]; } fdi_buf; - if (!ino && pc.hasgood_inode () - && wincap.has_fileid_dirinfo () && !pc.has_buggy_fileid_dirinfo ()) + if (!ino && pc.hasgood_inode () && !pc.has_buggy_fileid_dirinfo ()) { RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, &basename); InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (), @@ -1679,8 +1677,7 @@ fhandler_disk_file::opendir (int fd) dir->__flags |= dirent_set_d_ino; if (pc.fs_is_nfs ()) dir->__flags |= dirent_nfs_d_ino; - else if (wincap.has_fileid_dirinfo () - && !pc.has_buggy_fileid_dirinfo ()) + else if (!pc.has_buggy_fileid_dirinfo ()) dir->__flags |= dirent_get_d_ino; } } diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc index 94071de00..18310b913 100644 --- a/winsup/cygwin/fhandler_netdrive.cc +++ b/winsup/cygwin/fhandler_netdrive.cc @@ -1,6 +1,6 @@ /* fhandler_netdrive.cc: fhandler for // and //MACHINE handling - Copyright 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc. + Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -245,7 +245,6 @@ fhandler_netdrive::readdir (DIR *dir, dirent *de) { de->d_ino = readdir_get_ino (nro->lpRemoteName, false); /* We can't trust remote inode numbers of only 32 bit. That means, - all remote inode numbers when running under NT4, as well as remote NT4 NTFS, as well as shares of Samba version < 3.0. */ if (de->d_ino <= UINT_MAX) de->d_ino = hash_path_name (0, nro->lpRemoteName); diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc index 7ca669c84..86cafba46 100644 --- a/winsup/cygwin/fhandler_proc.cc +++ b/winsup/cygwin/fhandler_proc.cc @@ -1193,17 +1193,6 @@ format_proc_partitions (void *, char *&destbuf) pi = (PARTITION_INFORMATION *) ioctl_buf; size = pi->PartitionLength.QuadPart; } - else if (DeviceIoControl (devhdl, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, - ioctl_buf, NT_MAX_PATH, &bytes_read, NULL)) - { - /* NT4 doesn't support to call IOCTL_DISK_GET_PARTITION_INFO for the - entire drive. */ - DISK_GEOMETRY *dg = (DISK_GEOMETRY *) ioctl_buf; - size = (unsigned long long) dg->Cylinders.QuadPart - * dg->TracksPerCylinder - * dg->SectorsPerTrack - * dg->BytesPerSector; - } else { debug_printf ("DeviceIoControl (%S, " diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 80ca6573f..599f242b5 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -1,6 +1,7 @@ /* fhandler_process.cc: fhandler for /proc/ virtual filesystem - Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Red Hat, Inc. + Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -958,19 +959,7 @@ get_process_state (DWORD dwProcessId) if (sp->ProcessId == dwProcessId) { SYSTEM_THREADS *st; - if (wincap.has_process_io_counters ()) - /* - * Windows 2000 and XP have an extra member in SYSTEM_PROCESSES - * which means the offset of the first SYSTEM_THREADS entry is - * different on these operating systems compared to NT 4. - */ - st = &sp->Threads[0]; - else - /* - * 136 is the offset of the first SYSTEM_THREADS entry on - * Windows NT 4. - */ - st = (SYSTEM_THREADS *) ((char *) sp + 136); + st = &sp->Threads[0]; state = 'S'; for (unsigned i = 0; i < sp->ThreadCount; i++) { diff --git a/winsup/cygwin/kernel32.cc b/winsup/cygwin/kernel32.cc index f8fd728cd..fd25358aa 100644 --- a/winsup/cygwin/kernel32.cc +++ b/winsup/cygwin/kernel32.cc @@ -1,6 +1,6 @@ /* kernel32.cc: Win32 replacement functions. - Copyright 2008, 2010 Red Hat, Inc. + Copyright 2008, 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -403,37 +403,3 @@ OpenFileMappingA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) } return OpenFileMappingW (dwDesiredAccess, bInheritHandle, lpName ? name : NULL); } - -/* When Terminal Services are installed, the GetWindowsDirectory function - does not return the system installation dir, but a user specific directory - instead. That's not what we have in mind when calling GetWindowsDirectory - from within Cygwin. So we're calling GetSystemWindowsDirectory from here, - except on NT4 where we use the method as described in KB186498. */ - -#define SYSTEM32 (sizeof ("\\System32") - 1) - -UINT WINAPI -GetWindowsDirectoryW (LPWSTR buf, UINT size) -{ - if (wincap.has_terminal_services ()) - return GetSystemWindowsDirectoryW (buf, size); - /* NT4 */ - WCHAR name [size + SYSTEM32]; - UINT ret = GetSystemDirectoryW (name, size + SYSTEM32); - if (ret < size + SYSTEM32) - { - name[ret - SYSTEM32] = L'\0'; - wcscpy (buf, name); - } - return ret - SYSTEM32; -} - -UINT WINAPI -GetWindowsDirectoryA (LPSTR buf, UINT size) -{ - WCHAR name[MAX_PATH]; - UINT ret = GetWindowsDirectoryW (name, min (size, MAX_PATH)); - if (ret < size) - sys_wcstombs (buf, size, name); - return ret; -} diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index c7099dc9b..706347240 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -1,7 +1,7 @@ /* miscfuncs.cc: misc funcs that don't belong anywhere else Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -312,10 +312,6 @@ nice_to_winprio (int &nice) else if (nice > NZERO - 1) nice = NZERO - 1; DWORD prio = priority[nice + NZERO]; - if (!wincap.has_extended_priority_class () - && (prio == BELOW_NORMAL_PRIORITY_CLASS - || prio == ABOVE_NORMAL_PRIORITY_CLASS)) - prio = NORMAL_PRIORITY_CLASS; return prio; } diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index 3af8c51da..79ab59c2c 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -1,7 +1,7 @@ /* mount.cc: mount handling. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Red Hat, Inc. + 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -321,7 +321,6 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) #define WIN_FAT_FLAGS (FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK) #define FS_IS_WINDOWS_FAT TEST_GVI(flags (), WIN_FAT_FLAGS) - /* This always fails on NT4. */ if ((flags () & FILE_SUPPORTS_OBJECT_IDS) && NT_SUCCESS (NtQueryVolumeInformationFile (vol, &io, &ffoi, sizeof ffoi, @@ -338,8 +337,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) /* First check the remote filesystems claiming to be NTFS. */ if (!got_fs () && is_ntfs (RtlEqualUnicodeString (&fsname, &ro_u_ntfs, FALSE)) - /* Test for Samba on NT4 or for older Samba releases not supporting - extended info. */ + /* Test for older Samba releases not supporting extended info. */ && !is_samba (FS_IS_SAMBA) /* Netapp inode info is unusable, can't handle trailing dots and spaces, has a bug in "move and delete" semantics. */ diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index c9d219d6e..891beabd7 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -2194,10 +2194,7 @@ get_2k_ifs () if (ifrow->dwAdminStatus == IF_ADMIN_STATUS_UP) { ifp->ifa_ifa.ifa_flags |= IFF_UP | IFF_LOWER_UP; - /* Bug in NT4's IP Helper lib. The dwOperStatus has just - two values, 0 or 1, non operational, operational. */ - if (ifrow->dwOperStatus >= (wincap.has_broken_if_oper_status () - ? 1 : IF_OPER_STATUS_CONNECTED)) + if (ifrow->dwOperStatus >= IF_OPER_STATUS_CONNECTED) ifp->ifa_ifa.ifa_flags |= IFF_RUNNING; } /* Address */ diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index 775957f25..6df304716 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -216,9 +216,8 @@ close_local_policy (LSA_HANDLE &lsa) bool get_logon_server (PWCHAR domain, WCHAR *server, bool rediscovery) { - DWORD dret; + DWORD ret; PDOMAIN_CONTROLLER_INFOW pci; - WCHAR *buf; DWORD size = MAX_COMPUTERNAME_LENGTH + 1; /* Empty domain is interpreted as local system */ @@ -230,31 +229,16 @@ get_logon_server (PWCHAR domain, WCHAR *server, bool rediscovery) } /* Try to get any available domain controller for this domain */ - dret = DsGetDcNameW (NULL, domain, NULL, NULL, - rediscovery ? DS_FORCE_REDISCOVERY : 0, &pci); - if (dret == ERROR_SUCCESS) + ret = DsGetDcNameW (NULL, domain, NULL, NULL, + rediscovery ? DS_FORCE_REDISCOVERY : 0, &pci); + if (ret == ERROR_SUCCESS) { wcscpy (server, pci->DomainControllerName); NetApiBufferFree (pci); debug_printf ("DC: rediscovery: %d, server: %W", rediscovery, server); return true; } - else if (dret == ERROR_PROC_NOT_FOUND) - { - /* NT4 w/o DSClient */ - if (rediscovery) - dret = NetGetAnyDCName (NULL, domain, (LPBYTE *) &buf); - else - dret = NetGetDCName (NULL, domain, (LPBYTE *) &buf); - if (dret == NERR_Success) - { - wcscpy (server, buf); - NetApiBufferFree (buf); - debug_printf ("NT: rediscovery: %d, server: %W", rediscovery, server); - return true; - } - } - __seterrno_from_win_error (dret); + __seterrno_from_win_error (ret); return false; } @@ -972,8 +956,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw) if (status != STATUS_SUCCESS) { debug_printf ("LsaRegisterLogonProcess: %p", status); - __seterrno_from_nt_status (status == ERROR_PROC_NOT_FOUND - ? STATUS_PROCEDURE_NOT_FOUND : status); + __seterrno_from_nt_status (status); goto out; } else if (GetLastError () == ERROR_PROC_NOT_FOUND) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 8cc82a65d..2c6ef1a9c 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -481,9 +481,8 @@ alloc_sd (path_conv &pc, __uid32_t uid, __gid32_t gid, int attribute, } /* We set the SE_DACL_PROTECTED flag here to prevent the DACL from being - * modified by inheritable ACEs. This flag is available since Win2K. */ - if (wincap.has_dacl_protect ()) - sd.Control |= SE_DACL_PROTECTED; + modified by inheritable ACEs. */ + sd.Control |= SE_DACL_PROTECTED; /* Create owner for local security descriptor. */ if (!SetSecurityDescriptorOwner (&sd, owner_sid, FALSE)) diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 87b8d15b1..4389b8e66 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -1,7 +1,7 @@ /* select.cc Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -290,14 +290,11 @@ select_stuff::wait (fd_set *readfds, fd_set *writefds, fd_set *exceptfds, /* Using MWMO_INPUTAVAILABLE is the officially supported solution for the problem that the call to PeekMessage disarms the queue state so that a subsequent MWFMO hangs, even if there are still messages - in the queue. Unfortunately this flag didn't exist prior to Win2K, - so for NT4 we fall back to a different usage of PeekMessage in - peek_windows. See there for more details. */ + in the queue. */ wait_ret = MsgWaitForMultipleObjectsEx (m, w4, ms, QS_ALLINPUT | QS_ALLPOSTMESSAGE, - wincap.has_mwmo_inputavailable () - ? MWMO_INPUTAVAILABLE : 0); + MWMO_INPUTAVAILABLE); switch (wait_ret) { @@ -1542,14 +1539,7 @@ peek_windows (select_record *me, bool) if (me->read_selected && me->read_ready) return 1; - /* On NT4 we use a filter pattern which allows to use QS_ALLPOSTMESSAGE - to keep the queue state as unread. Note that this only works if the - application itself does not call PeekMessage or GetQueueState the wrong - way. But there's no way around it. On Win2K and later we rather use - MsgWaitForMultipleObjectsEx(MWMO_INPUTAVAILABLE). */ - if (PeekMessage (&m, (HWND) h, 0, - wincap.has_mwmo_inputavailable () ? 0 : UINT_MAX - 1, - PM_NOREMOVE)) + if (PeekMessage (&m, (HWND) h, 0, 0, PM_NOREMOVE)) { me->read_ready = true; select_printf ("window %d(%p) ready", me->fd, me->fh->get_handle ()); diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index f0b155ef8..a11142b2d 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -3771,10 +3771,7 @@ long gethostid (void) key.get_string ("ProductId", (char *)&data[6], 24, "00000-000-0000000-00000"); debug_printf ("Windows Product ID: %s", (char *)&data[6]); - /* Contrary to MSDN, NT4 requires the second argument - or a STATUS_ACCESS_VIOLATION is generated */ - ULARGE_INTEGER availb; - GetDiskFreeSpaceEx ("C:\\", &availb, (PULARGE_INTEGER) &data[11], NULL); + GetDiskFreeSpaceEx ("C:\\", NULL, (PULARGE_INTEGER) &data[11], NULL); debug_printf ("hostid entropy: %08x %08x %08x %08x " "%08x %08x %08x %08x " diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index ed15214a6..af1acd520 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -21,66 +21,17 @@ details. */ puzzled that this has never been noticed before... */ /* Minimal set of capabilities required to run Cygwin. */ -#define wincap_minimal wincap_nt4sp4 - -wincaps wincap_nt4sp4 __attribute__((section (".cygwin_dll_common"), shared)) = { - chunksize:0, - heapslop:0x0, - max_sys_priv:SE_CHANGE_NOTIFY_PRIVILEGE, - is_server:false, - has_dacl_protect:false, - has_broken_if_oper_status:true, - has_physical_mem_access:true, - has_process_io_counters:false, - has_terminal_services:false, - has_create_global_privilege:false, - has_ioctl_storage_get_media_types_ex:false, - has_extended_priority_class:false, - has_guid_volumes:false, - has_disk_ex_ioctls:false, - has_fileid_dirinfo:false, - has_buggy_restart_scan:false, - has_mandatory_integrity_control:false, - needs_logon_sid_in_sid_list:true, - needs_count_in_si_lpres2:false, - has_recycle_dot_bin:false, - has_gaa_prefixes:false, - has_gaa_on_link_prefix:false, - supports_all_posix_ai_flags:false, - has_restricted_stack_args:false, - has_transactions:false, - has_recvmsg:false, - has_sendmsg:false, - has_broken_udf:false, - has_console_handle_problem:false, - has_broken_alloc_console:false, - has_always_all_codepages:false, - has_localenames:false, - has_mwmo_inputavailable:false, - has_buggy_thread_startup:false, - has_fast_cwd:false, - has_restricted_raw_disk_access:false, - use_dont_resolve_hack:false, - use_get_sec_info_on_dirs:false, - supports_sse:false, -}; +#define wincap_minimal wincap_2000 wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { chunksize:0, heapslop:0x0, max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:true, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:false, has_ioctl_storage_get_media_types_ex:false, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:false, - has_fileid_dirinfo:true, has_buggy_restart_scan:true, has_mandatory_integrity_control:false, needs_logon_sid_in_sid_list:true, @@ -98,13 +49,11 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:false, has_always_all_codepages:false, has_localenames:false, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:false, has_restricted_raw_disk_access:false, use_dont_resolve_hack:false, use_get_sec_info_on_dirs:false, - supports_sse:true, }; wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -112,17 +61,10 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = heapslop:0x0, max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:true, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:true, has_ioctl_storage_get_media_types_ex:false, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:false, - has_fileid_dirinfo:true, has_buggy_restart_scan:true, has_mandatory_integrity_control:false, needs_logon_sid_in_sid_list:true, @@ -140,13 +82,11 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = has_broken_alloc_console:false, has_always_all_codepages:false, has_localenames:false, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:false, has_restricted_raw_disk_access:false, use_dont_resolve_hack:false, use_get_sec_info_on_dirs:false, - supports_sse:true, }; wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -154,17 +94,10 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { heapslop:0x0, max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:true, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:false, has_ioctl_storage_get_media_types_ex:true, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:true, - has_fileid_dirinfo:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, needs_logon_sid_in_sid_list:false, @@ -182,13 +115,11 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:false, has_always_all_codepages:false, has_localenames:false, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:false, has_restricted_raw_disk_access:false, use_dont_resolve_hack:true, use_get_sec_info_on_dirs:true, - supports_sse:true, }; wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -196,17 +127,10 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { heapslop:0x0, max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:true, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:false, has_ioctl_storage_get_media_types_ex:true, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:true, - has_fileid_dirinfo:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, needs_logon_sid_in_sid_list:false, @@ -224,13 +148,11 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:false, has_always_all_codepages:false, has_localenames:false, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:false, has_restricted_raw_disk_access:false, use_dont_resolve_hack:true, use_get_sec_info_on_dirs:true, - supports_sse:true, }; wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -238,17 +160,10 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { heapslop:0x0, max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:true, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:true, has_ioctl_storage_get_media_types_ex:true, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:true, - has_fileid_dirinfo:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, needs_logon_sid_in_sid_list:false, @@ -266,13 +181,11 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:false, has_always_all_codepages:false, has_localenames:false, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:false, has_restricted_raw_disk_access:false, use_dont_resolve_hack:true, use_get_sec_info_on_dirs:true, - supports_sse:true, }; wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -280,17 +193,10 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { heapslop:0x4, max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, is_server:true, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:false, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:true, has_ioctl_storage_get_media_types_ex:true, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:true, - has_fileid_dirinfo:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, needs_logon_sid_in_sid_list:false, @@ -308,13 +214,11 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:false, has_always_all_codepages:false, has_localenames:false, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:false, has_restricted_raw_disk_access:false, use_dont_resolve_hack:true, use_get_sec_info_on_dirs:true, - supports_sse:true, }; wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -322,17 +226,10 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { heapslop:0x4, max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:false, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:true, has_ioctl_storage_get_media_types_ex:true, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:true, - has_fileid_dirinfo:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:true, needs_logon_sid_in_sid_list:false, @@ -350,13 +247,11 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:false, has_always_all_codepages:true, has_localenames:true, - has_mwmo_inputavailable:true, has_buggy_thread_startup:true, has_fast_cwd:true, has_restricted_raw_disk_access:true, use_dont_resolve_hack:false, use_get_sec_info_on_dirs:false, - supports_sse:true, }; wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -364,17 +259,10 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { heapslop:0x4, max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, is_server:false, - has_dacl_protect:true, - has_broken_if_oper_status:false, has_physical_mem_access:false, - has_process_io_counters:true, - has_terminal_services:true, has_create_global_privilege:true, has_ioctl_storage_get_media_types_ex:true, - has_extended_priority_class:true, - has_guid_volumes:true, has_disk_ex_ioctls:true, - has_fileid_dirinfo:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:true, needs_logon_sid_in_sid_list:false, @@ -392,13 +280,11 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { has_broken_alloc_console:true, has_always_all_codepages:true, has_localenames:true, - has_mwmo_inputavailable:true, has_buggy_thread_startup:false, has_fast_cwd:true, has_restricted_raw_disk_access:true, use_dont_resolve_hack:false, use_get_sec_info_on_dirs:false, - supports_sse:true, }; wincapc wincap __attribute__((section (".cygwin_dll_common"), shared)); @@ -406,21 +292,13 @@ wincapc wincap __attribute__((section (".cygwin_dll_common"), shared)); void wincapc::init () { - bool has_osversioninfoex = true; - if (caps) return; // already initialized memset (&version, 0, sizeof version); - /* Request versionex info first, which is available on all systems since - NT4 SP6 anyway. If that fails, call the simple version. */ version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); if (!GetVersionEx (reinterpret_cast(&version))) - { - has_osversioninfoex = false; - version.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - GetVersionEx (reinterpret_cast(&version)); - } + api_fatal ("Cygwin requires at least Windows 2000."); switch (version.dwPlatformId) { @@ -428,8 +306,9 @@ wincapc::init () switch (version.dwMajorVersion) { case 4: - /* No mercy. We require at least NT4 SP4. */ - caps = &wincap_nt4sp4; + /* I'd be very surprised if this code is ever hit, but it doesn't + hurt to keep it. */ + api_fatal ("Cygwin requires at least Windows 2000."); break; case 5: switch (version.dwMinorVersion) @@ -484,7 +363,7 @@ wincapc::init () break; } - if (has_osversioninfoex && version.wProductType != VER_NT_WORKSTATION) + if (version.wProductType != VER_NT_WORKSTATION) ((wincaps *)caps)->is_server = true; if (NT_SUCCESS (NtQueryInformationProcess (NtCurrentProcess (), ProcessWow64Information, diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index 2144032b1..dc3312784 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -18,17 +18,10 @@ struct wincaps DWORD heapslop; DWORD max_sys_priv; unsigned is_server : 1; - unsigned has_dacl_protect : 1; - unsigned has_broken_if_oper_status : 1; unsigned has_physical_mem_access : 1; - unsigned has_process_io_counters : 1; - unsigned has_terminal_services : 1; unsigned has_create_global_privilege : 1; unsigned has_ioctl_storage_get_media_types_ex : 1; - unsigned has_extended_priority_class : 1; - unsigned has_guid_volumes : 1; unsigned has_disk_ex_ioctls : 1; - unsigned has_fileid_dirinfo : 1; unsigned has_buggy_restart_scan : 1; unsigned has_mandatory_integrity_control : 1; unsigned needs_logon_sid_in_sid_list : 1; @@ -46,13 +39,11 @@ struct wincaps unsigned has_broken_alloc_console : 1; unsigned has_always_all_codepages : 1; unsigned has_localenames : 1; - unsigned has_mwmo_inputavailable : 1; unsigned has_buggy_thread_startup : 1; unsigned has_fast_cwd : 1; unsigned has_restricted_raw_disk_access : 1; unsigned use_dont_resolve_hack : 1; unsigned use_get_sec_info_on_dirs : 1; - unsigned supports_sse : 1; }; class wincapc @@ -76,17 +67,10 @@ public: DWORD IMPLEMENT (heapslop) DWORD IMPLEMENT (max_sys_priv) bool IMPLEMENT (is_server) - bool IMPLEMENT (has_dacl_protect) - bool IMPLEMENT (has_broken_if_oper_status) bool IMPLEMENT (has_physical_mem_access) - bool IMPLEMENT (has_process_io_counters) - bool IMPLEMENT (has_terminal_services) bool IMPLEMENT (has_create_global_privilege) bool IMPLEMENT (has_ioctl_storage_get_media_types_ex) - bool IMPLEMENT (has_extended_priority_class) - bool IMPLEMENT (has_guid_volumes) bool IMPLEMENT (has_disk_ex_ioctls) - bool IMPLEMENT (has_fileid_dirinfo) bool IMPLEMENT (has_buggy_restart_scan) bool IMPLEMENT (has_mandatory_integrity_control) bool IMPLEMENT (needs_logon_sid_in_sid_list) @@ -104,13 +88,11 @@ public: bool IMPLEMENT (has_broken_alloc_console) bool IMPLEMENT (has_always_all_codepages) bool IMPLEMENT (has_localenames) - bool IMPLEMENT (has_mwmo_inputavailable) bool IMPLEMENT (has_buggy_thread_startup) bool IMPLEMENT (has_fast_cwd) bool IMPLEMENT (has_restricted_raw_disk_access) bool IMPLEMENT (use_dont_resolve_hack) bool IMPLEMENT (use_get_sec_info_on_dirs) - bool IMPLEMENT (supports_sse) #undef IMPLEMENT }; diff --git a/winsup/cygwin/winlean.h b/winsup/cygwin/winlean.h index 836bc4d30..c4955aec4 100644 --- a/winsup/cygwin/winlean.h +++ b/winsup/cygwin/winlean.h @@ -1,6 +1,6 @@ /* winlean.h - Standard "lean" windows include - Copyright 2010 Red Hat, Inc. + Copyright 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -27,4 +27,11 @@ details. */ #undef _WINVER_H #undef _WINNETWK_H #undef _WINSVC_H +/* When Terminal Services are installed, the GetWindowsDirectory function + does not return the system installation dir, but a user specific directory + instead. That's not what we have in mind when calling GetWindowsDirectory + from within Cygwin. So we redefine GetWindowsDirectory to call the + GetSystemWindowsDirectory function here. */ +#define GetWindowsDirectoryW GetSystemWindowsDirectoryW +#define GetWindowsDirectoryA GetSystemWindowsDirectoryA #endif /*_WINLEAN_H*/