Property Value change resriction in Co-installer

Hi All,

I’m writing a device-co-installer for my network device (for Win2K8 and above). I need to restrict the property value change when the user change is not valid on some scenarios based on the configuration. I’m not able to restrict the change and the co-installer proceeds with the change by setting the MTU value to 1600 in registry.
How do I restrict the change?

Please advice.

For eg., Lets say if the user changes the MTU value to 1600 (restrict MTU max value to 1500), then co-installer should pop-up a message that “MTU cannot exceed 1500” and set the value back to 1500. Eventually MTU value should not be changed.

Methods tried and its Output:
I could get the value in DIF_PROPERTYCHANGE code and i’m able to pop-up the error message, but couldn’t restrict the new value settings.

Steps in code:
1->Under DIF_PROPERTYCHANGE , I tried to get the device install params flag (using SetupDiGetDeviceInstallParams)
2->Modified the flag to dev_install_params.Flags | = DI_NODI_DEFAULTACTION
3->call SetupDISetDeviceInstallParams to update the Flag change
4->Return the error code ERROR_INVALID_DATA (also ERROR_CANCELLED).

But didn’t work.

I’m attaching the setupapi.log herefor your reference.

>> [DIF_PROPERTYCHANGE - PCI\VEN_1657&DEV_0014&SUBSYS_00151657&REV_01\4&2B5522ED&0&0220]
>> Section start 2010/10/11 12:52:50.116
12:52:50.116 cmd: “C:\Windows\system32\mmc.exe” “C:\Windows\system32\devmgmt.msc”
dvi: 12:52:50.116 CoInstaller 1: Enter
dvi: 12:52:50.116 CoInstaller 1: Exit
dvi: 12:52:50.116 CoInstaller 2: Enter
dvi: 12:52:50.116 CoInstaller 2: Exit
dvi: 12:52:50.116 CoInstaller 3: Enter
!!! dvi: 12:53:01.972 CoInstaller 3: failed(0x0000000d)!
!!! dvi: 12:53:01.972 Error 13: The data is invalid.
<<< Section end 2010/10/11 12:53:01.972
<<< [Exit status: FAILURE(0x0000000d)]

>> [DIF_DESTROYPRIVATEDATA - PCI\VEN_1657&DEV_0014&SUBSYS_00151657&REV_01\4&2B5522ED&0&0220]
>> Section start 2010/10/11 12:53:01.988
12:53:01.988 cmd: “C:\Windows\system32\mmc.exe” “C:\Windows\system32\devmgmt.msc”
dvi: 12:53:01.988 CoInstaller 1: Enter
dvi: 12:53:01.988 CoInstaller 1: Exit
dvi: 12:53:01.988 CoInstaller 2: Enter
dvi: 12:53:01.988 CoInstaller 2: Exit
dvi: 12:53:01.988 CoInstaller 3: Enter
dvi: 12:53:01.988 CoInstaller 3: Exit
dvi: 12:53:01.988 Class installer: Enter
dvi: 12:53:01.988 Class installer: Exit
<<< Section end 2010/10/11 12:53:01.988
<<< [Exit status: SUCCESS]

Any help is appreciated.

Thanks in advance
Satheesh

Hi,

Is it ndis miniport driver? Why not just to put these values in INF file and read them from the driver (from the registry, see NdisOpenConfiguration and NdisReadConfiguration in msdn)?

If all your co-installer should do is to update these values, you might not implement it at all in this case.

S.

Yes it is NDIS miniport driver.

Actually we have MUX (VLAN and TEAM) driver on top. So based on the
configuration whether the miniport instance has VLANs or not, the change in
the advanced settings has to be restricted. Miniport driver doesn’t know
about the MUX (VLAN) configuration.So the requirement is to restrict
property change for that particular miniport instance.
This can be achieved thru the co-installer, isn’t it?

FYI, Co-installer has to read the configuration in DIF_PROPERTYCHANGE and
should restrict if necessary.

Thanks
Satheesh

On Tue, Oct 12, 2010 at 12:48 AM, wrote:

> Hi,
>
> Is it ndis miniport driver? Why not just to put these values in INF file
> and read them from the driver (from the registry, see NdisOpenConfiguration
> and NdisReadConfiguration in msdn)?
>
> If all your co-installer should do is to update these values, you might not
> implement it at all in this case.
>
> S.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

So what actually occurs? does the miniport read the wrong parameter value, after the coinstaller modifies it in the registry? Does the miniport restart? Does displaying the popup from the coinstaller work?
– pa