-
-
Notifications
You must be signed in to change notification settings - Fork 224
Request definitions for devguid.h and usbiodef.h. #393
Comments
Please review our contributing document for how to add APIs. We welcome code contributions to add the APIs you're missing. |
I don't mind doing some work myself but it seems like converting these headers will be a huge amount of work. I am surprised there is no tool that will do this in an automated fashion. There is the MSDN article program, but it can't handle whole files nor does it produce anything like what is in this repository. |
We discuss various code generation tools in #56. Short version: no tool is good enough. |
How should the following structure be converted? The tool converts the latter element to a string. typedef struct _USB_ROOT_HUB_NAME {
ULONG ActualLength;
WCHAR RootHubName[1];
} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USB_ROOT_HUB_NAME
{
public uint ActualLength;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)]
public string RootHubName;
} The structure is allocated as a variable size with the extra length belonging to the character array. The IOCTL in question is called twice; first to get the proper length. When used with the IOCT the generated structure works but I must adjust |
A first set of constants from |
Since both C++ and C# are Turing complete, then there must be rules to follow between them. For example: IntPtr or SafeHandle, there must be certain rules for choosing which one. Since the rules can be judged manually, such rules can be described through tools (such as scripts). The SharpGen tool mentioned above has certain deficiencies. But as I understand it, this may require parsing C++ Ast. But such tools are not impossible. For some situations, I think the tool can provide some options for users to choose. This is similar to fine-tuning on the basis of automation, or specific preferences for certain C++ libraries or projects to customize settings. |
It is ridiculous to maintain a large number of libraries by humans. |
@sgf You may be interested in https://github.com/microsoft/ClangSharp. It includes a ClangSharpPInvokeGenerator utility. Last time I checked, the project authors wanted to make sure ClangSharp can process the Win32 API. If you plan to use that tool to auto-generate the bindings for |
#455 |
Maybe you are right, forget it, I gave up the discussion. |
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? Where should they go?
The text was updated successfully, but these errors were encountered: