Driver's uninstall button is disabled - driver

I've written my fairly simple first driver for a virtual device. It also has a .inf and I install the driver using devcon.exe.
It install fine and functions properly but my problem is when I try to uninstall it: devcon.exe can't uninstall it and in Device Manager, the Uninstall, Roll Back and Disable buttons for the driver are disabled. My main concern for now is the Uninstall button.
My driver implements the DriverObject->DriverUnload. I've look in the msdn docs, and for now I can't find any DDUninstall INF section for drivers.
When I look in the %WinDir%\inf\setupapi.app.log I see the following error for when I try to remove it with devcon.exe:
>>> [DIF_REMOVE - ROOT\HIDCLASS\0000]
>>> Section start 2012/04/01 20:52:22.237
cmd: devcon.exe remove HID\MyDriver
!!! dvi: Default installer: failed!
!!! dvi: Error 0xe0000231: The device cannot be disabled.
<<< Section end 2012/04/01 20:52:22.252
<<< [Exit status: FAILURE(0xe0000231)]
Is there anything I'm missing in the code or in the .inf file so that my driver can be uninstalled ?

Im not sure that this is a inf-related problem. Error 0xe0000231 means ERROR_NOT_DISABLEABLE.
You cannot desinstall while it is being used. So the problem should be the disable.
Do you have defined any close/cleanup callbacks?

Windows won't allow you disable the device while it has child devices on the fly. The simplest way to uninstall the root device is using DiUninstallDevice.
Reference: https://learn.microsoft.com/en-us/windows-hardware/drivers/install/using-setupapi-to-uninstall-devices-and-driver-packages

Related

Cant upload to the NodeMCU Lua

I have a NodeMCU board running the Lua interpreter, I can access the serial connection via the nodemcu-tool to input commands but when using the nodemcu-tool to upload or reset the filesystem it returns
[NodeMCU-Tool]~ Unable to establish connection
[NodeMCU-Tool]~ Timeout, no response detected - is NodeMCU online and the Lua interpreter ready ?
I might have an answer:
I ran into the same (or very, very similar) problem, on Mac OS X Mojave.
In the end, I reverted to completely uninstalling Node.js (this experience does not help convincing me of Node.js but that is another story) and start from scratch.
Even that did not help because I ran into trouble installing nodemcu-tool ...
Previously I installed it as a global package, and that somehow worked, but it caused me to always sudo my nodemcu-tool invocations - not a good thing!
In any case, sudo-ing plus the commandline parameter "--connection_delay" (or as a project setting, "connectionDelay") helped getting me going.
Until I messed up, and reinstalled everything from scratch. However, the key difference to the instructions for installing nodemcu-tool was adding the '--unsafe-perm' parameter to it, like so:
sudo npm install --unsafe-perm nodemcu-tool -g
That was to be able to get past the repeated installation errors for the serialport package...
IMO, relying on unsafe permissions (for what exactly, anyway!?) is, well, UNSAFE! GRRRRR
To the OP, make sure that:
you have installed Node.js and nodemcu-tool properly (download stable installer etc), and
that you use the --connection_delay parameter in each and every nodemcu-tool invocation!
I had the same problem!
The solution was to reset the board:
Conect the board via USB and press FLASH + RST (two buttons on the board)
relese FLASH
relese RST
Now you can upload your sketch.
If it doesn't work try to disconnect all pins. In my case the GPIO4 was soldered to a LED-Strip and i it was imposible to load the sketch until i disconnected it.

Error Could not connect to server; are you sure it's running? In appium

