TC 7.50a terminates Formatting of device when closed

Please report only one bug per message!

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
calios
Junior Member
Junior Member
Posts: 20
Joined: 2006-08-28, 08:18 UTC

TC 7.50a terminates Formatting of device when closed

Post by *calios » 2009-12-15, 08:12 UTC

repro:
-------

1. format any external hdd or usb key using rightclick on the drive button
2. the windows format dialog pops up
3. start format with desired settings
4. close tc
5. formatting window is killed with tc


suggest:
----------

when format is in progress ask if tc should terminate and kill format or not

alternative

call the system format dialog in a seperate process that survives tc program termination

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37734
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2009-12-17, 16:58 UTC

Unfortunately formatting is part of the system, not Total Commander itself. Total Commander isn't informed by the system when a window opened by the context menu is closed. :(
Author of Total Commander
http://www.ghisler.com

User avatar
calios
Junior Member
Junior Member
Posts: 20
Joined: 2006-08-28, 08:18 UTC

Post by *calios » 2009-12-19, 14:56 UTC

thank you for the quick response :-)

i see the problem tc has - two things come to mind:

#1 attach format api call to separate process

#2 on format api call - trigger scan for format api window - when closing tc check for format window still beeing present (you could also hook to the window close event)

i would not suggest this if my latest experience of formatting a newly bought 1.5 tb hard drive had not abruptly ended at approx. 90% (after some hours of formatting) - my face must have been price winning :-P

User avatar
MVV
Power Member
Power Member
Posts: 8337
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-12-20, 18:15 UTC

As I see, when I open format dialog or properties window, or use Ctrl+C/Ctrl+V, new thread adds, with start address SHLWAPI.dll!Ordinal505+0x37A. I think, TC may check on exit if some threads with this start address exist and ask user to kill them (or any threads started in SHLWAPI.dll if in different Windows versons this function is different).

User avatar
calios
Junior Member
Junior Member
Posts: 20
Joined: 2006-08-28, 08:18 UTC

Post by *calios » 2009-12-23, 02:18 UTC

as far as i know res IDs do not change for the window title - so this could be the way to detect it.

but tc could also attach the new thread to explorer.exe - assuming it has not been replaced with tc ;-)
for small problems: reboot your machine
for large problems: reinstall your machine

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37734
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2009-12-24, 16:49 UTC

Hmm, that start address is probably platfrom specific. How to get it anyway? NtQueryInformationThread?
Author of Total Commander
http://www.ghisler.com

User avatar
MVV
Power Member
Power Member
Posts: 8337
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2009-12-25, 07:06 UTC

ghisler(Author) wrote:Hmm, that start address is probably platfrom specific. How to get it anyway? NtQueryInformationThread?
I hadn't found another way to get it. So if you will call this function at run-time, it should work for Windows XP and later i.e. in most OS's.
I think that for all Windows versions start address for such thread will be always in SHLWAPI.dll - so if you get its instance and image size, you may check if address in this module.

Post Reply