On Mon Oct 9 16:33:39 2023 +0000, Esme Povirk wrote:
Unless there's a way that an application can rely on this behavior, I don't think it matters what native does. If I'm reading the wineserver code correctly, there can only really be 65488 user handles total, and each time a handle is destroyed it ends up in a LIFO free list. The index into the table makes up the low word of the handle. Each time a handle index is reused, a "generation" counter is incremented (with a valid range from 1 to 0xfffe inclusive), and this makes up the high word. So really you would just have to destroy and recreate the same handle 65534 times. I think you would have to be running Wine for a long time and opening/closing a lot of windows, but I don't think it's that unlikely for someone to have a program+use case that does it.
So, turns out my original `EVENT_OBJECT_DESTROY` tests were done with `OBJID_CLIENT` instead of `OBJID_WINDOW`. Turns out native _does_ remove HWNDs when they're destroyed. This should be fixed in the current revision.