mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Drop support for Windows 8
Microsoft caused some very gentle breakages for Cosmopolitan. They removed the version information from the PEB which caused uname to report WINDOWS 0.0.0. We should have called GetVersionExW but that doesn't really exist anymore either. Windows policy is now to give whatever version we used in ape/ape.S. Windows8 has been EOL since 2023-01-10 so lets avoid our modern executables being relegated to legacy infrastructure. Requiring Windows 10+ going forward lets us remove runtime compatibility bloat from the codebase. Further note Cosmopolitan maintains a Windows Vista branch on GitHub, so anyone preferring the older versions, can still have a future with Cosmo. Another neat thing this fixes is UTF-8 support in the console. The changes Microsoft made broke the if statement that enabled UTF8 in terminals. This explains why bug reports had broken arrows. In the future this should be less of an issue, since the PEB code is gone which means we more strictly conform to only Microsoft's WIN32 API
This commit is contained in:
parent
f31a98d50a
commit
e4d25d68e4
26 changed files with 17 additions and 942 deletions
|
@ -1,20 +0,0 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_OSVERSIONINFO_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_OSVERSIONINFO_H_
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct NtOsVersionInfo {
|
||||
uint32_t dwOSVersionInfoSize;
|
||||
uint32_t dwMajorVersion;
|
||||
uint32_t dwMinorVersion;
|
||||
uint32_t dwBuildNumber;
|
||||
uint32_t dwPlatformId;
|
||||
char16_t szCSDVersion[128];
|
||||
uint16_t wServicePackMajor;
|
||||
uint16_t wServicePackMinor;
|
||||
uint16_t wSuiteMask;
|
||||
uint8_t wProductType;
|
||||
uint8_t wReserved;
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_OSVERSIONINFO_H_ */
|
|
@ -1,94 +0,0 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_PEB_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_STRUCT_PEB_H_
|
||||
#include "libc/nt/struct/ldr.h"
|
||||
#include "libc/nt/struct/unicodestring.h"
|
||||
|
||||
struct NtPeb {
|
||||
union {
|
||||
struct {
|
||||
unsigned char InheritedAddressSpace;
|
||||
unsigned char ReadImageFileExecOptions;
|
||||
unsigned char BeingDebugged;
|
||||
unsigned char __wut1;
|
||||
};
|
||||
uint64_t __wut2;
|
||||
};
|
||||
uint64_t Mutant;
|
||||
uint64_t ImageBaseAddress;
|
||||
struct NtLdr *Ldr;
|
||||
uint64_t ProcessParameters;
|
||||
uint64_t SubSystemData;
|
||||
uint64_t ProcessHeap;
|
||||
uint64_t FastPebLock;
|
||||
uint64_t __wut3;
|
||||
uint64_t __wut4;
|
||||
uint64_t __wut5;
|
||||
union {
|
||||
uint64_t KernelCallbackTable;
|
||||
uint64_t UserSharedInfoPtr;
|
||||
};
|
||||
uint32_t SystemReserved;
|
||||
uint32_t __wut6;
|
||||
uint64_t __wut7;
|
||||
uint64_t TlsExpansionCounter;
|
||||
uint64_t TlsBitmap;
|
||||
uint32_t TlsBitmapBits[2];
|
||||
uint64_t ReadOnlySharedMemoryBase;
|
||||
uint64_t __wut8;
|
||||
uint64_t ReadOnlyStaticServerData;
|
||||
uint64_t AnsiCodePageData;
|
||||
uint64_t OemCodePageData;
|
||||
uint64_t UnicodeCaseTableData;
|
||||
uint32_t NumberOfProcessors;
|
||||
#ifdef __x86_64__
|
||||
uint32_t NtGlobalFlag;
|
||||
#else
|
||||
uint64_t NtGlobalFlag;
|
||||
#endif
|
||||
int64_t CriticalSectionTimeout;
|
||||
uint64_t HeapSegmentReserve;
|
||||
uint64_t HeapSegmentCommit;
|
||||
uint64_t HeapDeCommitTotalFreeThreshold;
|
||||
uint64_t HeapDeCommitFreeBlockThreshold;
|
||||
uint32_t NumberOfHeaps;
|
||||
uint32_t MaximumNumberOfHeaps;
|
||||
uint64_t ProcessHeaps;
|
||||
uint64_t GdiSharedHandleTable;
|
||||
uint64_t ProcessStarterHelper;
|
||||
uint64_t GdiDCAttributeList;
|
||||
uint64_t LoaderLock;
|
||||
union {
|
||||
struct {
|
||||
uint32_t OSMajorVersion;
|
||||
uint32_t OSMinorVersion;
|
||||
};
|
||||
uint64_t OSVersion;
|
||||
};
|
||||
uint16_t OSBuildNumber;
|
||||
uint16_t OSCSDVersion;
|
||||
uint32_t OSPlatformId;
|
||||
uint32_t ImageSubsystem;
|
||||
uint32_t ImageSubsystemMajorVersion;
|
||||
uint64_t ImageSubsystemMinorVersion;
|
||||
union {
|
||||
uint64_t ImageProcessAffinityMask;
|
||||
uint64_t ActiveProcessAffinityMask;
|
||||
};
|
||||
uint64_t GdiHandleBuffer[38 - __SIZEOF_POINTER__];
|
||||
uint64_t PostProcessInitRoutine;
|
||||
uint64_t TlsExpansionBitmap;
|
||||
uint32_t TlsExpansionBitmapBits[32];
|
||||
uint64_t SessionId;
|
||||
uint64_t AppCompatFlags;
|
||||
uint64_t AppCompatFlagsUser;
|
||||
uint64_t pShimData;
|
||||
uint64_t AppCompatInfo;
|
||||
struct NtUnicodeString CSDVersion;
|
||||
uint64_t ActivationContextData;
|
||||
uint64_t ProcessAssemblyStorageMap;
|
||||
uint64_t SystemDefaultActivationContextData;
|
||||
uint64_t SystemAssemblyStorageMap;
|
||||
uint64_t MinimumStackCommit;
|
||||
};
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_PEB_H_ */
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_TEB_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_TEB_H_
|
||||
#include "libc/nt/struct/peb.h"
|
||||
#ifdef __GNUC__
|
||||
|
||||
/*
|
||||
* These macros address directly into NT's TEB a.k.a. TIB
|
||||
* Any function that does this needs the `dontasan` keyword
|
||||
*/
|
||||
#define NtGetPeb() ((__seg_gs struct NtPeb *)0x60)
|
||||
#define NtGetTeb() ((void *)*(__seg_gs uintptr_t *)0x30)
|
||||
#define NtGetPid() (*(__seg_gs uint32_t *)0x40)
|
||||
#define NtGetTid() (*(__seg_gs uint32_t *)0x48)
|
||||
#define NtGetErr() (*(__seg_gs int *)0x68)
|
||||
#define _NtGetSeh() ((void *)*(__seg_gs uintptr_t *)0x00)
|
||||
#define _NtGetStackHigh() ((void *)*(__seg_gs uintptr_t *)0x08)
|
||||
#define _NtGetStackLow() ((void *)*(__seg_gs uintptr_t *)0x10)
|
||||
#define _NtGetSubsystemTib() ((void *)*(__seg_gs uintptr_t *)0x18)
|
||||
#define _NtGetFib() ((void *)*(__seg_gs uintptr_t *)0x20)
|
||||
#define _NtGetEnv() ((char16_t *)*(__seg_gs intptr_t *)0x38)
|
||||
#define _NtGetRpc() ((void *)*(__seg_gs uintptr_t *)0x50)
|
||||
#define _NtGetTls() ((void *)*(__seg_gs uintptr_t *)0x58)
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_TEB_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue