i of wmi queries asnyc , normally, have no problem them. setup manangementscope privileges , necessary dcom security [for remote queries]. little shorted snippet of whole code this:
managementpath mp = new managementpath(); mp.namespacepath = @"\root\cimv2"; mp.server = computername; this.ms = new managementscope(mp, co); //privs + dcom [outside] this.ms.connect(); eventquery eq = new eventquery(query); managementeventwatcher mew = new managementeventwatcher(this.ms, eq); mew.eventarrived += new eventarrivedeventhandler(this.oneventarrived); mew.stopped += new stoppedeventhandler(this.onstopped); mew.start();
as mentioned, have problem this, :-( class queryed 'win32_localtime' , query starts, not give events. in wbemtest, works !
this query:
select * __instancemodificationevent targetinstance isa 'win32_localtime'
one thing, see is, class singleton , have use special syntax specify singleton class in query, cannot figure out.
additionally, tried 1 async query powershell , worked. then, used ps query 'win32_localtime' , not work !!
a tip, hint or pointer further information great!
thanks far , best regards
++mabra
problem solved , "accidentally" .... ;-)
the problem in eventhandler. in that, accessing newevent.systemproperties["server"] null , thread dies without notice.
astounding, how many situation seeing, threads die without notice [i had same thing system.timers.timer , after debate, ms said, not change behavior :-( ].
until used show query, meant little "event diagnoser", have never seen systemproperties.server beeing empty :-(
i'll change code now.
anyway, best regards !
++mabra
Comments
Post a Comment