title: VMware VIX API FindItems() method never returns when querying for registered VMs
body: <p>I am using VMware Workstation 6.5 on Windows Vista x64.
  I am trying to write some C# code that uses VMware Vix v1.6.1 COM API to get a list of registered virtual machines.</p>
  
  <p>The code I am using is as follows:</p>
  
  <pre><code>using System;
  using VixCOM;
  
  namespace ConsoleApplication48
  {
      internal class Program
      {
          private static void Main()
          {
              var lib = new VixLibClass();
              object results = null;
  
              var job = lib.Connect(Constants.VIX_API_VERSION, Constants.VIX_SERVICEPROVIDER_VMWARE_WORKSTATION, null, 0,
  null, null, 0, null, null);
  
              var err = job.Wait(new[] {Constants.VIX_PROPERTY_JOB_RESULT_HANDLE}, ref results);
  
          if (lib.ErrorIndicatesFailure(err))
              Console.WriteLine("Error: " + err);
  
          var host = (IHost)((object[])results)[0];
  
          job = host.FindItems(Constants.VIX_FIND_REGISTERED_VMS, null, -1, new DiscoveryCallback(lib));
          job.WaitWithoutResults();
  
          host.Disconnect();
      }
  }
  
  internal class DiscoveryCallback : ICallback
  {
      protected VixLibClass lib;
  
      public DiscoveryCallback(VixLibClass lib)
      {
          this.lib = lib;
      }
  
      #region ICallback Members
  
      public void OnVixEvent(IJob job, int eventType, IVixHandle moreEventInfo)
      {
          // this method is never called
      }
  
      #endregion
      }
  }
  </code></pre>
  
  <p>I am aware that the COM dll is 32-bit, so I made sure that the test application is compiled as 32-bit.
  Also I made sure that all VMware services are running.</p>
  
  <p>There are no exceptions thrown, no errors returned (as far as I can see) and no events written into the event log.</p>
  
  <p>Strangely enough the above code works when I try to get a list of running VMs using constant VIX_FIND_RUNNING_VMS.</p>
  
  <p>Any ideas on what might be causing this?</p>
  
  <p>Thanks,</p>
  
  <p>Arnie</p>