pinvoke
pinvoke copied to clipboard
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.
There are several [ncryptprotect](https://docs.microsoft.com/en-us/windows/win32/api/ncryptprotect/) functions, such as [NCryptCreateProtectionDescriptor](https://docs.microsoft.com/en-us/windows/win32/api/ncryptprotect/nf-ncryptprotect-ncryptcreateprotectiondescriptor), that would be very helpful. Please add these to your library. If there's a better way of using DPAPI-NG with the existing...
I noticed that both [QueryServiceConfig](https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-queryserviceconfigw) and [QueryServiceConfig2](https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-queryserviceconfig2w) are missing from `PInvoke.AdvApi32`. Without `QueryServiceConfig` I don't see another way to get the binary path for a service.
Examples: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/hidpi/nf-hidpi-hidp_getdata https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/hidpi/nf-hidpi-hidp_getusagevaluearray https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/hidpi/nf-hidpi-hidp_getvaluecaps https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/hidsdi/nf-hidsdi-hidd_getindexedstring
#535 introduces a `ReadOnlySpan` overload for `CreateFile`. The use of span suggests to the caller that length is taken into account, but it is not. Instead, `CreateFile` is only going...
As [@vbfox said](https://github.com/AArnott/pinvoke/pull/285/files#r78185968): > Always generating `StringBuilder` for "out + char_" and `string` for "in + char_" seem like good defaults
WinUser.h defines object ID constants (e.g. OBJID_WINDOW, OBJID_SYSMENU, etc) that are useful when implementing the WinEventProc delegate defined in User32.cs. Here is how I define them in my code. Are...
Overlapped I/O uses Win32 events to signal the completion of an overlapped I/O operation. .NET nor PInvoke.Kernel32 provide built-in support for working with Win32 events. Consider adding support for: -...
Overlapped I/O in Win32 maps to async I/O in .NET. There's some boilerplate code that needs to be written to make overlapped I/O functions behave as async methods in .NET....
This goes along with my other issue, #392. Is there a way to automatically generate these definitions, or should I manually fill in the ones I am going to use?...
IOCTL codes really are `uint` values, not `int` values. They are 32-bit values which consist of various fields, see https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/defining-i-o-control-codes . _Originally posted by @qmfrederik in https://github.com/dotnet/pinvoke/pull/503/files_