So can ALL HANDLEs be shared? E.g., one created by CreateFile()?

Yes. The reason you would want to dup handles if sharing it in multiple threads is so that one thread could "close" the handle and get rid of it while allowing the other thread to continue to use it. So say you have a signal, you dup the handle across all the threads that want to use it and they can all wait on it. When they exit they just close thier dup handle, and the last handle that closes will actually cause the signal to get cleaned up / delted.



A DLL counts as the same process as an app, because it is mapped into the
application's address space - correct?

Yep.

What about an OCX? Same process, or not? Automation of a server embedded in
an EXE is clearly not the same process since it's a separate EXE... but I'm
wondering about a proper .OCX file?

Well technically IINM the exe still has a dll that gets mapped in that stubs out and passes the calls off to the "real" exe out of proc. And I believe the ocx is treated like the dll, it's mapped in.



_______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.

Reply via email to