Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility between WindowsAppRuntime.dll and SetDefaultDllDirectories #4403

Open
razvan-pricope opened this issue May 10, 2024 · 0 comments
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged)

Comments

@razvan-pricope
Copy link

Describe the bug

Hello, we are using WindowsAppRuntime (indirectly) from an winui3 desktop application. We noticed that the application does not start when calling SetDefaultDllDirectories. I managed to track the issue to this LoadLibraryExW call when calling it with a relative path (dcompi.dll during my tests)
).

The documentation of LoadLibraryExW states about LOAD_WITH_ALTERED_SEARCH_PATH that:

If this value is used and lpFileName specifies a relative path, the behavior is undefined.

A minimally reproducible example of the behavior (without the entire winui infrastructure, just for demonstration purposes):

int main()
{
	SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
	HMODULE mod = LoadLibraryExW(L"dcompi.dll", nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
	return 0;
}

Steps to reproduce the bug

Run any WindowsAppRuntime app that calls SetDefaultDllDirectories. It should just work.

Expected behavior

No response

Screenshots

No response

NuGet package version

None

Packaging type

No response

Windows version

No response

IDE

Visual Studio 2022

Additional context

No response

@codendone codendone added the area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged)
Projects
None yet
Development

No branches or pull requests

2 participants