Setting window sizes, NewDir

This commit is contained in:
Krzosa Karol
2025-05-10 11:19:09 +02:00
parent c139c44503
commit a2b081ec15
12 changed files with 184 additions and 78 deletions

View File

@@ -276,6 +276,31 @@ int64_t GetFileModTime(String file) {
}
}
enum MakeDirResult {
MakeDirResult_Success,
MakeDirResult_Exists,
MakeDirResult_NotFound,
MakeDirResult_ErrorOther,
};
MakeDirResult MakeDir(String path) {
Scratch scratch;
MakeDirResult result = MakeDirResult_Success;
String16 string16 = ToString16(scratch, path);
BOOL success = CreateDirectoryW((wchar_t *)string16.data, NULL);
if (success == 0) {
DWORD error = GetLastError();
if (error == ERROR_ALREADY_EXISTS) {
result = MakeDirResult_Exists;
} else if (error == ERROR_PATH_NOT_FOUND) {
result = MakeDirResult_NotFound;
} else {
result = MakeDirResult_ErrorOther;
}
}
return result;
}
struct Win32Process {
HANDLE handle;
HANDLE child_stdout_read;