Closed ghost1372 closed 2 weeks ago
RtlGetVersion
is already covered by WDK metadata.
FlushMenuThemes
and SetPreferredAppMode
appear to be undocumented, exported only by ordinal via uxtheme. While public, not sure those are a candidate for addition to metadata? @mikebattista
Thank You @riverar so what should i do? i am not familiar with WDK metadata. should i install some nuget package to fix it?
@AArnott What's the official way to bring WDK metadata into CsWin32? Or does @ghost1372 need to manually add a reference like I did in https://github.com/microsoft/CsWin32/issues/1176?
WDK metadata is brought in by default. RtlGetVersion
is available already if you ask for it in NativeMethods.txt. It's generated as Windows.Wdk.PInvoke.RtlGetVersion
WDK metadata is brought in by default.
RtlGetVersion
is available already if you ask for it in NativeMethods.txt. It's generated asWindows.Wdk.PInvoke.RtlGetVersion
tnx but its not working!
@ghost1372 Try just adding RtlGetVersion
to NativeMethods.txt
.
RtlGetVersion
Tnx it is working fine! It's very strange, I tried this before and it didn't work (my first post), but now it works without any problem, of course I have to say that I installed the following packages (In CSWin32, their versions are less)
<PackageReference Include="Microsoft.Windows.SDK.Win32Metadata" Version="62.0.23-preview" />
<PackageReference Include="Microsoft.Windows.WDK.Win32Metadata" Version="0.12.8-experimental" />
but now that I have removed it, it still works.
I was globally using the following namespace, so PInvoke was always called from there
global using Windows.Win32;
Now I found that PInvoke is also available in the following namespace
using Windows.Wdk;
I've dropped RtlGetVersion
from the title since that's already there.
That leaves the remaining two apparently undocumented functions for consideration.
I'm following up for some more context on these APIs. If they're internal/undocumented, then I won't add them here.
I confirmed these aren't ready for general use so will not be added here.
Actual behavior
i want to use FlushMenuThemes, SetPreferredAppMode and RtlGetVersion methods but none of them exist, currently i can use them with dllimport:
but i can not access this methods because do not exist/available
Expected behavior
we should be able to use FlushMenuThemes, SetPreferredAppMode, RtlGetVersion
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Any of your own code that should be shared?
Context
0.4.422-beta
] latestnetstandard2.0
] net8.0LangVersion
(if explicitly set by project): [e.g.9
] Latest