Re[2]: Multiple applications and only 1 piece of hardware

> Driver handling multiple opens is a good idea. I get different

handles for different Apps that issue CREATE on the device. OS will
take care of reference counting. In the other case where I share a
handle between applications, I will have to maintain reference count
on the handle and close the handle when the last app terminates.
Thats a over-head, I see.

I don’t think that is correct. I believe that under all methods
whereby one process can share a handle with another process the OS
will increase the reference count appropriately and all processes that
share the handle are required to close it.

Rob

> How about having a dll which contains a single global “HANDLE handle” across

multiple instances of applications using it. We can make one app create it
and all the apps use it.

DLL shared data is a bad idea. If one app will write junk there - then all apps
will be crashed.

The only proper ways of keeping the global data in Windows are a) service b)
kernel-mode binary.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com