In the various solutions to getting open file handles you have the easy way all in user mode with nothing special; unfortunately it hangs on certain handles. one solution for that is to create a separate thread with timeout and force thread termination if doesn’t respond (rather not). The other is to have a driver use ObQueryNameString with the DeviceObject member of FILE_OBJECT (ok fine). The x86 app uses the system handle information and its Object member, which all looked to have been converted/thunked by WOW64, to provide the FILE_OBJECT (Object) pointer to the x64 driver via a DeviceIOControl request. But it appears that even the actual FILE_OBJECT structure itself has also been thunked (PFILE_OBJECT->DeviceObject)? So how can you get the x64 version of that FILE_OJBECT? Would it be okay to just also pull the device object pointer typecast to the pointer 32bit pointer size (DeviceObject sits right after two CSHORT member so could still use the PFILE_OBJECT->DeviceObject to reference it)
But considering x86 may not be able to get all handle information, would it just be better to move all the requests to the driver so x86 app will always get a full list of open handles? Or does the thunking actually handle the transitions of values that won’t fit in 32bit pointers/values by moving where it’s at?
TIA!!