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

How to customize [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] in code generated by cswin32? #1307

Open
HppZ opened this issue Nov 8, 2024 · 2 comments

Comments

@HppZ
Copy link

HppZ commented Nov 8, 2024

No description provided.

@HppZ HppZ changed the title How to customize DefaultDllImportSearchPathsAllowAppDirAttribute in code generated by cswin32? How to customize [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] in code generated by cswin32? Nov 8, 2024
@HppZ
Copy link
Author

HppZ commented Nov 8, 2024

+ if I use cswin32 for third party dlls?

@AArnott
Copy link
Member

AArnott commented Jan 22, 2025

Great question. I don't see a way to do that. We do have a hard-coded list of libraries that are allowed to be app-local here:

private static readonly string[] AppLocalLibraries = new[] { "DbgHelp.dll", "SymSrv.dll", "SrcSrv.dll" };

That list is consumed here:

private static bool IsLibraryAllowedAppLocal(string libraryName)

But there doesn't appear to be any programmatic way to do this. I'm surprised this hasn't come up earlier, since I think for a couple years 3rd party dll's have generated metadata for CsWin32 consumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants