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.
This commit is contained in:
Corinna Vinschen 2011-04-04 12:23:36 +00:00
parent 02dbd9ae87
commit 6ce541281e
18 changed files with 98 additions and 288 deletions

View File

@ -1,3 +1,52 @@
2011-04-04 Corinna Vinschen <corinna@vinschen.de>
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 <corinna@vinschen.de> 2011-04-04 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::init_std_file_from_handle): Fix a comment to * dtable.cc (dtable::init_std_file_from_handle): Fix a comment to

View File

@ -383,8 +383,8 @@ LoadDLLfunc (RegisterEventSourceW, 8, advapi32)
LoadDLLfunc (ReportEventW, 36, advapi32) LoadDLLfunc (ReportEventW, 36, advapi32)
#endif #endif
LoadDLLfuncEx2 (DnsQuery_A, 24, dnsapi, 1, 127) // ERROR_PROC_NOT_FOUND LoadDLLfunc (DnsQuery_A, 24, dnsapi)
LoadDLLfuncEx (DnsRecordListFree, 8, dnsapi, 1) LoadDLLfunc (DnsRecordListFree, 8, dnsapi)
// 50 = ERROR_NOT_SUPPORTED. Returned if OS doesn't support iphlpapi funcs // 50 = ERROR_NOT_SUPPORTED. Returned if OS doesn't support iphlpapi funcs
LoadDLLfuncEx2 (GetAdaptersAddresses, 20, iphlpapi, 1, 50) LoadDLLfuncEx2 (GetAdaptersAddresses, 20, iphlpapi, 1, 50)
@ -407,10 +407,8 @@ LoadDLLfunc (WNetGetResourceInformationA, 16, mpr)
LoadDLLfunc (WNetOpenEnumA, 20, mpr) LoadDLLfunc (WNetOpenEnumA, 20, mpr)
/* 127 == ERROR_PROC_NOT_FOUND */ /* 127 == ERROR_PROC_NOT_FOUND */
LoadDLLfuncEx2 (DsGetDcNameW, 24, netapi32, 1, 127) LoadDLLfunc (DsGetDcNameW, 24, netapi32)
LoadDLLfunc (NetApiBufferFree, 4, netapi32) LoadDLLfunc (NetApiBufferFree, 4, netapi32)
LoadDLLfunc (NetGetAnyDCName, 12, netapi32)
LoadDLLfunc (NetGetDCName, 12, netapi32)
LoadDLLfunc (NetUserGetGroups, 28, netapi32) LoadDLLfunc (NetUserGetGroups, 28, netapi32)
LoadDLLfunc (NetUserGetInfo, 16, netapi32) LoadDLLfunc (NetUserGetInfo, 16, netapi32)
LoadDLLfunc (NetUserGetLocalGroups, 32, netapi32) LoadDLLfunc (NetUserGetLocalGroups, 32, netapi32)
@ -423,22 +421,17 @@ LoadDLLfunc (RtlSetCurrentTransaction, 4, ntdll)
LoadDLLfunc (CoTaskMemFree, 4, ole32) LoadDLLfunc (CoTaskMemFree, 4, ole32)
LoadDLLfuncEx (EnumProcessModules, 16, psapi, 1) LoadDLLfunc (EnumProcessModules, 16, psapi)
LoadDLLfuncEx (GetModuleFileNameExW, 16, psapi, 1) LoadDLLfunc (GetModuleFileNameExW, 16, psapi)
LoadDLLfuncEx (GetModuleInformation, 16, psapi, 1) LoadDLLfunc (GetModuleInformation, 16, psapi)
LoadDLLfuncEx (GetProcessMemoryInfo, 12, psapi, 1) LoadDLLfunc (GetProcessMemoryInfo, 12, psapi)
LoadDLLfuncEx (QueryWorkingSet, 12, psapi, 1) LoadDLLfunc (QueryWorkingSet, 12, psapi)
LoadDLLfunc (LsaDeregisterLogonProcess, 4, secur32) LoadDLLfunc (LsaDeregisterLogonProcess, 4, secur32)
LoadDLLfunc (LsaFreeReturnBuffer, 4, secur32) LoadDLLfunc (LsaFreeReturnBuffer, 4, secur32)
LoadDLLfunc (LsaLogonUser, 56, secur32) LoadDLLfunc (LsaLogonUser, 56, secur32)
LoadDLLfunc (LsaLookupAuthenticationPackage, 12, secur32) LoadDLLfunc (LsaLookupAuthenticationPackage, 12, secur32)
/* secur32 functions return NTSTATUS values. However, the error code must LoadDLLfunc (LsaRegisterLogonProcess, 12, secur32)
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 (SHGetDesktopFolder, 4, shell32) LoadDLLfunc (SHGetDesktopFolder, 4, shell32)

View File

@ -423,7 +423,7 @@ _feinitialise (void)
__asm__ volatile ("cpuid" : "=d" (edx), "+a" (eax) :: "%ecx", "%ebx"); __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 /* 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. */ 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; use_sse = true;
/* Reset FPU: extended prec, all exceptions cleared and masked off. */ /* Reset FPU: extended prec, all exceptions cleared and masked off. */

