Method: Win32::TaskScheduler#trigger_count

Defined in:
lib/puppet/util/windows/taskscheduler.rb

#trigger_countObject

Returns the number of triggers associated with the active task.

Raises:



595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/puppet/util/windows/taskscheduler.rb', line 595

def trigger_count
  raise Error.new('No current task scheduler. ITaskScheduler is NULL.') if @pITS.nil?
  raise Error.new('No currently active task. ITask is NULL.') if @pITask.nil?

  count = 0

  FFI::MemoryPointer.new(:word, 1) do |ptr|
    @pITask.GetTriggerCount(ptr)
    count = ptr.read_word
  end

  count
end