Maximus5 / conemu-inside

An example, how to embed http://conemu.github.io/ into another graphical application
57 stars 43 forks source link

ConEmu Inside HWND Crashes Within Startup If the Parent Process Revokes HWND #4

Open hypersw opened 8 years ago

hypersw commented 8 years ago

=>

ConEmu asserts with

Can't create DC window!
LastError=0x00000057
The parameter is incorrect.
Maximus5 commented 8 years ago

151217?

hypersw commented 8 years ago

untitled20151227071212

untitled20151227071251

So no.

Maximus5 commented 8 years ago

Revokes?

hypersw commented 8 years ago

Destroys, or whatever. So HWND is available and valid when ConEmu gets it on the commandline, but when it tries to use this HWND, it's already gone. I guess that's the cause.

I believe what ConEmu does with HWNDs makes its and host process' threads of execution make sync cross-calls sometimes, which means that ConEmu will be waiting for the host process callback to execute. This increases the risk, as it gives the host process an explicit chance to do smth to its HWND (and waits for it).

hypersw commented 8 years ago

Simple repro: run conemu-inside in debugger, set a breakpoint on after starting the ConEmu process, break on it, then kill the debuggee.

Maximus5 commented 8 years ago

https://conemu.github.io/blog/2016/02/02/Build-160202.html

hypersw commented 8 years ago

untitled20160213164109

On a fresh build. Though looks like a new message (on some next init stage).

Repro is the same: in ConEmuSession::.ctor, after processNew.Start(), kill the WinForms-hosting process. ConEmu process is left alone in some half-inited state.

Maximus5 commented 8 years ago

Is it fixed?

hypersw commented 8 years ago

Not fully. I would still see this window from time to time, rarely now though.

hypersw commented 8 years ago

untitled20160518034812 fresh one