View File

@ -140,8 +140,7 @@ inline bool
path_conv::isgood_inode (__ino64_t ino) const path_conv::isgood_inode (__ino64_t ino) const
{ {
/* We can't trust remote inode numbers of only 32 bit. That means, /* 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 remote NT4 NTFS, as well as shares of Samba version < 3.0.
NTFS, as well as shares of Samba version < 3.0.
The known exception are SFU NFS shares, which return the valid 32 bit The known exception are SFU NFS shares, which return the valid 32 bit
inode number from the remote file system unchanged. */ inode number from the remote file system unchanged. */
return hasgood_inode () && (ino > UINT32_MAX || !isremote () || fs_is_nfs ()); 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]; WCHAR buf[NAME_MAX + 1];
} fdi_buf; } fdi_buf;
if (!ino && pc.hasgood_inode () if (!ino && pc.hasgood_inode () && !pc.has_buggy_fileid_dirinfo ())
&& wincap.has_fileid_dirinfo () && !pc.has_buggy_fileid_dirinfo ())
{ {
RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, &basename); RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, &basename);
InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (), InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (),
@ -1679,8 +1677,7 @@ fhandler_disk_file::opendir (int fd)
dir->__flags |= dirent_set_d_ino; dir->__flags |= dirent_set_d_ino;
if (pc.fs_is_nfs ()) if (pc.fs_is_nfs ())
dir->__flags |= dirent_nfs_d_ino; dir->__flags |= dirent_nfs_d_ino;
else if (wincap.has_fileid_dirinfo () else if (!pc.has_buggy_fileid_dirinfo ())
&& !pc.has_buggy_fileid_dirinfo ())
dir->__flags |= dirent_get_d_ino; dir->__flags |= dirent_get_d_ino;
} }
} }

View File

@ -1,6 +1,6 @@
/* fhandler_netdrive.cc: fhandler for // and //MACHINE handling /* 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. 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); de->d_ino = readdir_get_ino (nro->lpRemoteName, false);
/* We can't trust remote inode numbers of only 32 bit. That means, /* 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. */
if (de->d_ino <= UINT_MAX) if (de->d_ino <= UINT_MAX)
de->d_ino = hash_path_name (0, nro->lpRemoteName); de->d_ino = hash_path_name (0, nro->lpRemoteName);

View File

