Skip to content

Use QueueUserAPC instead of CreateThread for DllMain#15

Merged
tobywf merged 1 commit intomainfrom
queue-user-apc
Sep 14, 2025
Merged

Use QueueUserAPC instead of CreateThread for DllMain#15
tobywf merged 1 commit intomainfrom
queue-user-apc

Conversation

@tobywf
Copy link
Copy Markdown
Member

@tobywf tobywf commented Sep 14, 2025

QueueUserAPC adds a asynchronous procedure call to the APC queue of the main/only thread. I.e. the APC runs before main, but crucially outside of the loader lock, which means there aren't the same pitfalls as running code in DllMain.

@tobywf tobywf merged commit 1cf586c into main Sep 14, 2025
2 checks passed
@tobywf tobywf deleted the queue-user-apc branch September 14, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant