require 'ffi' module Windows module Structs extend FFI::Library typedef :ulong, :dword class SERVICE_STATUS < FFI::Struct layout( :dwServiceType, :ulong, :dwCurrentState, :ulong, :dwControlsAccepted, :ulong, :dwWin32ExitCode, :ulong, :dwServiceSpecificExitCode, :ulong, :dwCheckPoint, :ulong, :dwWaitHint, :ulong ) end class SERVICE_STATUS_PROCESS < FFI::Struct layout( :dwServiceType, :dword, :dwCurrentState, :dword, :dwControlsAccepted, :dword, :dwWin32ExitCode, :dword, :dwServiceSpecificExitCode, :dword, :dwCheckPoint, :dword, :dwWaitHint, :dword, :dwProcessId, :dword, :dwServiceFlags, :dword ) end class SERVICE_DESCRIPTION < FFI::Struct layout(:lpDescription, :pointer) end class QUERY_SERVICE_CONFIG < FFI::Struct layout( :dwServiceType, :dword, :dwStartType, :dword, :dwErrorControl, :dword, :lpBinaryPathName, :pointer, :lpLoadOrderGroup, :pointer, :dwTagId, :dword, :lpDependencies, :pointer, :lpServiceStartName, :pointer, :lpDisplayName, :pointer ) end class SERVICE_STATUS_PROCESS < FFI::Struct layout( :dwServiceType, :dword, :dwCurrentState, :dword, :dwControlsAccepted, :dword, :dwWin32ExitCode, :dword, :dwServiceSpecificExitCode, :dword, :dwCheckPoint, :dword, :dwWaitHint, :dword, :dwProcessId, :dword, :dwServiceFlags, :dword ) end class ENUM_SERVICE_STATUS_PROCESS < FFI::Struct layout( :lpServiceName, :pointer, :lpDisplayName, :pointer, :ServiceStatusProcess, SERVICE_STATUS_PROCESS ) end class SC_ACTION < FFI::Struct layout(:Type, :int, :Delay, :dword) end class SERVICE_FAILURE_ACTIONS < FFI::Struct layout( :dwResetPeriod, :dword, :lpRebootMsg, :pointer, :lpCommand, :pointer, :cActions, :dword, :lpsaActions, :pointer # Array of SC_ACTION structs ) end class SERVICE_TABLE_ENTRY < FFI::Struct layout( :lpServiceName, :pointer, :lpServiceProc, :pointer ) end end end