Open kvojacheck opened 3 years ago
@kvojacheck What happens in following flow: app1 redirects the device and uses it, app2 opens the device and closes it? as pid == 0 means 'match all' will this stop the redirection?
Probably the proper thing is to use file context (WDFFILECONTEXT) instead of process identifier
@kvojacheck What happens in following flow: app1 redirects the device and uses it, app2 opens the device and closes it? as pid == 0 means 'match all' will this stop the redirection?
At the time app2 closes the device, the refcount is still 1 (since app1 is still using the device), therefore we would go to the PID-based identification as before: as the returned PID value by PsGetCurrentProcessId
is likely corresponds to app2 (and most likely not app1), the closure of app2 wouldn't cause the removal of the redirection.
Probably the proper thing is to use file context (WDFFILECONTEXT) instead of process identifier
Thank you for the tip, I will definitely look into this!
Proposed reference counting workaround to issue #105 Please kindly review, since I'm quite new to Windows driver developement.