On Wed, Feb 1, 2017 at 7:15 PM, Alexandre Julliard julliard@winehq.org wrote:
Is a version check really necessary? Couldn't we find some better way? In what way does the app depend on the window creation order?
I think we may delay OleInitialize() unconditionally, but there is a small risk we'll find an application which depends on the behavior of newer Windows versions. An app to be affected by this change would have to use hooks or similar mechanism, because the change won't be visible in OFNHookProc.
The broken app installs WH_CBT hook, and it uses this hook to add HWND handles to internal hashmap-like data structure. When a file dialog window is not reported to the hook procedure as the first window created immediately after GetOpenFileName(), then it doesn't seem to be added to this internal data structure, and the app crashes later on in the file dialog lpfnHook when it cannot find HWND in its internal data structure.