Module: Windows::EventLog

Defined in:
lib/windows/eventlog.rb

Constant Summary collapse

EVENTLOG_SEQUENTIAL_READ =
0x0001
EVENTLOG_SEEK_READ =
0x0002
EVENTLOG_FORWARDS_READ =
0x0004
EVENTLOG_BACKWARDS_READ =
0x0008
EVENTLOG_SUCCESS =
0x0000
EVENTLOG_ERROR_TYPE =
0x0001
EVENTLOG_WARNING_TYPE =
0x0002
EVENTLOG_INFORMATION_TYPE =
0x0004
EVENTLOG_AUDIT_SUCCESS =
0x0008
EVENTLOG_AUDIT_FAILURE =
0x0010
EVENTLOG_FULL_INFO =
0
BackupEventLog =
Win32API.new('advapi32', 'BackupEventLog', 'LP', 'I')
BackupEventLogW =
Win32API.new('advapi32', 'BackupEventLogW', 'LP', 'I')
ClearEventLog =
Win32API.new('advapi32', 'ClearEventLog', 'LP', 'I')
ClearEventLogW =
Win32API.new('advapi32', 'ClearEventLogW', 'LP', 'I')
CloseEventLog =
Win32API.new('advapi32', 'CloseEventLog', 'L', 'I')
DeregisterEventSource =
Win32API.new('advapi32', 'DeregisterEventSource', 'L', 'I')
GetEventLogInformation =
Win32API.new('advapi32', 'GetEventLogInformation', 'LLPLP', 'I')
GetNumberOfEventLogRecords =
Win32API.new('advapi32', 'GetNumberOfEventLogRecords', 'LP', 'I')
GetOldestEventLogRecord =
Win32API.new('advapi32', 'GetOldestEventLogRecord', 'LP', 'I')
NotifyChangeEventLog =
Win32API.new('advapi32', 'NotifyChangeEventLog', 'LL', 'I')
OpenBackupEventLog =
Win32API.new('advapi32', 'OpenBackupEventLog', 'PP', 'L')
OpenBackupEventLogW =
Win32API.new('advapi32', 'OpenBackupEventLogW', 'PP', 'L')
OpenEventLog =
Win32API.new('advapi32', 'OpenEventLog', 'PP', 'L')
OpenEventLogW =
Win32API.new('advapi32', 'OpenEventLogW', 'PP', 'L')
ReadEventLog =
Win32API.new('advapi32', 'ReadEventLog', 'LLLPLPP', 'I')
ReadEventLogW =
Win32API.new('advapi32', 'ReadEventLogW', 'LLLPLPP', 'I')
RegisterEventSource =
Win32API.new('advapi32', 'RegisterEventSource', 'PP', 'L')
RegisterEventSourceW =
Win32API.new('advapi32', 'RegisterEventSourceW', 'PP', 'L')
ReportEvent =
Win32API.new('advapi32', 'ReportEvent', 'LIILPILPP', 'I')
ReportEventW =
Win32API.new('advapi32', 'ReportEventW', 'LIILPILPP', 'I')

Instance Method Summary collapse

Instance Method Details

#BackupEventLog(handle, file) ⇒ Object



40
41
42
# File 'lib/windows/eventlog.rb', line 40

def BackupEventLog(handle, file)
   BackupEventLog.call(handle, file) != 0
end

#BackupEventLogW(handle, file) ⇒ Object



44
45
46
# File 'lib/windows/eventlog.rb', line 44

def BackupEventLogW(handle, file)
   BackupEventLogW.call(handle, file) != 0
end

#ClearEventLog(handle, file = 0) ⇒ Object



48
49
50
# File 'lib/windows/eventlog.rb', line 48

def ClearEventLog(handle, file = 0)
   ClearEventLog.call(handle, file) != 0
end

#ClearEventLogW(handle, file = 0) ⇒ Object



52
53
54
# File 'lib/windows/eventlog.rb', line 52

def ClearEventLogW(handle, file = 0)
   ClearEventLogW.call(handle, file) != 0
end

#CloseEventLog(handle) ⇒ Object



56
57
58
# File 'lib/windows/eventlog.rb', line 56

