Hi All,
I am a little unclear about the operation of IoRegisterPlugPlayNotification function and how it behaves. The API takes input
- DriverObject that implements the "CallBack"
- The "CallBack" Function
- a "Context" which is passed to the "CallBack" when invoked.
For a function driver the FDO is created in AddDevice and when the driver is ready for handling the PNP notifications, it will call IoRegisterPlugPlayNotification with the pointer to Device Extension which is valid for the FDO.
The Scenario:-
For a multiple controller on a server the AddDevice will be called multiple times. So there will be multiple FDOs and IoRegisterPlugPlayNotification will be called multiple times, each invocation with its own DeviceExtension pointer. But all the invocations will have the SAME DriverObject.
Questions:-
- When I call IoRegisterPlugPlayNotification multiple times with same driver object, same callback function but different context will the registration work? Will the callback get invoked with the context I specified?
My understanding it that it should work for multiple registrations because the API returns a PVOID which is the handle to the registration. But I can be wrong.
Thanks
Aj