<div>Hi Jouni, </div>
<div> </div>
<div>I looked at the new version of ndis_events.c and the fix is exactly what I have expected. Thank you!</div>
<div> </div>
<div><span class="gmail_quote">On 9/6/06, <b class="gmail_sendername">Jouni Malinen</b> <<a href="mailto:jkmaline@cc.hut.fi">jkmaline@cc.hut.fi</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Tue, Sep 05, 2006 at 11:03:20AM +0300, Adrian Nistor wrote:<br><br>> The issue is with the CoInitializeSecurity() call in ndis_events.c. It is
<br>> done too many times during the lifetime of the wpa_supplicant process. MSDN<br>> says this call should be done only once during the lifetime of a process. A<br>> second call will fail with the error RPC_E_TOO_LATE. This is also visible in
<br>> the log you supplied, look for the line:<br>><br>> 1157393449.796875: CoInitializeSecurity() failed - returned<br>> 0x80010119 <----- aka RPC_E_TOO_LATE<br><br>> In ndis_events.c the static variable wmi_refcnt is used in order to avoid
<br>> doing initializations of COM and WMI code too many times. Still this is not<br>> enough to ensure correctness, because after you remove all interfaces the<br>> counter drops to 0 again and a subsequent add_interface will re-do all the
<br>> said initializations and call CoInitializeSecurity() again, which is wrong.<br>> It is ok to do the COM and WMI thing again, but not ok to re-do<br>> CoInitializeSecurity.<br><br>wmi_refcnt is used only to protect CoInitialize* part, not WMI setup.
<br>Anyway, it was allow CoInitializeSecurity() to be called multiple times.<br><br>> I suggest to add a new flag to indicate if CoInitializeSecurity() was<br>> called, apart from the already existing wmi_refcnt variable.
<br>> This small patch fixed the problem.<br>><br>> Jouni, could you add this to the dev branch? Thank you!<br><br>No patch included, but this was a trivial change, so I just added a new<br>variable to allow CoInitializeSecurity() to be called once. I have not
<br>tested this, but I'm assuming that it is still okay to call<br>CoUninitialize() follow by CoInitialize() and just skip<br>CoInitializeSecurity() in this case (e.g., when an adapter is removed<br>and added back).<br><br>
--<br>Jouni Malinen PGP id EFC895FA<br>_______________________________________________<br>HostAP mailing list<br><a href="mailto:HostAP@shmoo.com">HostAP@shmoo.com</a><br><a href="http://lists.shmoo.com/mailman/listinfo/hostap">
http://lists.shmoo.com/mailman/listinfo/hostap</a><br></blockquote></div><br>