On Wed Sep 7 09:02:26 2022 +0000, Huw Davies wrote:
Isn't this a complicated way of retrieving the current module? In any case, `hmodule` isn't used after this. In general, there's any awful lot of code in each commit of this MR, which makes it very hard to review. Please try to split things up.
The idea here was to get hmodule to increment the module reference count, and then we release the global variable `HMODULE huia_module` to decrement it.
I guess I could just create separate global variables in both `uia_provider.c` and `uia_client.c`, but it's theoretically possible another thread could start while a prior one is still shutting down, and I didn't want them to fight over variable assignment. Having a single global module handle, then incrementing it with `GetModuleHandleExW` made sense to me. This is similar to what is done [here.](https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/vcomp/main.c#L1673)
I'll try to split things up a bit more, sorry about that.