Re[3]: Проблемы с передачей параметров в драйвер!
От: MShura  
Дата: 06.11.08 20:26
Оценка:
MS>>Как описан IOCTL_TEST_SMTH?

I>#define IOCTL_TEST_SMTH CTL_CODE(FILE_DEVICE_UNKNOWN, 0x703, METHOD_BUFFERED, FILE_ANY_ACCESS)


METHOD_BUFFERED
For this transfer type, IRPs supply a pointer to a buffer at Irp->AssociatedIrp.SystemBuffer. This buffer represents both the input buffer and the output buffer that are specified in calls to DeviceIoControl and IoBuildDeviceIoControlRequest. The driver transfers data out of, and then into, this buffer.
For input data, the buffer size is specified by Parameters.DeviceIoControl.InputBufferLength in the driver's IO_STACK_LOCATION structure. For output data, the buffer size is specified by Parameters.DeviceIoControl.OutputBufferLength in the driver's IO_STACK_LOCATION structure.

The size of the space that the system allocates for the single input/output buffer is the larger of the two length values.


Сначало читаем из Irp->AssociatedIrp.SystemBuffer. Это входные данные. В твоем случае их размер 0.
Затем пишем в Irp->AssociatedIrp.SystemBuffer. Это выходные данные. В твоем случае их размер 512.

I>я просто не знаю какая длинна у ioBuffer и как её можно узнать-) Но думаю наверно это не из-за этого или я не прав? Тогда как получить длину? Заранее спасибо!


В приведенном коде длина вообще не учитывается. В ячейку 0xC8000 записывается младшее значение указателя Irp->AssociatedIrp.SystemBuffer.
Догадываюсь, что это не то, что задумывалось. А что задумывалось не пойму.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.