shinao / windevicemanagerlight Goto Github PK
View Code? Open in Web Editor NEWenable and disable devices on windows
License: MIT License
enable and disable devices on windows
License: MIT License
I currently have not a 32-bit Windows device, so I cannot test whether this application runs correctly on a 32-bit device or not, but it caused exceptions on my 64-bit Windows devices.
I changed ToInt32()
to ToInt64()
, and it worked. Also, enabling/disable required administrative privilege. Without it, it did not work. So, it might be a good idea to show an error message like "Cannot enable/disable the device without administrative privilege."
I want to integrate the class into an existing app that required 0x86 for historical purposes. If I switch you app from x64 to x86, if fails to reset at the following line:
private bool ChangeIt(IntPtr hDevInfo, Native.SP_DEVINFO_DATA devInfoData, bool bEnable)
{
...
if (Native.SetupDiSetClassInstallParams(hDevInfo, ptrToDevInfoData, ptrToPcp, Marshal.SizeOf(typeof(Native.SP_PROPCHANGE_PARAMS))))
{
Native.SetupDiCallClassInstaller(Native.DIF_PROPERTYCHANGE, hDevInfo, ptrToDevInfoData);
}
...
}
The "If" statement fails and the GetLastError returns an 87. I'm guessing it may have to do with structure size, but wanted to run this by you to see if you've seen it.
Great class by the way :)
Thanks,
J. Martin
Hello, i'm currently working on a VB.NET app (VS2010) that uses your .dll to enable and disable devices. The problem is, even though i run my app with admin privileges, the enable/disable method of your library doesn't work and throws the following exception :
Unable to change Bluegiga Bluetooth Low Energy (COM7) device state, make sure you have administrator privileges
Do you have any solution for this ?
Thanks in advance
USB-SERIAL CH340
when it was using,can't be disabled without rebbot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.