if(!(smb_io_pol_hnd("log handle", &(r_u->handle), ps, depth)))
return False;
- if(!(prs_werror("status code", ps, depth, &(r_u->status))))
+ if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
return False;
return True;
if(!(prs_uint32("num records", ps, depth, &(r_u->num_records))))
return False;
- if(!(prs_werror("status code", ps, depth, &(r_u->status))))
+ if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
return False;
return True;
if(!(prs_uint32("oldest entry", ps, depth, &(r_u->oldest_entry))))
return False;
- if(!(prs_werror("status code", ps, depth, &(r_u->status))))
+ if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
return False;
return True;
if(!(smb_io_pol_hnd("log handle", &(r_u->handle), ps, depth)))
return False;
- if(!(prs_werror("status code", ps, depth, &(r_u->status))))
+ if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
return False;
return True;
return False;
if(!(prs_uint32("real size", ps, depth, &(r_u->real_size))))
return False;
- if(!(prs_werror("status code", ps, depth, &(r_u->status))))
+ if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
return False;
return True;
if(!prs_align(ps))
return False;
- if(!(prs_werror("status code", ps, depth, &(r_u->status))))
+ if(!(prs_ntstatus("status code", ps, depth, &r_u->status)))
return False;
return True;
/********************************************************************
********************************************************************/
-static WERROR elog_open( pipes_struct * p, const char *logname, POLICY_HND *hnd )
+static NTSTATUS elog_open( pipes_struct * p, const char *logname, POLICY_HND *hnd )
{
EVENTLOG_INFO *elog;
/* first thing is to validate the eventlog name */
if ( !elog_validate_logname( logname ) )
- return WERR_OBJECT_PATH_INVALID;
+ return NT_STATUS_OBJECT_PATH_INVALID;
if ( !(elog = TALLOC_ZERO_P( NULL, EVENTLOG_INFO )) )
- return WERR_NOMEM;
+ return NT_STATUS_NO_MEMORY;
elog->logname = talloc_strdup( elog, logname );
/* do the access check */
if ( !elog_check_access( elog, p->pipe_user.nt_user_token ) ) {
TALLOC_FREE( elog );
- return WERR_ACCESS_DENIED;
+ return NT_STATUS_ACCESS_DENIED;
}
become_root();
if ( !elog->tdb ) {
TALLOC_FREE( elog );
- return WERR_ACCESS_DENIED; /* ??? */
+ return NT_STATUS_ACCESS_DENIED; /* ??? */
}
}
if ( !elog_check_access( elog, p->pipe_user.nt_user_token ) ) {
elog_close_tdb( elog->tdb );
TALLOC_FREE( elog );
- return WERR_ACCESS_DENIED;
+ return NT_STATUS_ACCESS_DENIED;
}
/* create the policy handle */
if ( !create_policy_hnd
( p, hnd, free_eventlog_info, ( void * ) elog ) ) {
free_eventlog_info( elog );
- return WERR_NOMEM;
+ return NT_STATUS_NO_MEMORY;
}
- return WERR_OK;
+ return NT_STATUS_OK;
}
/********************************************************************
********************************************************************/
-static WERROR elog_close( pipes_struct *p, POLICY_HND *hnd )
+static NTSTATUS elog_close( pipes_struct *p, POLICY_HND *hnd )
{
if ( !( close_policy_hnd( p, hnd ) ) ) {
- return WERR_BADFID;
+ return NT_STATUS_INVALID_HANDLE;
}
- return WERR_OK;
+ return NT_STATUS_OK;
}
/*******************************************************************
static BOOL get_oldest_entry_hook( EVENTLOG_INFO * info )
{
-
/* it's the same thing */
return get_num_records_hook( info );
}
/********************************************************************
********************************************************************/
-WERROR _eventlog_open_eventlog( pipes_struct * p,
+NTSTATUS _eventlog_open_eventlog( pipes_struct * p,
EVENTLOG_Q_OPEN_EVENTLOG * q_u,
EVENTLOG_R_OPEN_EVENTLOG * r_u )
{
fstring servername, logname;
EVENTLOG_INFO *info;
- WERROR wresult;
+ NTSTATUS result;
fstrcpy( servername, "" );
if ( q_u->servername.string ) {
/* according to MSDN, if the logfile cannot be found, we should
default to the "Application" log */
- if ( !W_ERROR_IS_OK( wresult = elog_open( p, logname, &r_u->handle )) )
- return wresult;
+ if ( !NT_STATUS_IS_OK( result = elog_open( p, logname, &r_u->handle )) )
+ return result;
if ( !(info = find_eventlog_info_by_hnd( p, &r_u->handle )) ) {
DEBUG(0,("_eventlog_open_eventlog: eventlog (%s) opened but unable to find handle!\n",
logname ));
elog_close( p, &r_u->handle );
- return WERR_BADFID;
+ return NT_STATUS_INVALID_HANDLE;
}
DEBUG(10,("_eventlog_open_eventlog: Size [%d]\n", elog_size( info )));
sync_eventlog_params( info );
prune_eventlog( info->tdb );
- return WERR_OK;
+ return NT_STATUS_OK;
}
/********************************************************************
This call still needs some work
********************************************************************/
-WERROR _eventlog_clear_eventlog( pipes_struct * p,
+NTSTATUS _eventlog_clear_eventlog( pipes_struct * p,
EVENTLOG_Q_CLEAR_EVENTLOG * q_u,
EVENTLOG_R_CLEAR_EVENTLOG * r_u )
{
pstring backup_file_name;
if ( !info )
- return WERR_BADFID;
+ return NT_STATUS_INVALID_HANDLE;
pstrcpy( backup_file_name, "" );
if ( q_u->backupfile.string ) {
tdb_close( info->tdb );
if ( !(info->tdb = elog_init_tdb( ttdb[i].tdbfname )) )
- return WERR_ACCESS_DENIED;
+ return NT_STATUS_ACCESS_DENIED;
#endif
- return WERR_OK;
+ return NT_STATUS_OK;
}
/********************************************************************
********************************************************************/
-WERROR _eventlog_close_eventlog( pipes_struct * p,
+NTSTATUS _eventlog_close_eventlog( pipes_struct * p,
EVENTLOG_Q_CLOSE_EVENTLOG * q_u,
EVENTLOG_R_CLOSE_EVENTLOG * r_u )
{
/********************************************************************
********************************************************************/
-WERROR _eventlog_read_eventlog( pipes_struct * p,
+NTSTATUS _eventlog_read_eventlog( pipes_struct * p,
EVENTLOG_Q_READ_EVENTLOG * q_u,
EVENTLOG_R_READ_EVENTLOG * r_u )
{
bytes_left = q_u->max_read_size;
tdb = info->tdb;
if ( !tdb ) {
- return WERR_EVENTLOG_FILE_CORRUPT;
+ return NT_STATUS_ACCESS_DENIED;
}
/* DEBUG(8,("Bytes left is %d\n",bytes_left)); */
/* Now see if there is enough room to add */
ee_new = read_package_entry( ps, q_u, r_u,&entry );
if ( !ee_new )
- return WERR_NOMEM;
+ return NT_STATUS_NO_MEMORY;
if ( r_u->num_bytes_in_resp + ee_new->record.length >
q_u->max_read_size ) {
q_u->max_read_size ) );
} else {
DEBUG( 8, ( "get_eventlog_record returned NULL\n" ) );
- return WERR_NOMEM; /* wrong error - but return one anyway */
+ return NT_STATUS_NO_MEMORY; /* wrong error - but return one anyway */
}
record_number--;
}
- return WERR_OK;
+ return NT_STATUS_OK;
}
/********************************************************************
********************************************************************/
-WERROR _eventlog_get_oldest_entry( pipes_struct * p,
+NTSTATUS _eventlog_get_oldest_entry( pipes_struct * p,
EVENTLOG_Q_GET_OLDEST_ENTRY * q_u,
EVENTLOG_R_GET_OLDEST_ENTRY * r_u )
{
EVENTLOG_INFO *info = find_eventlog_info_by_hnd( p, &q_u->handle );
if ( !( get_oldest_entry_hook( info ) ) )
- return WERR_BADFILE;
+ return NT_STATUS_ACCESS_DENIED;
r_u->oldest_entry = info->oldest_entry;
- return WERR_OK;
+ return NT_STATUS_OK;
}
/********************************************************************
********************************************************************/
-WERROR _eventlog_get_num_records( pipes_struct * p,
+NTSTATUS _eventlog_get_num_records( pipes_struct * p,
EVENTLOG_Q_GET_NUM_RECORDS * q_u,
EVENTLOG_R_GET_NUM_RECORDS * r_u )
{
EVENTLOG_INFO *info = find_eventlog_info_by_hnd( p, &q_u->handle );
if ( !( get_num_records_hook( info ) ) )
- return WERR_BADFILE;
+ return NT_STATUS_ACCESS_DENIED;
r_u->num_records = info->num_records;
- return WERR_OK;
+ return NT_STATUS_OK;
}