c# 4.0 - How to guarantee exclusive access when modifying network adapter properties -


i using wmi's win32_networkadapterconfiguration class, enablestatic method set static ips of loopback network adapter testing. noticed os takes out lock when there's visible property sheet. when user dismisses sheet changes, things freeze until update has completed.

how can ensure exclusive access between program in c# , windows ui?

i think enablestatic method of win32_networkadapterconfiguration class acquires exclusive lock change network adapter settings. microsoft knowledge base article lead me conclusion microsoft kb. there com interface called inetcfglock use acquire exclusive lock changing network adapter settings. acquire lock use inetcfglock::acquirewritelock method.

begin edit:

here link project on codeproject shows use of inetcfglock com interface , inetcfglock::acquirewritelock in c#.

end edit

hope, helps.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -