NTSTATUS _eventlog_OpenEventLogW(struct pipes_struct *p, struct eventlog_OpenEventLogW *r) { EVENTLOG_INFO *info; NTSTATUS result; DEBUG( 10,("_eventlog_OpenEventLogW: Server [%s], Log [%s]\n", r->in.servername->string, r->in.logname->string )); /* according to MSDN, if the logfile cannot be found, we should default to the "Application" log */ if ( !NT_STATUS_IS_OK( result = elog_open( p, r->in.logname->string, r->out.handle )) ) return result; if ( !(info = find_eventlog_info_by_hnd( p, r->out.handle )) ) { DEBUG(0,("_eventlog_OpenEventLogW: eventlog (%s) opened but unable to find handle!\n", r->in.logname->string )); elog_close( p, r->out.handle ); return NT_STATUS_INVALID_HANDLE; } DEBUG(10,("_eventlog_OpenEventLogW: Size [%d]\n", elog_size( info ))); if (!sync_eventlog_params(p->mem_ctx, p->msg_ctx, info)) { elog_close(p, r->out.handle); return NT_STATUS_EVENTLOG_FILE_CORRUPT; } prune_eventlog( ELOG_TDB_CTX(info->etdb) ); return NT_STATUS_OK; }
NTSTATUS _eventlog_CloseEventLog(pipes_struct * p, struct eventlog_CloseEventLog *r) { NTSTATUS status; status = elog_close( p, r->in.handle ); if (!NT_STATUS_IS_OK(status)) { return status; } ZERO_STRUCTP(r->out.handle); return NT_STATUS_OK; }
ElogErrCode close_elog(void) { return elog_close(); }