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;
```
--
v12: 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
This resolves the issue in StudioTax where the bounding box dimensions is reported as 0.
Because the height is less than 0, the check for height in GdipAddPathRectangle fails,
and the X and Y coordinates of the points is never set.
I am fairly ignorant of this code, this seems like a good approach, however I am happy for guidance from others more familiar in how gdiplus works.
--
v3: gdiplus: Fix text height calculation when exceeding rect
gdiplus: Check for NoClip in text height calculation
https://gitlab.winehq.org/wine/wine/-/merge_requests/5360
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v3: windowscodecs: Implement CreateQueryWriter().
windowscodecs/metadata: Base returned query handlers on metadata handlers.
windowscodecs/metadata: Return query writer object from GetMetadataByName() when block writer is used.
windowscodecs/metadata: Handle empty items in queries.
windowscodecs/metadata: Use separate helpers to parse query items.
windowscodecs/metadata: Add a helper to parse query index syntax.
windowscodecs/metadata: Collect query components before assigning values.
windowscodecs/metadata: Use VT_LPWSTR type instead of BSTRs when parsing queries.
windowscodecs/tests: Add some tests for the query reader container format.
windowscodecs/tests: Add some tests for CreateQueryWriterFromReader().
windowscodecs/tests: Add query reader tests for live block reader updates.
windowscodecs/tests: Add some tests for CreateQueryWriter().
windowscodecs/metadata: Share implementation between query reader and writer objects.
windowscodecs/tests: Add some query tests with the Unknown reader.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7329
On Sun Feb 16 17:41:01 2025 +0000, Brendan Shanks wrote:
> Another possibility is to use `libbsdxml`, a renamed expat that FreeBSD
> includes (although the man page says that “The libbsdxml library is
> intended to be used within the FreeBSD base system only. Use of the
> libbsdxml library for other purposes is not supported and discouraged.”
> But expat’s API is quite stable, and avahi also has the option to use bsdxml.)
> Otherwise, maybe just depend on a system-installed expat or libxml2 on FreeBSD?
Assuming this is desirable to read this file to begin with (e.g. if it's going to stay available in the future, if structure is stable, etc), we could potentially convert to WCHARs, and then reused much of existing code from manifest parsing. External library for something like seems heavy.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7339#note_94835
On Sun Feb 16 16:38:40 2025 +0000, eric pouech wrote:
> this likely could be folded in code line 510, by inserting between 510 & 511:
> if (return_code != NO_ERROR) dirStack = NULL;
Thank you. I knew this was non-optimal.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7322#note_94834
On Sun Feb 16 16:37:29 2025 +0000, eric pouech wrote:
> actually, we could (later on) have other values as return code...
> so IMO this should rather be written as:
> `if (return_code != NO_ERROR || (num_empty && !num_with_data))`
> ` errorlevel = ERROR_INVALID_FUNCTION;`
> `else`
> ` errorlevel = NO_ERROR;`
Thank you. I was hoping for clarification on this one.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7322#note_94833
On Sun Feb 16 16:38:49 2025 +0000, eric pouech wrote:
> nitpick: IMO it's more readable to return a RETURN_CODE, and pass a
> DIRECTORY_STACK\*\* to update the pointer (you likely did it this way to
> minimize change, but let's take the opportunity of a change to sanitize
> a bit the current spaghetti code)
It is *always* my philosophy to minimize changes to existing, working code. Some projects emphasize this. I also come from a working assumption, perhaps erroneously, that existing code is functional and already meets project standards. No one likes to come into a project to add contributions and then have to get out the mop bucket to clean up legacy technical debt. I'm speaking generally here and not specifically about this particular part of code.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7322#note_94832
On Sun Feb 16 17:01:28 2025 +0000, eric pouech wrote:
> globally it looks better
> a couple of stylistic remarks, but you need to go further for not using
> errorlevel inside the function and its helper
> perhaps, it's worthwhile to split the patch in two:
> * first one to no longer use error level internally, adapt
> list_directory prototype... (in the details, it's fine to use return
> errorlevel = ERROR\_\* while parsing the arguments in case of error, but
> when this is done all the rest of the code should use only the
> return_code (and set errorlevel when exiting WCMD_dir))
> * the second one to plug in the ctrl-c handling and breaking from the
> various loops
I only ever intended to do the second part. I've been doing the rest per your suggestions out of goodwill.
I'll continue to fix up the first part per your suggestions but I don't have the energy to split this into separate patches. I'll address the remaining issues that you have raised today but that's going to be it from me I'm afraid on this.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7322#note_94831