Hello @Sidharthan Srinivasan ,
Thank you for reaching out.
Regarding the NetAdapterCreate() failing with STATUS_INVALID_PARAMETER (0xC000000D) inside your EvtWifiDeviceCreateAdapter callback. In the context of NetAdapterCx/WiFiCx, I've observed that this specific error code at this stage often suggests that the framework has evaluated the pre-configurations attached to the NETADAPTER_INIT pointer (or the WDF_OBJECT_ATTRIBUTES) and found a missing parameter or incorrectly sized structure.
You might want to review your EvtWifiDeviceCreateAdapter implementation against a few areas:
1. Datapath Callbacks Initialization
Before calling NetAdapterCreate, it typically requires the datapath callbacks (Tx/Rx queue creation) to be configured. If a NET_ADAPTER_DATAPATH_CALLBACKS structure is passed without its Size property being properly initialized, it could potentially throw a 0xC000000D.
It might be helpful to verify if you are using the _INIT macro. For example:
NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks;
// Ensure you use the _INIT macro to properly set the structure Size
NET_ADAPTER_DATAPATH_CALLBACKS_INIT(&datapathCallbacks,
EvtAdapterCreateTxQueue,
EvtAdapterCreateRxQueue);
NetAdapterInitSetDatapathCallbacks(AdapterInit, &datapathCallbacks);
2. WDF_OBJECT_ATTRIBUTES Initialization If you are attaching a context space to the adapter, it's worth double-checking that the attributes structure is initialized correctly inside the callback:
WDF_OBJECT_ATTRIBUTES adapterAttributes;
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, MY_ADAPTER_CONTEXT);
// Then pass &adapterAttributes to NetAdapterCreate
An uninitialized or incorrectly sized adapterAttributes might also lead to an Invalid Parameter error.
3. The AdapterInit Object
Just as a general reminder, since you are inside EvtWifiDeviceCreateAdapter, the PNETADAPTER_INIT AdapterInit parameter is handed to you by the framework. It's recommended to only use this provided object and not allocate a new one manually.
If you have already checked these and the issue persists, would it be possible to share a small snippet of the code inside your EvtWifiDeviceCreateAdapter function up to the point of failure? Seeing the code might help spot any missing configuration more easily.
Official References & Documentation: For further reference, you might find these official documents helpful for cross-checking your implementation:
- Writing a WiFiCx client driver (Overview): https://learn.microsoft.com/en-us/windows-hardware/drivers/netcx/writing-a-wificx-client-driver
- EVT_WIFI_DEVICE_CREATE_ADAPTER callback function: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wificx/nc-wificx-evt_wifi_device_create_adapter
- NetAdapterCreate function details: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/netadapter/nf-netadapter-netadaptercreate
- NetAdapterCx Device and Adapter Initialization: https://learn.microsoft.com/en-us/windows-hardware/drivers/netcx/device-and-adapter-initialization
I hope this points you in the right direction! If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.