def CloseEventLog(handle)
   CloseEventLog.call(handle) != 0
end

#DeregisterEventSource(handle) ⇒ Object



60
61
62
# File 'lib/windows/eventlog.rb', line 60

def DeregisterEventSource(handle)
   DeregisterEventSource.call(handle) != 0
end

#GetEventLogInformation(handle, level, buf, buf_size, bytes) ⇒ Object



64
65
66
# File 'lib/windows/eventlog.rb', line 64

def GetEventLogInformation(handle, level, buf, buf_size, bytes)
   GetEventLogInformation.call(handle, level, buf, buf_size, bytes) != 0
end

#GetNumberOfEventLogRecords(handle, num) ⇒ Object



68
69
70
# File 'lib/windows/eventlog.rb', line 68

def GetNumberOfEventLogRecords(handle, num)
   GetNumberOfEventLogRecords.call(handle, num) != 0
end

#GetOldestEventLogRecord(handle, rec) ⇒ Object



72
73
74
# File 'lib/windows/eventlog.rb', line 72

def GetOldestEventLogRecord(handle, rec)
   GetOldestEventLogRecord.call(handle, rec) != 0
end

#NotifyChangeEventLog(handle, event) ⇒ Object



76
77
78
# File 'lib/windows/eventlog.rb', line 76

def NotifyChangeEventLog(handle, event)
   NotifyChangeEventLog.call(handle, event) != 0
end

#OpenBackupEventLog(server, file) ⇒ Object



80
81
82
# File 'lib/windows/eventlog.rb', line 80

def OpenBackupEventLog(server, file)
   OpenBackupEventLog.call(server, file)
end

#OpenBackupEventLogW(server, file) ⇒ Object



84
85
86
# File 'lib/windows/eventlog.rb', line 84

def OpenBackupEventLogW(server, file)
   OpenBackupEventLogW.call(server, file)
end

#OpenEventLog(server, source) ⇒ Object



88
89
90
# File 'lib/windows/eventlog.rb', line 88

def OpenEventLog(server, source)
   OpenEventLog.call(server, source)
end

#OpenEventLogW(server, source) ⇒ Object



92
93
94
# File 'lib/windows/eventlog.rb', line 92

def OpenEventLogW(server, source)
   OpenEventLogW.call(server, source)
end

#ReadEventLog(handle, flags, offset, buf, bytes, bytes_read, min_bytes) ⇒ Object



96
97
98
# File 'lib/windows/eventlog.rb', line 96

def ReadEventLog(handle, flags, offset, buf, bytes, bytes_read, min_bytes)
   ReadEventLog.call(handle, flags, offset, buf, bytes, bytes_read, min_bytes) != 0
end

#ReadEventLogW(handle, flags, offset, buf, bytes, bytes_read, min_bytes) ⇒ Object



100
101
102
# File 'lib/windows/eventlog.rb', line 100

def ReadEventLogW(handle, flags, offset, buf, bytes, bytes_read, min_bytes)
   ReadEventLogW.call(handle, flags, offset, buf, bytes, bytes_read, min_bytes) != 0
end

#RegisterEventSource(server, source) ⇒ Object



104
105
106
# File 'lib/windows/eventlog.rb', line 104

def RegisterEventSource(server, source)
   RegisterEventSource.call(server, source)
end

#RegisterEventSourceW(server, source) ⇒ Object



108
109
110
# File 'lib/windows/eventlog.rb', line 108

def RegisterEventSourceW(server, source)
   RegisterEventSourceW.call(server, source)
end

#ReportEvent(handle, type, cat, id, sid, num, size, strings, raw) ⇒ Object



112
113
114
# File 'lib/windows/eventlog.rb', line 112

def ReportEvent(handle, type, cat, id, sid, num, size, strings, raw)
   ReportEvent.call(handle, type, cat, id, sid, num, size, strings, raw) != 0
end

#ReportEventW(handle, type, cat, id, sid, num, size, strings, raw) ⇒ Object



116
117
118
# File 'lib/windows/eventlog.rb', line 116

def ReportEventW(handle, type, cat, id, sid, num, size, strings, raw)
   ReportEventW.call(handle, type, cat, id, sid, num, size, strings, raw) != 0
end