@ -1193,17 +1193,6 @@ format_proc_partitions (void *, char *&destbuf)
pi = (PARTITION_INFORMATION *) ioctl_buf; pi = (PARTITION_INFORMATION *) ioctl_buf;
size = pi->PartitionLength.QuadPart; 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 else
{ {
debug_printf ("DeviceIoControl (%S, " debug_printf ("DeviceIoControl (%S, "

View File

@ -1,6 +1,7 @@
/* fhandler_process.cc: fhandler for /proc/<pid> virtual filesystem /* fhandler_process.cc: fhandler for /proc/<pid> 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. This file is part of Cygwin.
@ -958,19 +959,7 @@ get_process_state (DWORD dwProcessId)
if (sp->ProcessId == dwProcessId) if (sp->ProcessId == dwProcessId)
{ {
SYSTEM_THREADS *st; 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]; 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);
state = 'S'; state = 'S';
for (unsigned i = 0; i < sp->ThreadCount; i++) for (unsigned i = 0; i < sp->ThreadCount; i++)
{ {

View File

@ -1,6 +1,6 @@
/* kernel32.cc: Win32 replacement functions. /* kernel32.cc: Win32 replacement functions.
Copyright 2008, 2010 Red Hat, Inc. Copyright 2008, 2010, 2011 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -403,37 +403,3 @@ OpenFileMappingA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
} }
return OpenFileMappingW (dwDesiredAccess, bInheritHandle, lpName ? name : NULL); 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;
}

View File

@ -1,7 +1,7 @@
/* miscfuncs.cc: misc funcs that don't belong anywhere else /* miscfuncs.cc: misc funcs that don't belong anywhere else
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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. This file is part of Cygwin.
@ -312,10 +312,6 @@ nice_to_winprio (int &nice)
else if (nice > NZERO - 1) else if (nice > NZERO - 1)
nice = NZERO - 1; nice = NZERO - 1;
DWORD prio = priority[nice + NZERO]; 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; return prio;
} }

View File

@ -1,7 +1,7 @@
/* mount.cc: mount handling. /* mount.cc: mount handling.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 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. 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 WIN_FAT_FLAGS (FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK)
#define FS_IS_WINDOWS_FAT TEST_GVI(flags (), WIN_FAT_FLAGS) #define FS_IS_WINDOWS_FAT TEST_GVI(flags (), WIN_FAT_FLAGS)
/* This always fails on NT4. */
if ((flags () & FILE_SUPPORTS_OBJECT_IDS) if ((flags () & FILE_SUPPORTS_OBJECT_IDS)
&& NT_SUCCESS (NtQueryVolumeInformationFile (vol, &io, &ffoi, && NT_SUCCESS (NtQueryVolumeInformationFile (vol, &io, &ffoi,
sizeof 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. */ /* First check the remote filesystems claiming to be NTFS. */
if (!got_fs () if (!got_fs ()
&& is_ntfs (RtlEqualUnicodeString (&fsname, &ro_u_ntfs, FALSE)) && is_ntfs (RtlEqualUnicodeString (&fsname, &ro_u_ntfs, FALSE))
/* Test for Samba on NT4 or for older Samba releases not supporting /* Test for older Samba releases not supporting extended info. */
extended info. */
&& !is_samba (FS_IS_SAMBA) && !is_samba (FS_IS_SAMBA)
/* Netapp inode info is unusable, can't handle trailing dots and /* Netapp inode info is unusable, can't handle trailing dots and
spaces, has a bug in "move and delete" semantics. */ spaces, has a bug in "move and delete" semantics. */

View File

@ -2194,10 +2194,7 @@ get_2k_ifs ()
if (ifrow->dwAdminStatus == IF_ADMIN_STATUS_UP) if (ifrow->dwAdminStatus == IF_ADMIN_STATUS_UP)
{ {
ifp->ifa_ifa.ifa_flags |= IFF_UP | IFF_LOWER_UP; ifp->ifa_ifa.ifa_flags |= IFF_UP | IFF_LOWER_UP;
/* Bug in NT4's IP Helper lib. The dwOperStatus has just if (ifrow->dwOperStatus >= IF_OPER_STATUS_CONNECTED)
two values, 0 or 1, non operational, operational. */
if (ifrow->dwOperStatus >= (wincap.has_broken_if_oper_status ()
? 1 : IF_OPER_STATUS_CONNECTED))
ifp->ifa_ifa.ifa_flags |= IFF_RUNNING; ifp->ifa_ifa.ifa_flags |= IFF_RUNNING;
} }
/* Address */ /* Address */

View File

@ -216,9 +216,8 @@ close_local_policy (LSA_HANDLE &lsa)
bool bool
get_logon_server (PWCHAR domain, WCHAR *server, bool rediscovery) get_logon_server (PWCHAR domain, WCHAR *server, bool rediscovery)
{ {
DWORD dret; DWORD ret;
PDOMAIN_CONTROLLER_INFOW pci; PDOMAIN_CONTROLLER_INFOW pci;
WCHAR *buf;
DWORD size = MAX_COMPUTERNAME_LENGTH + 1; DWORD size = MAX_COMPUTERNAME_LENGTH + 1;
/* Empty domain is interpreted as local system */ /* 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 */ /* Try to get any available domain controller for this domain */
dret = DsGetDcNameW (NULL, domain, NULL, NULL, ret = DsGetDcNameW (NULL, domain, NULL, NULL,
rediscovery ? DS_FORCE_REDISCOVERY : 0, &pci); rediscovery ? DS_FORCE_REDISCOVERY : 0, &pci);
if (dret == ERROR_SUCCESS) if (ret == ERROR_SUCCESS)
{ {
wcscpy (server, pci->DomainControllerName); wcscpy (server, pci->DomainControllerName);
NetApiBufferFree (pci); NetApiBufferFree (pci);
debug_printf ("DC: rediscovery: %d, server: %W", rediscovery, server); debug_printf ("DC: rediscovery: %d, server: %W", rediscovery, server);
return true; return true;
} }
else if (dret == ERROR_PROC_NOT_FOUND) __seterrno_from_win_error (ret);
{
/* 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);
return false; return false;
} }
@ -972,8 +956,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
if (status != STATUS_SUCCESS) if (status != STATUS_SUCCESS)
{ {
debug_printf ("LsaRegisterLogonProcess: %p", status); debug_printf ("LsaRegisterLogonProcess: %p", status);
__seterrno_from_nt_status (status == ERROR_PROC_NOT_FOUND __seterrno_from_nt_status (status);
? STATUS_PROCEDURE_NOT_FOUND : status);
goto out; goto out;
} }
else if (GetLastError () == ERROR_PROC_NOT_FOUND) else if (GetLastError () == ERROR_PROC_NOT_FOUND)

View File

@ -481,8 +481,7 @@ 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 /* We set the SE_DACL_PROTECTED flag here to prevent the DACL from being
* modified by inheritable ACEs. This flag is available since Win2K. */ modified by inheritable ACEs. */
if (wincap.has_dacl_protect ())
sd.Control |= SE_DACL_PROTECTED; sd.Control |= SE_DACL_PROTECTED;
/* Create owner for local security descriptor. */ /* Create owner for local security descriptor. */

View File

@ -1,7 +1,7 @@
/* select.cc /* select.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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. 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 /* Using MWMO_INPUTAVAILABLE is the officially supported solution for
the problem that the call to PeekMessage disarms the queue state the problem that the call to PeekMessage disarms the queue state
so that a subsequent MWFMO hangs, even if there are still messages so that a subsequent MWFMO hangs, even if there are still messages
in the queue. Unfortunately this flag didn't exist prior to Win2K, in the queue. */
so for NT4 we fall back to a different usage of PeekMessage in
peek_windows. See there for more details. */
wait_ret = wait_ret =
MsgWaitForMultipleObjectsEx (m, w4, ms, MsgWaitForMultipleObjectsEx (m, w4, ms,
QS_ALLINPUT | QS_ALLPOSTMESSAGE, QS_ALLINPUT | QS_ALLPOSTMESSAGE,
wincap.has_mwmo_inputavailable () MWMO_INPUTAVAILABLE);
? MWMO_INPUTAVAILABLE : 0);
switch (wait_ret) switch (wait_ret)
{ {
@ -1542,14 +1539,7 @@ peek_windows (select_record *me, bool)
if (me->read_selected && me->read_ready) if (me->read_selected && me->read_ready)
return 1; return 1;
/* On NT4 we use a filter pattern which allows to use QS_ALLPOSTMESSAGE if (PeekMessage (&m, (HWND) h, 0, 0, PM_NOREMOVE))
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))
{ {
me->read_ready = true; me->read_ready = true;
select_printf ("window %d(%p) ready", me->fd, me->fh->get_handle ()); select_printf ("window %d(%p) ready", me->fd, me->fh->get_handle ());

View File

@ -3771,10 +3771,7 @@ long gethostid (void)
key.get_string ("ProductId", (char *)&data[6], 24, "00000-000-0000000-00000"); key.get_string ("ProductId", (char *)&data[6], 24, "00000-000-0000000-00000");
debug_printf ("Windows Product ID: %s", (char *)&data[6]); debug_printf ("Windows Product ID: %s", (char *)&data[6]);
/* Contrary to MSDN, NT4 requires the second argument GetDiskFreeSpaceEx ("C:\\", NULL, (PULARGE_INTEGER) &data[11], NULL);
or a STATUS_ACCESS_VIOLATION is generated */
ULARGE_INTEGER availb;
GetDiskFreeSpaceEx ("C:\\", &availb, (PULARGE_INTEGER) &data[11], NULL);
debug_printf ("hostid entropy: %08x %08x %08x %08x " debug_printf ("hostid entropy: %08x %08x %08x %08x "
"%08x %08x %08x %08x " "%08x %08x %08x %08x "

View File

@ -21,66 +21,17 @@ details. */
puzzled that this has never been noticed before... */ puzzled that this has never been noticed before... */
/* Minimal set of capabilities required to run Cygwin. */ /* Minimal set of capabilities required to run Cygwin. */
#define wincap_minimal wincap_nt4sp4 #define wincap_minimal wincap_2000
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,
};
wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = {
chunksize:0, chunksize:0,
heapslop:0x0, heapslop:0x0,
max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:true, has_physical_mem_access:true,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:false, has_create_global_privilege:false,
has_ioctl_storage_get_media_types_ex:false, has_ioctl_storage_get_media_types_ex:false,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:false, has_disk_ex_ioctls:false,
has_fileid_dirinfo:true,
has_buggy_restart_scan:true, has_buggy_restart_scan:true,
has_mandatory_integrity_control:false, has_mandatory_integrity_control:false,
needs_logon_sid_in_sid_list:true, 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_broken_alloc_console:false,
has_always_all_codepages:false, has_always_all_codepages:false,
has_localenames:false, has_localenames:false,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:false, has_fast_cwd:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
use_get_sec_info_on_dirs:false, use_get_sec_info_on_dirs:false,
supports_sse:true,
}; };
wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -112,17 +61,10 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) =
heapslop:0x0, heapslop:0x0,
max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:true, has_physical_mem_access:true,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:true, has_create_global_privilege:true,
has_ioctl_storage_get_media_types_ex:false, has_ioctl_storage_get_media_types_ex:false,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:false, has_disk_ex_ioctls:false,
has_fileid_dirinfo:true,
has_buggy_restart_scan:true, has_buggy_restart_scan:true,
has_mandatory_integrity_control:false, has_mandatory_integrity_control:false,
needs_logon_sid_in_sid_list:true, 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_broken_alloc_console:false,
has_always_all_codepages:false, has_always_all_codepages:false,
has_localenames:false, has_localenames:false,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:false, has_fast_cwd:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
use_get_sec_info_on_dirs:false, use_get_sec_info_on_dirs:false,
supports_sse:true,
}; };
wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -154,17 +94,10 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
heapslop:0x0, heapslop:0x0,
max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:true, has_physical_mem_access:true,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:false, has_create_global_privilege:false,
has_ioctl_storage_get_media_types_ex:true, has_ioctl_storage_get_media_types_ex:true,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:true, has_disk_ex_ioctls:true,
has_fileid_dirinfo:true,
has_buggy_restart_scan:false, has_buggy_restart_scan:false,
has_mandatory_integrity_control:false, has_mandatory_integrity_control:false,
needs_logon_sid_in_sid_list: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_broken_alloc_console:false,
has_always_all_codepages:false, has_always_all_codepages:false,
has_localenames:false, has_localenames:false,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:false, has_fast_cwd:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true, use_dont_resolve_hack:true,
use_get_sec_info_on_dirs:true, use_get_sec_info_on_dirs:true,
supports_sse:true,
}; };
wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -196,17 +127,10 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
heapslop:0x0, heapslop:0x0,
max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:true, has_physical_mem_access:true,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:false, has_create_global_privilege:false,
has_ioctl_storage_get_media_types_ex:true, has_ioctl_storage_get_media_types_ex:true,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:true, has_disk_ex_ioctls:true,
has_fileid_dirinfo:true,
has_buggy_restart_scan:false, has_buggy_restart_scan:false,
has_mandatory_integrity_control:false, has_mandatory_integrity_control:false,
needs_logon_sid_in_sid_list: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_broken_alloc_console:false,
has_always_all_codepages:false, has_always_all_codepages:false,
has_localenames:false, has_localenames:false,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:false, has_fast_cwd:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true, use_dont_resolve_hack:true,
use_get_sec_info_on_dirs:true, use_get_sec_info_on_dirs:true,
supports_sse:true,
}; };
wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -238,17 +160,10 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
heapslop:0x0, heapslop:0x0,
max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:true, has_physical_mem_access:true,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:true, has_create_global_privilege:true,
has_ioctl_storage_get_media_types_ex:true, has_ioctl_storage_get_media_types_ex:true,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:true, has_disk_ex_ioctls:true,
has_fileid_dirinfo:true,
has_buggy_restart_scan:false, has_buggy_restart_scan:false,
has_mandatory_integrity_control:false, has_mandatory_integrity_control:false,
needs_logon_sid_in_sid_list: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_broken_alloc_console:false,
has_always_all_codepages:false, has_always_all_codepages:false,
has_localenames:false, has_localenames:false,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:false, has_fast_cwd:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true, use_dont_resolve_hack:true,
use_get_sec_info_on_dirs:true, use_get_sec_info_on_dirs:true,
supports_sse:true,
}; };
wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -280,17 +193,10 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
heapslop:0x4, heapslop:0x4,
max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
is_server:true, is_server:true,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:false, has_physical_mem_access:false,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:true, has_create_global_privilege:true,
has_ioctl_storage_get_media_types_ex:true, has_ioctl_storage_get_media_types_ex:true,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:true, has_disk_ex_ioctls:true,
has_fileid_dirinfo:true,
has_buggy_restart_scan:false, has_buggy_restart_scan:false,
has_mandatory_integrity_control:false, has_mandatory_integrity_control:false,
needs_logon_sid_in_sid_list: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_broken_alloc_console:false,
has_always_all_codepages:false, has_always_all_codepages:false,
has_localenames:false, has_localenames:false,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:false, has_fast_cwd:false,
has_restricted_raw_disk_access:false, has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true, use_dont_resolve_hack:true,
use_get_sec_info_on_dirs:true, use_get_sec_info_on_dirs:true,
supports_sse:true,
}; };
wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -322,17 +226,10 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
heapslop:0x4, heapslop:0x4,
max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:false, has_physical_mem_access:false,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:true, has_create_global_privilege:true,
has_ioctl_storage_get_media_types_ex:true, has_ioctl_storage_get_media_types_ex:true,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:true, has_disk_ex_ioctls:true,
has_fileid_dirinfo:true,
has_buggy_restart_scan:false, has_buggy_restart_scan:false,
has_mandatory_integrity_control:true, has_mandatory_integrity_control:true,
needs_logon_sid_in_sid_list:false, 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_broken_alloc_console:false,
has_always_all_codepages:true, has_always_all_codepages:true,
has_localenames:true, has_localenames:true,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:true, has_buggy_thread_startup:true,
has_fast_cwd:true, has_fast_cwd:true,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
use_get_sec_info_on_dirs:false, use_get_sec_info_on_dirs:false,
supports_sse:true,
}; };
wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
@ -364,17 +259,10 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
heapslop:0x4, heapslop:0x4,
max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE,
is_server:false, is_server:false,
has_dacl_protect:true,
has_broken_if_oper_status:false,
has_physical_mem_access:false, has_physical_mem_access:false,
has_process_io_counters:true,
has_terminal_services:true,
has_create_global_privilege:true, has_create_global_privilege:true,
has_ioctl_storage_get_media_types_ex:true, has_ioctl_storage_get_media_types_ex:true,
has_extended_priority_class:true,
has_guid_volumes:true,
has_disk_ex_ioctls:true, has_disk_ex_ioctls:true,
has_fileid_dirinfo:true,
has_buggy_restart_scan:false, has_buggy_restart_scan:false,
has_mandatory_integrity_control:true, has_mandatory_integrity_control:true,
needs_logon_sid_in_sid_list:false, 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_broken_alloc_console:true,
has_always_all_codepages:true, has_always_all_codepages:true,
has_localenames:true, has_localenames:true,
has_mwmo_inputavailable:true,
has_buggy_thread_startup:false, has_buggy_thread_startup:false,
has_fast_cwd:true, has_fast_cwd:true,
has_restricted_raw_disk_access:true, has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false, use_dont_resolve_hack:false,
use_get_sec_info_on_dirs:false, use_get_sec_info_on_dirs:false,
supports_sse:true,
}; };
wincapc wincap __attribute__((section (".cygwin_dll_common"), shared)); wincapc wincap __attribute__((section (".cygwin_dll_common"), shared));
@ -406,21 +292,13 @@ wincapc wincap __attribute__((section (".cygwin_dll_common"), shared));
void void
wincapc::init () wincapc::init ()
{ {
bool has_osversioninfoex = true;
if (caps) if (caps)
return; // already initialized return; // already initialized
memset (&version, 0, sizeof version); 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); version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version))) if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)))
{ api_fatal ("Cygwin requires at least Windows 2000.");
has_osversioninfoex = false;
version.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version));
}
switch (version.dwPlatformId) switch (version.dwPlatformId)
{ {
@ -428,8 +306,9 @@ wincapc::init ()
switch (version.dwMajorVersion) switch (version.dwMajorVersion)
{ {
case 4: case 4:
/* No mercy. We require at least NT4 SP4. */ /* I'd be very surprised if this code is ever hit, but it doesn't
caps = &wincap_nt4sp4; hurt to keep it. */
api_fatal ("Cygwin requires at least Windows 2000.");
break; break;
case 5: case 5:
switch (version.dwMinorVersion) switch (version.dwMinorVersion)
@ -484,7 +363,7 @@ wincapc::init ()
break; break;
} }
if (has_osversioninfoex && version.wProductType != VER_NT_WORKSTATION) if (version.wProductType != VER_NT_WORKSTATION)
((wincaps *)caps)->is_server = true; ((wincaps *)caps)->is_server = true;
if (NT_SUCCESS (NtQueryInformationProcess (NtCurrentProcess (), if (NT_SUCCESS (NtQueryInformationProcess (NtCurrentProcess (),
ProcessWow64Information, ProcessWow64Information,

View File

@ -18,17 +18,10 @@ struct wincaps
DWORD heapslop; DWORD heapslop;
DWORD max_sys_priv; DWORD max_sys_priv;
unsigned is_server : 1; unsigned is_server : 1;
unsigned has_dacl_protect : 1;
unsigned has_broken_if_oper_status : 1;
unsigned has_physical_mem_access : 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_create_global_privilege : 1;
unsigned has_ioctl_storage_get_media_types_ex : 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_disk_ex_ioctls : 1;
unsigned has_fileid_dirinfo : 1;
unsigned has_buggy_restart_scan : 1; unsigned has_buggy_restart_scan : 1;
unsigned has_mandatory_integrity_control : 1; unsigned has_mandatory_integrity_control : 1;
unsigned needs_logon_sid_in_sid_list : 1; unsigned needs_logon_sid_in_sid_list : 1;
@ -46,13 +39,11 @@ struct wincaps
unsigned has_broken_alloc_console : 1; unsigned has_broken_alloc_console : 1;
unsigned has_always_all_codepages : 1; unsigned has_always_all_codepages : 1;
unsigned has_localenames : 1; unsigned has_localenames : 1;
unsigned has_mwmo_inputavailable : 1;
unsigned has_buggy_thread_startup : 1; unsigned has_buggy_thread_startup : 1;
unsigned has_fast_cwd : 1; unsigned has_fast_cwd : 1;
unsigned has_restricted_raw_disk_access : 1; unsigned has_restricted_raw_disk_access : 1;
unsigned use_dont_resolve_hack : 1; unsigned use_dont_resolve_hack : 1;
unsigned use_get_sec_info_on_dirs : 1; unsigned use_get_sec_info_on_dirs : 1;
unsigned supports_sse : 1;
}; };
class wincapc class wincapc
@ -76,17 +67,10 @@ public:
DWORD IMPLEMENT (heapslop) DWORD IMPLEMENT (heapslop)
DWORD IMPLEMENT (max_sys_priv) DWORD IMPLEMENT (max_sys_priv)
bool IMPLEMENT (is_server) 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_physical_mem_access)
bool IMPLEMENT (has_process_io_counters)
bool IMPLEMENT (has_terminal_services)
bool IMPLEMENT (has_create_global_privilege) bool IMPLEMENT (has_create_global_privilege)
bool IMPLEMENT (has_ioctl_storage_get_media_types_ex) 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_disk_ex_ioctls)
bool IMPLEMENT (has_fileid_dirinfo)
bool IMPLEMENT (has_buggy_restart_scan) bool IMPLEMENT (has_buggy_restart_scan)
bool IMPLEMENT (has_mandatory_integrity_control) bool IMPLEMENT (has_mandatory_integrity_control)
bool IMPLEMENT (needs_logon_sid_in_sid_list) bool IMPLEMENT (needs_logon_sid_in_sid_list)
@ -104,13 +88,11 @@ public:
bool IMPLEMENT (has_broken_alloc_console) bool IMPLEMENT (has_broken_alloc_console)
bool IMPLEMENT (has_always_all_codepages) bool IMPLEMENT (has_always_all_codepages)
bool IMPLEMENT (has_localenames) bool IMPLEMENT (has_localenames)
bool IMPLEMENT (has_mwmo_inputavailable)
bool IMPLEMENT (has_buggy_thread_startup) bool IMPLEMENT (has_buggy_thread_startup)
bool IMPLEMENT (has_fast_cwd) bool IMPLEMENT (has_fast_cwd)
bool IMPLEMENT (has_restricted_raw_disk_access) bool IMPLEMENT (has_restricted_raw_disk_access)
bool IMPLEMENT (use_dont_resolve_hack) bool IMPLEMENT (use_dont_resolve_hack)
bool IMPLEMENT (use_get_sec_info_on_dirs) bool IMPLEMENT (use_get_sec_info_on_dirs)
bool IMPLEMENT (supports_sse)
#undef IMPLEMENT #undef IMPLEMENT
}; };

View File

@ -1,6 +1,6 @@
/* winlean.h - Standard "lean" windows include /* winlean.h - Standard "lean" windows include
Copyright 2010 Red Hat, Inc. Copyright 2010, 2011 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -27,4 +27,11 @@ details. */
#undef _WINVER_H #undef _WINVER_H
#undef _WINNETWK_H #undef _WINNETWK_H
#undef _WINSVC_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*/ #endif /*_WINLEAN_H*/