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

@ -17,10 +17,13 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/state.internal.h"
#include "libc/fmt/itoa.h"
#include "libc/intrin/describeflags.internal.h"
#include "libc/nt/struct/securityattributes.h"
const char *DescribeNtSecurityAttributes(struct NtSecurityAttributes *p) {
const char *(DescribeNtSecurityAttributes)(char buf[32],
struct NtSecurityAttributes *p) {
if (p == &kNtIsInheritable) return "&kNtIsInheritable";
return "0";
FormatInt64(buf, (uintptr_t)p);
return buf;
}