-
Notifications
You must be signed in to change notification settings - Fork 0
/
lua_windows.go
36 lines (30 loc) · 1000 Bytes
/
lua_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package logon
import (
"github.com/vela-ssoc/vela-kit/lua"
)
const (
//"*[System[(EventID=4624) and TimeCreated[timediff(@SystemTime) <= 2592000000]]]
//query "*[System[(EventID=4624) and TimeCreated[timediff(@SystemTime) <= 3600000]]]
SuccessQuery = "*[System[(EventID=4624) and TimeCreated[timediff(@SystemTime) <= 10368000000]]]"
FailQuery = "*[System[(EventID=4625) and TimeCreated[timediff(@SystemTime) <= 10368000000]]]"
LogoutQuery = "*[System[(EventID=4634) and TimeCreated[timediff(@SystemTime) <= 10368000000]]]"
)
func helpL(L *lua.LState, class, query string) int {
m := newMonitor(L, class, query)
proc := L.NewVelaData(m.Name(), typeof)
proc.Set(m)
L.Push(proc)
return 1
}
func newLogonFailL(L *lua.LState) int {
return helpL(L, Fail, FailQuery)
}
func newLogonSuccessL(L *lua.LState) int {
return helpL(L, SUCCESS, SuccessQuery)
}
func newLogoutL(L *lua.LState) int {
return helpL(L, Logout, LogoutQuery)
}
func newLogonL(L *lua.LState) int {
return 0
}