none
WMI Event Query hangs on ManagementEventWatcher.Start() RRS feed

  • Question

  • I have a working install of WES7 that hangs when executing the following code:

     

          try
          {
            ManagementEventWatcher driveInsertionEvent = new ManagementEventWatcher("Select * From __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'WIN32_LogicalDisk' AND TargetInstance.DriveType=2");
            driveInsertionEvent.EventArrived += new EventArrivedEventHandler(driveInsertionEvent_EventArrived);
            driveInsertionEvent.Start();
          }
          catch
          {
          }
    
    

    The image includes the WMI feature from FeaturePack\Management\System Management folder of the DS.  Any clues? Am I missing any other FeaturePacks? BTW, Start() also hangs for these two queries as well.

            ManagementEventWatcher driveRemovalEvent = new ManagementEventWatcher("Select * From __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA 'WIN32_LogicalDisk' AND TargetInstance.DriveType=2");
    
    
            WqlEventQuery suspendEvent = new WqlEventQuery("Win32_PowerManagementEvent");
            ManagementEventWatcher suspendWatcher = new ManagementEventWatcher(suspendEvent);
    
    
    Any help is appreciated.

     

    Saturday, April 30, 2011 10:30 PM

Answers

  • Try adding everything under the 'FeaturePack\Management'. Power management is under that as well as event management.
    Brent
    • Marked as answer by GCoder Saturday, December 10, 2011 10:18 PM
    Wednesday, May 18, 2011 5:29 PM

All replies

  • Can anyone shed some light on this problem? If the question is poorly phrased or more info is needed, please let me know.

     

    G

    Wednesday, May 18, 2011 4:40 PM
  • Try adding everything under the 'FeaturePack\Management'. Power management is under that as well as event management.
    Brent
    • Marked as answer by GCoder Saturday, December 10, 2011 10:18 PM
    Wednesday, May 18, 2011 5:29 PM