I have allocated using ExAllocatePoolWithTag to allocate buffer from non
paged pool for reading data through the USB AV streaming device.
when the driver is streamng the data from the device, and when device is
suddenly removed, I check for the URB's status for NO DEVICE after IoCall
driver to the next device object.
The data recieved is buffered and processed and sent to the other layer.
during this time some time when the device is plugged out suddenly, it gives
ACCESS VIOLATION BSOD with 0x7E,
I am sure the allocated memory is not freed also, the accessed location is
not out of bounds of the allocated memory area. The address is not null.
Is there any way to check whether the address is valid.
This happens only when the device is plugged out. and during normal
operation, it works fine.
There are 2 possibilities:
Device present: during this time bulk transfer is done to read the data from
deivce into the buffer and is further sent to processing.
Device is removed: when a bulk transfer is attempted, it is programmed to
return STATUS_NO_SUCH_DEVICE such that the call is returned and the buffer
pointer is not sent for processing.
In both the case, how does it give access violation, as the buffer is
allocated and is not freed yet.
Can somebody let me know if any thing I am missing..
Thanks..