Home > other >  Driver to read the data file
Driver to read the data file

Time:10-04

Simulates a USB device, a moment can be considered as U disk, the data stored in a device, file, driver installation is complete will create a data file, one computer can install more such devices,

Problem: each device has its own data file, how to make the second, third device to create a data file, do not conflict with the first, it does not read error after reading,

CodePudding user response:

If it is a real USB devices, data is equipment, restart your computer, data is not lost, I now is by driving virtual device, data cannot be always in memory, save changes each time data is written to the file,

CodePudding user response:

If it is real U disk device, insert in turn, will be in accordance with the accumulation of thoughts in turn is assigned sda, SDB, SDC... Sdaa,
So if two identical U disk, finally to distinguish the is done by UUID

If it is a virtual device, then the data save file actually can also see a similar idea, to create their corresponding file:
1. If the simple rely on load order, then after load order messed up when a file with the situation of the equipment
2. The equipment load is depend on the custom fake equipment resources, then the definition of hardware resources are consistent, if you load the equipment all information is consistent, in fact, there is no distinction between the concept of, if not, when creating file, should add the information to distinguish

CodePudding user response:

refer to the second floor melo_fang response:
if it is true of usb devices, inserted in turn, will be in accordance with the accumulation of thoughts in turn is assigned sda, SDB, SDC... Sdaa,
So if two identical U disk, finally to distinguish the is done by UUID

If it is a virtual device, then the data save file actually can also see a similar idea, to create their corresponding file:
1. If the simple rely on load order, then after load order messed up when a file with the situation of the equipment
2. The equipment load is depend on the custom fake equipment resources, then the definition of hardware resources are consistent, if you load the equipment all information is consistent, in fact, there is no distinction between the concept of, if not, when creating file, should add the information to distinguish


I want to after the driver installed for the device power path, this didn't install a USB device, it is not the same, so as to create a data file is a basis, I don't know can?

CodePudding user response:

My driver is registered HidRegisterMinidriver micro driver, use the IoGetDeviceObjectPointer returns failure,

Is there any way in the current driver code access to the specific value of the current equipment? Such as hardware id.

CodePudding user response:

Device instance path which function used in the driver code can get?
  • Related