Home All Groups Group Topic Archive Search About

Hangs indefinitely at first call to object of IWbemServices (In case of dll) WIN 2000

Author
2 Aug 2006 10:22 AM
shreshth.luthra
Hi All,

I am trying to get notification for MSNdis_NotifyAdapterRemoval so that



i am notified every time a LAN connection is disabled in my Windows
2000 machine. I found some piece of code in MSDN at:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmis...



In this code i changed the WQL query to "SELECT * FROM
MSNdis_NotifyAdapterRemoval" and tried to build a console application.
which worked just fine.


later on I created a Win32 application with same piece of code and it
worked fine too.
but when i used the same piece of code to build a Win32 dll. and tried
to load this dll in a Win 32 application it hanged. debugging this
application shows that following call never returns from inside the
dll. but to my surprize the same worked just fine in WinXP Pro.


pUnsecApp->CreateObjectStub(pSink, &pStubUnk);


Actually i have verified that it hangs on first access to pSink. like
if i use pSink before this call then it hangs on that particular point
only.


Regards,
Shreshth

Author
2 Aug 2006 2:54 PM
Arkady Frenkel
In all the set of NGs , you missed correct one :
microsoft.public.win32.programmer.wmi

Arkady

<shreshth.lut***@gmail.com> wrote in message
Show quoteHide quote
news:1154514173.269156.118420@s13g2000cwa.googlegroups.com...
> Hi All,
>
> I am trying to get notification for MSNdis_NotifyAdapterRemoval so that
>
>
>
> i am notified every time a LAN connection is disabled in my Windows
> 2000 machine. I found some piece of code in MSDN at:
>
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmis...
>
>
>
> In this code i changed the WQL query to "SELECT * FROM
> MSNdis_NotifyAdapterRemoval" and tried to build a console application.
> which worked just fine.
>
>
> later on I created a Win32 application with same piece of code and it
> worked fine too.
> but when i used the same piece of code to build a Win32 dll. and tried
> to load this dll in a Win 32 application it hanged. debugging this
> application shows that following call never returns from inside the
> dll. but to my surprize the same worked just fine in WinXP Pro.
>
>
> pUnsecApp->CreateObjectStub(pSink, &pStubUnk);
>
>
> Actually i have verified that it hangs on first access to pSink. like
> if i use pSink before this call then it hangs on that particular point
> only.
>
>
> Regards,
> Shreshth
>