Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eventlog methods definitions #1017

Open
wants to merge 1 commit into
base: 0.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 79 additions & 15 deletions src/um/winbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ pub type LPLDT_ENTRY = LPVOID; // TODO - fix this for 32-bit
// DATABITS_*
// STOPBITS_*
// PARITY_*
pub const EVENTLOG_FULL_INFO: DWORD = 0;
STRUCT!{struct EVENTLOG_FULL_INFORMATION {
dwFull: DWORD,
}}
pub type LPEVENTLOG_FULL_INFORMATION = *mut EVENTLOG_FULL_INFORMATION;
STRUCT!{struct COMMPROP {
wPacketLength: WORD,
wPacketVersion: WORD,
Expand Down Expand Up @@ -2007,19 +2012,48 @@ extern "system" {
lpTransferSize: LPDWORD,
lpNumOutstandingRequests: LPDWORD,
) -> BOOL;
// pub fn ClearEventLogA();
// pub fn ClearEventLogW();
// pub fn BackupEventLogA();
// pub fn BackupEventLogW();
// pub fn CloseEventLog();
pub fn ClearEventLogA(
hEventLog: HANDLE,
lpBackupFileName: LPCSTR,
) -> BOOL;
pub fn ClearEventLogW(
hEventLog: HANDLE,
lpBackupFileName: LPCWSTR,
) -> BOOL;
pub fn BackupEventLogA(
hEventLog: HANDLE,
lpBackupFileName: LPCSTR,
) -> BOOL;
pub fn BackupEventLogW(
hEventLog: HANDLE,
lpBackupFileName: LPCWSTR,
) -> BOOL;
pub fn CloseEventLog(
hEventLog: HANDLE,
) -> BOOL;
pub fn DeregisterEventSource(
hEventLog: HANDLE,
) -> BOOL;
// pub fn NotifyChangeEventLog();
// pub fn GetNumberOfEventLogRecords();
// pub fn GetOldestEventLogRecord();
// pub fn OpenEventLogA();
// pub fn OpenEventLogW();
pub fn NotifyChangeEventLog(
hEventLog: HANDLE,
hEvent: HANDLE,
) -> BOOL;
pub fn GetNumberOfEventLogRecords(
hEventLog: HANDLE,
NumberOfRecords: PDWORD,
) -> BOOL;
pub fn GetOldestEventLogRecord(
hEventLog: HANDLE,
OldestRecord: PDWORD,
) -> BOOL;
pub fn OpenEventLogA(
lpUNCServerName: LPCSTR,
lpSourceName: LPCSTR,
) -> HANDLE;
pub fn OpenEventLogW(
lpUNCServerName: LPCWSTR,
lpSourceName: LPCWSTR,
) -> HANDLE;
pub fn RegisterEventSourceA(
lpUNCServerName: LPCSTR,
lpSourceName: LPCSTR,
Expand All @@ -2028,10 +2062,34 @@ extern "system" {
lpUNCServerName: LPCWSTR,
lpSourceName: LPCWSTR,
) -> HANDLE;
// pub fn OpenBackupEventLogA();
// pub fn OpenBackupEventLogW();
// pub fn ReadEventLogA();
// pub fn ReadEventLogW();
pub fn OpenBackupEventLogA(
lpUNCServerName: LPCSTR,
lpFileName: LPCSTR,
) -> HANDLE;
pub fn OpenBackupEventLogW(
lpUNCServerName: LPCWSTR,
lpFileName: LPCWSTR,
) -> HANDLE;
pub fn ReadEventLogA(
hEventLog: HANDLE,
dwReadFlags: DWORD,
dwRecordOffset: DWORD,
lpBuffer: LPVOID,
//lpBuffer: PEVENTLOGRECORD,
nNumberOfBytesToRead: DWORD,
pnBytesRead: *mut DWORD,
pnMinNumberOfBytesNeeded: *mut DWORD,
) -> BOOL;
pub fn ReadEventLogW(
hEventLog: HANDLE,
dwReadFlags: DWORD,
dwRecordOffset: DWORD,
lpBuffer: LPVOID,
//lpBuffer: PEVENTLOGRECORD,
nNumberOfBytesToRead: DWORD,
pnBytesRead: *mut DWORD,
pnMinNumberOfBytesNeeded: *mut DWORD,
) -> BOOL;
pub fn ReportEventA(
hEventLog: HANDLE,
wType: WORD,
Expand All @@ -2054,7 +2112,13 @@ extern "system" {
lpStrings: *mut LPCWSTR,
lpRawData: LPVOID,
) -> BOOL;
// pub fn GetEventLogInformation();
pub fn GetEventLogInformation(
hEventLog: HANDLE,
dwInfoLevel: DWORD,
lpBuffer: LPVOID,
cbBufSize: DWORD,
pcbBytesNeeded: LPDWORD,
) -> BOOL;
// pub fn OperationStart();
// pub fn OperationEnd();
// pub fn AccessCheckAndAuditAlarmA();
Expand Down