It is not directly documented.
But from samples by Microsoft I can guess WdfControlFinishInitializing frees the init structure allocated by WdfControlDeviceInitAllocate.
Again, it is not in the doc for WdfControlDeviceInitAllocate but the sample at the end of the page shows the use of WdfDeviceInitFree in error cases to free the init structure.
But in success case there is no call to WdfDeviceInitFree so I guess WdfControlFinishInitializing does the job.
- Am I right about this?
- what happens in case I call WdfControlFinishInitializing and then WdfDeviceInitFree after that? Do I have to manually set the variable containing the return pointer from WdfControlDeviceInitAllocate to NULL to avoid WdfDeviceInitFree being called in error conditions after WdfControlFinishInitializing being called?