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