Safely remove hardware in system tray doesn't work

Found a bug in "Everything"? report it here
Post Reply
sheppaul
Posts: 25
Joined: Sat Jan 12, 2013 5:58 pm

Safely remove hardware in system tray doesn't work

Post by sheppaul »

I'm not sure if this is a bug or not...

NTFS formatted Usb-HDD Cannot be removed safely from system tray while running everything.
Is it normal?
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Safely remove hardware in system tray doesn't work

Post by void »

What version of Everything?

Could you please send the debug output when when you try to safely remove the USB HDD.
sheppaul
Posts: 25
Joined: Sat Jan 12, 2013 5:58 pm

Re: Safely remove hardware in system tray doesn't work

Post by sheppaul »

I'm always using the latest version: 683b

It takes some time to reproduce the problem. So the debug text is rather big.

USB-HDD (J: drive) won't be removed safely from systray until everything is exited.

debug info:
debug.rar
debug data text
(7.09 KiB) Downloaded 765 times
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Safely remove hardware in system tray doesn't work

Post by void »

Thanks for the debug output.

I see you are using the Everything service, the Everything service monitors the volumes and is probably holding a handle open / not getting notification to query device removal.
Unforunately, I don't have any debug mode for the service in the current build (I've added one for the next update).

Could you please try disabling the Everything service and run Everything as admin and send the debug output when you remove the device?
sheppaul
Posts: 25
Joined: Sat Jan 12, 2013 5:58 pm

Re: Safely remove hardware in system tray doesn't work

Post by sheppaul »

Hmm, everything service seems not related with the problem because "Safely remove function" works just after exiting the running everything.exe, not service. Do you still need debug info?

FYI, running everything seems not refreshing (offline) drive icon dynamically while turning on the power switch of usb-hdd.

ps. I'm using the context menu of folder an files: "$exec("D:\totalcmd\TOTALCMD64.exe" /O /T /R="%1")"
Can it be a problem? Of course, Total command is not running when I try "safely remove function".
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Safely remove hardware in system tray doesn't work

Post by void »

Thanks for the update.
Hmm, everything service seems not related with the problem because "Safely remove function" works just after exiting the running everything.exe, not service. Do you still need debug info?
If you run Everything as a standard user then the Everything service will do all the volume monitoring, Everything will never touch a volume handle.
Exiting Everything will close all the handles opened by the service. I haven't had any problems with my testing, it might be a permissions issue, or something to do with the service not receiving a device removal query, it's hard to tell without debug info.

The custom context menu shouldn't have any effect on the open handles by the Everything service.

Process Explorer will show you the handles open by Everything and the Everything service.

I've added the debug console to the Everything service in Everything 684.
To run the service in debug mode:
  • Make sure the service is not installed
  • From a command prompt, run: Everything.exe -svc -debug
  • Run Everything normally.
  • Try safely removing a device
  • What is displayed in the debug output?
FYI, running everything seems not refreshing (offline) drive icon dynamically while turning on the power switch of usb-hdd.
Normally Everything will receive a device added notification, when it does Everything should re-start the monitors for the added device.
Perhaps Everything is not receiving this notification, I would need to see the debug output.
sheppaul
Posts: 25
Joined: Sat Jan 12, 2013 5:58 pm

Re: Safely remove hardware in system tray doesn't work

Post by sheppaul »

At this time, "safely remove" does not work even after exiting a running everything.exe. Probably because of debug info window?
Anyway, here it is. :)

Code: Select all

