****NOTE****This is all pseudo code to express a given situation****
I want to create have 4 symbolic links and 4 devices (channels) for each
entry to AddDevice…
* 2 Call to AddDevice = 4 IoCreateDevice calls, 4 IoCreateSymbolicLink
calls
* 2 Calls to AddDevice = 8 IoCreateDevice calls, 8 IoCreateSymbolicLink
calls
Let’s say I have 2 pysical PCI cards in the system:
I want to call IoCreateDevice 8 times (4 per card) in a for loop
** Format is MyDevice[card number]_[channel number] **
What happens that when My DeviceControl function and all other funtions are
called the PDEVICE_OBJECT (fdo)
that is passed into the function is always the FDO of the last
IoCreateDevice call, regardless of the Symbolic link name given
to CreateFile and registered to the FDO?
See below for more info…
Any help would be great!
Regards,
Mike
Here are the device names for each IoCreateDevice…
note, I supply the same PDO, but save each off each FDO returned (which are
different)
/* PCI card 0 */
\Device\MyDevice0_0 /* Channel 0 */
\Device\MyDevice0_1 /* Channel 1 */
\Device\MyDevice0_2 /* Channel 2 */
\Device\MyDevice0_3 /* Channel 3 */
/* PCI card 1 */
\Device\MyDevice1_0 /* Channel 0 */
\Device\MyDevice1_1 /* Channel 1*/
\Device\MyDevice1_1 /* Channel 2 */
\Device\MyDevice1_1 /* Channel 3 */
Then, I create the sym links
/* PCI Card 0 */
IoCreateSymbolicLink(“\MyDeviceName0_0”,“\Device\MyDevice0_0)
IoCreateSymbolicLink(”\MyDeviceName0_0",“\Device\MyDevice0_0)
IoCreateSymbolicLink(”\MyDeviceName0_0",“\Device\MyDevice0_0)
IoCreateSymbolicLink(”\MyDeviceName0_0","\Device\MyDevice0_0)
/* PCI Card 1 */
IoCreateSymbolicLink(“\MyDeviceName0_0”,“\Device\MyDevice0_0)
IoCreateSymbolicLink(”\MyDeviceName0_0",“\Device\MyDevice0_0)
IoCreateSymbolicLink(”\MyDeviceName0_0",“\Device\MyDevice0_0)
IoCreateSymbolicLink(”\MyDeviceName0_0","\Device\MyDevice0_0)
“This message may contain company proprietary information. If you are not
the intended recipient, any disclosure, copying, distribution or reliance on
the contents of this message is prohibited. If you received this message in
error, please delete and notify me.”