fengye110 / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

crash in dokan.c DllMain case DLL_PROCESS_DETACH #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?

1. Run you FS from the Visual Studio debugger, then Stop the debugger
killing the FS.
2. Repeat, until adding dokan drive failed, then let it run normally
instead of stopping it, I'm seeing it crash on exit.

> What is the expected output? What do you see instead?

I expect it to exit without issue. It crashes out because of the line:

DokanUnmount(instance->DokanOptions->DriveLetter)

The DokanOptions pointer is no longer valid at this point. It's the address
of the DOKAN_OPTIONS I handed to DokanMain, which was on the stack.

A fix would be for PDOKAN_INSTANCE to have it's own copy of the
DOKAN_OPTIONS handed to DokanMain. Another fix would be for every exit of
DokanMain not to leave a instance in the instance list.

> What version of the product are you using? On what operating system?

XP revision 32 from SVN

I'm going to try both fixes above and report back.

Original issue reported on code.google.com by joe.a.bu...@gmail.com on 12 May 2009 at 2:42

GoogleCodeExporter commented 9 years ago
For me both fixes seam ok. The DokanMain clean exit I can't see causing anyone
issues, but maybe the DOKAN_OPTIONS copy will...

Original comment by joe.a.bu...@gmail.com on 12 May 2009 at 2:59

GoogleCodeExporter commented 9 years ago
Just to add a bit more. DokanMain is not being called from the main thread. 
Easy way
to reproduce this error is just to kill the thread which is in DokanMain and 
let the
app close down. I believe DokanMain should be able to be used on other threads.

Original comment by joe.a.bu...@gmail.com on 13 May 2009 at 7:35

GoogleCodeExporter commented 9 years ago
I fixed this issue by copying drive letter to DOKAN_INSTANCE.
Thanks!

http://code.google.com/p/dokan/source/detail?r=34

Original comment by asa...@gmail.com on 16 May 2009 at 8:24