diff --git a/src/Platform.c b/src/Platform.c index c68e6d797..19e759215 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -365,7 +365,7 @@ cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCall cc_string path; char pathBuffer[MAX_PATH + 10]; WCHAR str[NATIVE_STR_LEN]; WCHAR* src; - WIN32_FIND_DATA entry; + WIN32_FIND_DATAW entry; HANDLE find; cc_result res; int i; @@ -626,7 +626,7 @@ void Mutex_Lock(void* handle) { EnterCriticalSection((CRITICAL_SECTION*)handle void Mutex_Unlock(void* handle) { LeaveCriticalSection((CRITICAL_SECTION*)handle); } void* Waitable_Create(void) { - void* handle = CreateEvent(NULL, false, false, NULL); + void* handle = CreateEventA(NULL, false, false, NULL); if (!handle) { Logger_Abort2(GetLastError(), "Creating waitable"); } diff --git a/src/Window.c b/src/Window.c index 6fb4bd6f9..8d0126a90 100644 --- a/src/Window.c +++ b/src/Window.c @@ -922,13 +922,14 @@ void Window_AllocFramebuffer(struct Bitmap* bmp) { BITMAPINFO hdr = { 0 }; if (!draw_DC) draw_DC = CreateCompatibleDC(win_DC); - hdr.bmiHeader.biSize = sizeof(BITMAPINFO); + hdr.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); hdr.bmiHeader.biWidth = bmp->width; hdr.bmiHeader.biHeight = -bmp->height; hdr.bmiHeader.biBitCount = 32; hdr.bmiHeader.biPlanes = 1; draw_DIB = CreateDIBSection(draw_DC, &hdr, DIB_RGB_COLORS, (void**)&bmp->scan0, NULL, 0); + if (!draw_DIB) Logger_Abort2(GetLastError(), "Failed to create DIB"); } void Window_DrawFramebuffer(Rect2D r) {