StorportGetUncachedExtension Fails to Allocate Memory
I am working on a storport-miniport driver.
I need to allocate approximately 132KB of memory via StorportGetUncachedExtension in my FindAdapter Function.
I have 32 devices connected to a Windows 10 x64 System. 32 driver instances try to load and memory allocation is successful for 15-18 devices. After that for the rest devices, StorportGetUncachedExtension returns NULL.
However if I reduce the size to 4KB, the StorportGetUncachedExtension results in successive allocation for all devices. But, after 15-18 devices, rest devices show a yellow bang in device manager with the error code as " The device Cannot Start (Code 10). { Not enough Quota } Not enough virtual memory or paging file quota is available to complete the specified operation ".
From further debugging i can see that HWInitialize function is successful but immediately Storport is calling AdapterControl function with controlType as SCSIStopAdapter.
System Memory Statistics:
Total RAM - 32GB RAM
In Use - 4GB
Available Memory - 25.8GB
Virtual Memory Paging Size - 16GB
Device:
Only BAR 0 is exposed. BAR Size is 32KB.
I request help in understanding what might be the issue.