Hi all,
The function prototype of IoAttachDevice is declared as follows in the
DDK documentation.
/*********************************/
NTSTATUS
IoAttachDevice(
IN PDEVICE_OBJECT SourceDevice,
IN PUNICODE_STRING TargetDevice,
OUT PDEVICE_OBJECT *AttachedDevice
);
Parameters
SourceDevice
Pointer to the caller-created device object.
TargetDevice
Pointer to a buffer containing the name of the device object to which
the specified SourceDevice is to be attached.
AttachedDevice
Pointer to caller-allocated storage for a pointer. On return, contains
a pointer to the target device object if the attachment succeeds.
/*********************************/
According to the statement above, AttachedDevice should point to a
lower device, i.e the target device. However, in English, if an upper
device is attached to a lower device, then the upper device, rather
than the lower device, should be called "attached device". So, the
last paramenter should be named DeviceAttachedTo or something like
this.
I'm not a native English speaker. I eagerly hope those who speak
English can give me some tips.