Everything
Version 1.3.4.684b (x64)
Windows NT 6.2
Processors 4
IsAdmin 1
AppData 0
Service 0
client connected
Command: 1
open volume \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
opened 72 0.000123
result: 0
Command: 7
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{32ad6299-f42f-479c-8d9c-bc318faf507c}
opened 72 0.000103
result: 0
Command: 7
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{8531559a-c6d0-4d18-8bd6-67dab82fa84a}
opened 404 0.000307
result: 0
Command: 7
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{7ebb7171-454b-455b-a1b3-4ae0fbb2c043}
opened 300 0.000274
result: 0
Command: 7
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{fd8f186b-fc4b-4afd-920f-10d3c703cdd2}
opened 404 0.000240
result: 0
Command: 7
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{5a8d55ca-f388-4ec6-8d5f-6793e4d2eaca}
opened 300 0.000341
result: 0
Command: 7
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
opened 404 0.000334
result: 0
Command: 8
result: 0
Command: 8
result: 0
Command: 8
result: 0
Command: 8
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{32ad6299-f42f-479c-8d9c-bc318faf507c}
opened 404 0.000220
result: 0
Command: 8
result: 0
Command: 8
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{8531559a-c6d0-4d18-8bd6-67dab82fa84a}
opened 300 0.000205
result: 0
Command: 8
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{7ebb7171-454b-455b-a1b3-4ae0fbb2c043}
opened 404 0.000201
result: 0
Command: 8
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{fd8f186b-fc4b-4afd-920f-10d3c703cdd2}
opened 300 0.000172
result: 0
Command: 8
result: 0
Command: 2
result: 0
Command: 1
open volume \\?\Volume{5a8d55ca-f388-4ec6-8d5f-6793e4d2eaca}
opened 404 0.000185
result: 0
Command: 8
result: 0
Command: 2
result: 0
Command: 9
result: 0
Command: 9
result: 0
Command: 9
result: 0
Command: 9
result: 0
Command: 9
result: 0
Command: 9
result: 0
Command: 10
start all monitors (6)
KEEP MISSING VOLUMES 1
start monitor 000000000025c030 0
open volume \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
opened 404 0.000221
start monitor 000000000025bbf0 0
open volume \\?\Volume{32ad6299-f42f-479c-8d9c-bc318faf507c}
opened 404 0.000175
start monitor 000000000025bdb0 0
open volume \\?\Volume{8531559a-c6d0-4d18-8bd6-67dab82fa84a}
opened 404 0.000297
start monitor 000000000025beb0 0
open volume \\?\Volume{7ebb7171-454b-455b-a1b3-4ae0fbb2c043}
opened 404 0.000193
start monitor 000000000025be30 0
open volume \\?\Volume{fd8f186b-fc4b-4afd-920f-10d3c703cdd2}
opened 424 0.000181
start monitor 000000000025bdf0 0
open volume \\?\Volume{5a8d55ca-f388-4ec6-8d5f-6793e4d2eaca}
opened 76 0.001881
new thread (0)
monitor thread started
result: 0
open volume \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
opened 444 0.000423
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
open volume \\?\Volume{32ad6299-f42f-479c-8d9c-bc318faf507c}
opened 456 0.001812
open volume \\?\Volume{8531559a-c6d0-4d18-8bd6-67dab82fa84a}
opened 464 0.001308
open volume \\?\Volume{7ebb7171-454b-455b-a1b3-4ae0fbb2c043}
opened 472 0.000255
open volume \\?\Volume{fd8f186b-fc4b-4afd-920f-10d3c703cdd2}
opened 480 0.000160
open volume \\?\Volume{5a8d55ca-f388-4ec6-8d5f-6793e4d2eaca}
opened 488 0.000208
waiting for 6 handles, isdelay 1...
waiting for 6 handles, isdelay 0...
Command: 12
open volume \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
opened 496 0.000307
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 7 handles, isdelay 0...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
waiting for 6 handles, isdelay 0...
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 6 handles, isdelay 1...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
waiting for 6 handles, isdelay 1...
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 6 handles, isdelay 1...
waiting for 7 handles, isdelay 0...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
waiting for 6 handles, isdelay 0...
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 6 handles, isdelay 1...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
waiting for 6 handles, isdelay 1...
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 6 handles, isdelay 1...
waiting for 7 handles, isdelay 0...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
WM_DEVICECHANGE 00000007 0000000000000000
data available on monitor \\?\Volume{32ad6299-f42f-479c-8d9c-bc318faf507c}
result: 1
Command: 12
waiting for 5 handles, isdelay 0...
result: 0
Command: 12
result: 0
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 5 handles, isdelay 1...
Command: 12
open volume \\?\Volume{32ad6299-f42f-479c-8d9c-bc318faf507c}
opened 392 0.000212
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 5 handles, isdelay 1...
waiting for 7 handles, isdelay 0...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
waiting for 6 handles, isdelay 0...
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 6 handles, isdelay 1...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
result: 1
waiting for 6 handles, isdelay 1...
Command: 12
result: 0
Command: 12
result: 0
Command: 11
result: 0
waiting for 6 handles, isdelay 1...
waiting for 7 handles, isdelay 0...
data available on monitor \\?\Volume{8f0c0ff5-0182-4f51-890c-b92a8661cc64}
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Safely remove hardware in system tray doesn't work

Post by void »

Thanks for the service debug output.

There is no request for Everything to remove the device (DBT_DEVICEQUERYREMOVE, GUID_IO_VOLUME_LOCK or GUID_IO_VOLUME_DISMOUNT) and unfortunately, Everything is not handling DBT_DEVNODES_CHANGED correctly.
I have added this to my "Things to fix" list.

Currently there is no fix for this, sorry.
You will need to exit Everything before removing the device.
fletch
Posts: 1
Joined: Mon Mar 16, 2015 10:29 pm

Re: Safely remove hardware in system tray doesn't work

Post by fletch »

This is likely the same problem I'm seeing. Though I added the drive letter where my thumb drive mounts to the exclude list, Everything still opens a handle to it and I can't eject it without exiting Everything.
bezantsoft
Posts: 1
Joined: Thu Jan 01, 2015 9:07 pm

Re: Safely remove hardware in system tray doesn't work

Post by bezantsoft »

For years, I used the trick of Control-C in a command window to fix this problem, then I started using sync.exe from SysInternals. About the time that SysInternals moved to Microsoft, I found HotSwap! by Kazuyuki Nakayama. The blurb on his web page says it all:
It does the same thing as you can remove device from Device Manager but it provides much friendly user interface as you remove the removable device from the "Safely Remove Hardware" icon in the notification area. It also ensures that all data are written and flushed to the disk before the device to be hot-swapped, so you can use SATA/eSATA drive as a removable device much alike USB/IEEE1394 drive.
I've used several indexing/search programs over the years, and had to use HotSwap! to dismount just about every type of drive at one time or another.

/s/ BezantSoft
Post Reply