Make both method calls;
1. Consistently written with parameter names as per spec.
2. Fix parameter validation to be consistent with spec.
3. Fix szNameBuf parameter semantics as per spec.
4. Fix szNameBuf casing str search as per spec.
5. Factor out common code into TLB_ helpers vastly improves readability.
--
v20: dlls/oleaut32/connpt.c: Make consistent and validate args
dlls/oleaut32: Add missing IID case in ITypeLib2::QueryInterface()
dlls/oleaut32: Validate TLB_QueryInterface() params
dlls/oleaut32: Fix QueryInterface() to meet spec
dlls/shell32: Fix IUnknown::QueryInterface() to meet spec
dlls/oleaut32: Invert if-stmt in ITypeLib2_fnRelease()
dlls/oleaut32: Consistently use TLB_REF_NOT_FOUND
dlls/oleaut32: Validate arguments in ITypeLibComp interface
dlls/oleaut32: Validate arguments in ITypeComp interface
dlls/oleaut32: Consistently use TLB_get_bstr()
dlls/oleaut32: Invert if stmt for clarity
dlls/oleaut32: Fix nonsensical memory access in ITypeLib2_Constructor_SLTG()
dlls/oleaut32: Avoid ptr arithmetic in MSFT_DoVars()
dlls/oleaut32: Avoid ptr arithmetic in ITypeLib2_Constructor_SLTG()
dlls/oleaut32: Shink down ITypeLibComp_fnBind() verbosity some
dlls/oleaut32: ptr_size should be a ULONG
dlls/oleaut32: Scope indexer to loops in fn[Is|Find]Name()
dlls/oleaut32: Factor out TLB_get_funcparams_by_name()
dlls/oleaut32: Factor out TLB_get_funcdesc_by_name()
dlls/oleaut32: Validate args of ITypeLib2_fnIsName()
dlls/oleaut32: fn(Is|Find)Name should set szNameBuf with correct case
dlls/oleaut32: Use consistent param identifiers in fnFindName
dlls/oleaut32: Mostly mirror fnFindName impl in typelib.c
dlls/oleaut32: Use common and correct identifiers in typelib.c
dlls/oleaut32: Consistently use lstrcmpiW() while looking for names
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7286
Fixes Indiana Jones and the Great Circle showing system mouse cursor along with its own one after alt-tabbing out and in.
The game hides the cursor and sets up rawinput w/RIDEV_NOLEGACY in WM_ACTIVATE handling. Then, whenever it receives WM_SETCURSORPOS it shows the cursor back. WM_SETCURSORPOS is triggered by WM_MOUSEMOVE in DefWIndowProc; WM_MOUSEMOVE is not queued with rawinput/RIDEV_NOLEGACY but prior hardware messages and system messages from set_cursor_pos are present in the queue.
That's not the case on Windows. That corresponds to the fact that Windows generates those system WM_MOUSEMOVE message "on demand", that is, when Peek or GetMessage is called (see, e. g., [1]). While Wine generates and queues those in internal messages queue in server/queue.c:set_cursor_pos(). My test confirm Windows behaviour. There are corner case specifics which my patch ignores:
- If PeekMesage( PM_NOREMOVE) got the message it will be then delivered even after setting up rawinput;
- Delivery of SendInput() under these conditions depends on MOUSEEVENTF_MOVE_NOCOALESCE flag (which we currently don't support at all); my patch just drops any hardware WM_MOUSEMOVE messages under these conditions (which corresponds to Windows behaviour without MOUSEEVENTF_MOVE_NOCOALESCE).
1. https://devblogs.microsoft.com/oldnewthing/20130523-00/?p=4273
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7321#note_94406
This fixes https://bugs.winehq.org/show_bug.cgi?id=52094.
For reference, here's how current_modref is being passed around (before this patch):
```mermaid
graph TB
fii["fixup_imports_ilonly<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
fi["fixup_imports<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
pa["process_attach<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
ld[load_dll]
id["import_dll<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
bin["build_import_name<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
foe["find_ordinal_export<br><em style='color:#0f0'>(uses current_modref for relay)</em>"]
ffe["find_forwarded_export<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
fne[find_named_export]
MI[MODULE_InitDLL]
fii --> ld
fi --> id
pa --> MI -.-> DllMain
id --> bin
id --> ld
id --> foe
id --> fne --> foe --> ffe --> foe
ffe --> fne
ffe --> bin
style DllMain color:red;
```
--
v10: ntdll: Remove superflous NULL check for importer.
ntdll: Properly track refcount on dynamic imports of export forwarders.
ntdll: Explicitly ignore dynamic (GetProcAddress) importers as relay/snoop user module.
ntdll: Properly track refcount on static imports of export forwarders.
ntdll: Register module dependency for export forwarders regardless of whether the dependency is already loaded.
ntdll: Don't re-add a module dependency if it already exists.
ntdll: Register module dependency for export forwarders only after successful resolution.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7