Fix a bunch of Windows bugs reported on Discord

This change addresses everything from stack smashing to %SYSTEMROOT%
breaking socket(). Issues relating to compile.com not reporting text
printed to stderr has been resolved for Windows builds.
This commit is contained in:
Justine Tunney 2023-07-28 06:17:34 -07:00
parent b0e3258709
commit 5018171fa5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
10 changed files with 104 additions and 46 deletions

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_SECURITYATTRIBUTES_H_
#define COSMOPOLITAN_LIBC_NT_STRUCT_SECURITYATTRIBUTES_H_
#include "libc/mem/alloca.h"
#include "libc/nt/struct/securitydescriptor.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
@ -9,7 +10,10 @@ struct NtSecurityAttributes {
bool32 bInheritHandle;
};
const char *DescribeNtSecurityAttributes(struct NtSecurityAttributes *);
const char *DescribeNtSecurityAttributes(char[32],
struct NtSecurityAttributes *);
#define DescribeNtSecurityAttributes(x) \
DescribeNtSecurityAttributes(alloca(32), x)
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_SECURITYATTRIBUTES_H_ */