Skip to content

Commit

Permalink
Avoid usage of CreateEventEx in WASAPI code
Browse files Browse the repository at this point in the history
This also uses FALSE as parameters consistently for CreateEvent()
  • Loading branch information
slouken committed Nov 25, 2024
1 parent 7a3f5ef commit c508396
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/audio/wasapi/SDL_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,7 @@ static bool mgmtthrtask_PrepDevice(void *userdata)
IAudioClient *client = device->hidden->client;
SDL_assert(client != NULL);

#if defined(SDL_PLATFORM_GDK) // CreateEventEx() arrived in Vista, so we need an #ifdef for XP.
device->hidden->event = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS);
#else
device->hidden->event = CreateEventW(NULL, 0, 0, NULL);
#endif

device->hidden->event = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!device->hidden->event) {
return WIN_SetError("WASAPI can't create an event handle");
}
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/d3d12/SDL_gpu_d3d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -6849,7 +6849,7 @@ static D3D12Fence *D3D12_INTERNAL_AcquireFence(
return NULL;
}
fence->handle = handle;
fence->event = CreateEvent(NULL, 0, 0, NULL);
fence->event = CreateEvent(NULL, FALSE, FALSE, NULL);
SDL_SetAtomicInt(&fence->referenceCount, 0);
} else {
fence = renderer->availableFences[renderer->availableFenceCount - 1];
Expand Down

0 comments on commit c508396

Please sign in to comment.