I am getting this error. How to solve this.
Just tick the below checkbox "Allow Unauthorized Certificates" for appium versions 1.6.*
and make sure you are under "Automatic Server" tab
Go to automatic server option and start session . and give the right path of apk file. it is work for me
(appium server 1.7)
After searching and applying lots of solutions finally i did following settings for Successful Android appium app testing on windows machine.
Software:
As of now they have released appium-server and appium-inspector as two seperate softwares. I'm using latest version of repositories.
Appium server 1.22.0
Appium Inspector 2021.9.2
Appium Server Settings
Make sure you have the same settings shown in the images below.
Appium Inspector settings
Steps to start appium:
Start appium server first
Then Start appium Inspector (make sure you add desired capabilities manually otherwise below error msg will arrive if you pasted Json representation manually)
Failed to create session. An unknown server-side error occurred while
processing the command. Original error: You must include a
platformName capability.
After adding Representation it will look like below
{
"platformName": "android",
"deviceName": "emulator-5554",
"appPackage": "com.coswarden",
"appActivity": "ActivityHome"
}
Hope this will solve your error.
You can use UI AutomatorViewer to find the element in the application.
just install jdk8 because appium and uiautomator are compatible with java8 only problem will be solved. And follow below steps:
Right Click on the My Computer and Select the properties
Click on advanced system settings
Click on Environment Variables
Click on new Button of User variables
Type PATH in the Variable name.
Copy the path of bin folder which is installed in JDK folder.
Paste Path of bin folder in Variable value and click on OK Button.
You can follow a similar process to set CLASSPATH.
and restart your PC
Go to command prompt and type javac command and check java8 is installed properly or not.
And see whether android sdk has tools folder in it, In which uiautomator is present
For those who are still struggling to get started, I will add several screenshots to show the complete setup I have for Appium Server GUI, and Appium Inspector.

Drop packets using WinDivert

I'm trying to write simple firewall that can drop packet by filter. For this purpose i'm use WinDivert. I'm load WinDivert.dll and add WinDivert.lib and WinDivert32.sys to project folder. Then i try use WinDivertOpen() to install WinDivertDriver. The result is always negative.
What do I do wrong and how can I successfully install the driver? Code example.
I solved this problem in the following way.
1) In Project->Properties->Linker->Input->Additional Dependencies set path to WinDivert.lib .
2) Moved to root folder files WinDivert.dll and WinDivert32.sys.
3) Include windivert.h to my project.
4) Set my PC in TESTSIGNING Boot Configuration (Use for this Windows Driver Kit 7.1.0.).
5) Restart PC.
If these steps did not help you should build WinDivert from sources with Windows Driver Kit 7.1.0. and Visual Studio 12 or higher as it is described here

Why does the system keep in (CHAOS CALMER)15.05 after upgrading 15.05.1?

I tried many times to upgrade the firmware in both LuCi and SSH as well as the cold reset of the router..
But the information still shows in LuCi,
Hostname OpenWrt
Model Buffalo WZR-HP-G450H
Firmware Version OpenWrt Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45)
Kernel Version 3.18.20
It's different from openwrt mentioned 15.05.1 in its main page,
Linux kernel updated to version 3.18.23
...
and one more problem is,
opkg cannot update,
Downloading https://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/base/Packages.gz.
Downloading https://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/base/Packages.sig.
Signature check failed.
Remove wrong Signature file.
...
What's wrong with my updating?

How to verify inf file installation

I have .inf file with a brother .sys file in the same folder.
they are drivers for plug and play device via usb .
When i try double click / right click the .inf file and pressing "Install"
It does not work, but if i try from "Device Manager" and choose to install manually with a given path - it installs OK.
How can i handle this, to make the inf file installable.. ?
Thanks.
there is a perl script tool called "chkinf"
http://msdn.microsoft.com/en-us/library/windows/hardware/ff543461(v=vs.85).aspx
to verify the correctness of inf files.
in addition in order to install inf properly it should have [defaultinstall] statement in it.
this is not the correct way to install a device driver.
the right way is to use a tool like, DPInst.exe
Guide is at
http://blogs.technet.com/b/svengruenitz/archive/2008/07/02/driver-installation-and-updating-made-easy-dpinst-exe.aspx
enjoy.

Resources