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

Add assembly for methods in cfgmgr32.dll. #222

Closed
zhuxb711 opened this issue Apr 2, 2021 · 4 comments
Closed

Add assembly for methods in cfgmgr32.dll. #222

zhuxb711 opened this issue Apr 2, 2021 · 4 comments
Assignees

Comments

@zhuxb711
Copy link
Contributor

zhuxb711 commented Apr 2, 2021

Describe the bug
No CM_....... function in SetupAPI class.

Expected behavior
SetupAPI should include the function like:
CM_Request_Device_Eject()
CM_Get_Parent()

They are in cfgmgr32.h but we could use it by using

[DllImport("setupapi.dll", CharSet = CharSet.Unicode)]
 private static extern int CM_Request_Device_Eject(
            uint dnDevInst,
            out PNP_VETO_TYPE pVetoType,
            StringBuilder pszVetoName,
            int ulNameLength,
            int ulFlags);
@dahall
Copy link
Owner

dahall commented Apr 2, 2021

I found very little online referencing these functions so I ignored them. Have you found practical uses for them?

@zhuxb711
Copy link
Contributor Author

zhuxb711 commented Apr 2, 2021

Check here

I use them to Eject the USB device. But I don't have too much article about cfgmgr32.h

@dahall dahall changed the title SetupAPI should include the function in cfgmgr32.h Add assembly for methods in cfgmgr32.dll. Apr 8, 2021
@dahall dahall self-assigned this Apr 8, 2021
@dahall
Copy link
Owner

dahall commented Apr 8, 2021

Doing a little more checking, those methods are only referenced in SetupApi.dll. They are declared and defined in CfgMgr32.dll. I'll put it on the list of assemblies to create. I'm going to change the title to reflect the change.

@dahall
Copy link
Owner

dahall commented May 3, 2021

Out on AppVeyor is a pre-release for the CfgMgr32 assembly with all the documented methods and some helper functions and classes as well. Maybe some will be of use to you.

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

No branches or pull requests

2 participants