gauravkr Posted August 28, 2009 Posted August 28, 2009 (edited) Hi,I am trying to programmatically set static IPs in a multi NIC multi IP setup (using C++) - 64bit Win2008 Standard Core installation.I am deploying WMI to do the same. However, the behaviour of enableStatic() is un-deterministic. I see that it successfully sets the IPs at times and fails to do the same in few other retry attempts; it fails with error 0x8004A024 = NETCFG_E_NO_WRITE_LOCK, which means some other application is holding the lock on the nic. I got to know of this as a known issue as listed in the KB article: KB950134. As suggested here I tried installing the hotfixes; but the only effect was frequency of this error coming up has reduced, but it is still erroring out. I also tried patching it to SP2 (note that this hotfix has gone into SP2), but even that did not help and am again getting the enableStatic failure with 0x8004A024. I even tried using INetCfg to find the status of Write lock when enableStatic() has failed using WMI and then releasing it, but this doesnt work either (I used INetCfgLock::IsWriteLocked() and then INetCfgLock::ReleaseWriteLock() but this does not seem to work. It is returning success but not able to release the lock). Does anyone have any suggestions on how to get over it? Is there any other way to handle the NETCFG_E_NO_WRITE_LOCK error caused by enableStatic? Any suggestions and pointers will be greatly appreciated. Thanks,~GK Edited August 28, 2009 by gauravkr
gauravkr Posted September 7, 2009 Author Posted September 7, 2009 Does anybody have any suggesttions? Any pointers on this is greatly appreciated.Thanks,~GK
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now