dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.11k stars 220 forks source link

Request: Control Code constants for DeviceIoControl() #596

Closed BinToss closed 1 year ago

BinToss commented 2 years ago

e.g. FSCTL_SET_COMPRESSION

AArnott commented 2 years ago

Have you tried CsWin32? It includes this constant (if you fix the typo: FSCTL_SET_COMPRESSION)

BinToss commented 2 years ago

Yes, but it only works in Visual Studio right now. VSCode's OmniSharp extension doesn't support CsWin32's code generation at the moment. It compiles, but the editor doesn't recognize any of the CsWin32 symbols.

AArnott commented 2 years ago

Ah, yes. That makes sense. I haven't had any time lately to spend on adding APIs to this repo, nor yet to finish replacing the hand-coded APIs in the repo with the result of CsWin32 code generation. Until then, if you'd like to send a PR to add these constants, I typically can find time to review and merge those. You could even use CsWin32 in VS to help you get the C# code to insert into this repo. The code placement conventions are a little different in this repo so you'd need to account for that.

BinToss commented 2 years ago

I'd started to add a bunch of constants to a class, so I'll clean that up for a PR. I might have time next weekend for this.