Sometimes you may need to install a newer version of a provider onto a running system. If your provider is installed as a DLL, you can install a new provider without having to restart the service, reboot the computer, or otherwise affect any applications using WMI at that time.
The following procedure describes how to update a provider.
To update a provider
- Build the new provider.
- Compile the new provider with a different DLL name and a different CLSID.
For example, change Myprov.dll to Myprov1.dll, and CLSID_MyProProv to CLSID_MyProv1.
- Modify the provider registration MOF file to use the new CLSID (CLSID_MyProv1), but the same provider name ("MyProv").
- Install the new provider.
- Copy the new provider DLL with the new name alongside the old one.
- Self-register the new provider.
For example, use the regsvr32 myprov1.dll command to register the new provider.
- Compile the new provider registration MOF, thus overwriting the old provider registration. Until this point, the old provider was fully functional; now the new provider is fully operational.
- Remove the old version of the provider, if necessary.
- Unregister the old DLL.
For example, use the regsvr32 /umyprov.dll command to unregister the old DLL.
- Mark the old DLL to be deleted on reboot by calling MoveFileEx.
You can take similar steps to upgrade a local server-implemented provider.
See Also
- Developing a WMI Provider
- Setting Namepace Security Descriptors
- Securing Your Provider
Send comments about this topic to Microsoft
Build date: 11/3/2009