Virtual miniport init using NdisIMInitializeDeviceInstanceEx

Hi all,
I want to use a registry data DataX constructed out of the virtual miniport
device NetCfgInstanceId while calling NdisIMInitializeDeviceInstanceEx from
protocol driver’s BindAdapterHandlerEx(). This is my requirement

I am trying to create a virtual miniport instance with the following steps,

  1. Appln creating a dev info set with SetupDiCreateDeviceInfo under Net
    class
  2. NetCfgInstanceId is created only when a driver is assosciated with the
    above device. Therefore, appl installs the driver for the device
    using UpdateDriverForPlugAndPlayDevicesProto. But this causes
    protocol’s BindAdapterHandlerEx() getting called.
  3. BindAdapterHandlerEx() fails as it tries to read DataX
  4. Appln after finding NetCfgInstanceID, constructs DataX and writes it to
    registry

Even though subsequent BindAdapterHandlerEx passes after registry write of
DataX, what is a better way to do this? Am i doing/assuming something wrong
here?