1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Use pidl for _eventlog_OpenEventLogW().

Guenther
This commit is contained in:
Günther Deschner 2008-02-04 11:10:18 +01:00
parent f8a3dc3500
commit ef293be6cb
2 changed files with 13 additions and 44 deletions

View File

@ -42,27 +42,7 @@ static bool proxy_eventlog_call(pipes_struct *p, uint8 opnum)
static bool api_eventlog_open_eventlog(pipes_struct *p)
{
EVENTLOG_Q_OPEN_EVENTLOG q_u;
EVENTLOG_R_OPEN_EVENTLOG r_u;
prs_struct *data = &p->in_data.data;
prs_struct *rdata = &p->out_data.rdata;
ZERO_STRUCT(q_u);
ZERO_STRUCT(r_u);
if (!(eventlog_io_q_open_eventlog("", &q_u, data, 0))) {
DEBUG(0, ("eventlog_io_q_open_eventlog: unable to unmarshall EVENTLOG_Q_OPEN_EVENTLOG.\n"));
return False;
}
r_u.status = _eventlog_open_eventlog(p, &q_u, &r_u);
if (!(eventlog_io_r_open_eventlog("", &r_u, rdata, 0))) {
DEBUG(0, ("eventlog_io_r_open_eventlog: unable to marshall EVENTLOG_R_OPEN_EVENTLOG.\n"));
return False;
}
return True;
return proxy_eventlog_call(p, NDR_EVENTLOG_OPENEVENTLOGW);
}
static bool api_eventlog_close_eventlog(pipes_struct *p)

View File

@ -610,28 +610,23 @@ static bool add_record_to_resp( EVENTLOG_R_READ_EVENTLOG * r_u,
}
/********************************************************************
_eventlog_OpenEventLogW
********************************************************************/
NTSTATUS _eventlog_open_eventlog( pipes_struct * p,
EVENTLOG_Q_OPEN_EVENTLOG * q_u,
EVENTLOG_R_OPEN_EVENTLOG * r_u )
NTSTATUS _eventlog_OpenEventLogW(pipes_struct *p,
struct eventlog_OpenEventLogW *r)
{
fstring servername, logname;
const char *servername = "";
const char *logname = "";
EVENTLOG_INFO *info;
NTSTATUS result;
fstrcpy( servername, "" );
if ( q_u->servername.string ) {
rpcstr_pull( servername, q_u->servername.string->buffer,
sizeof( servername ),
q_u->servername.string->uni_str_len * 2, 0 );
if (r->in.servername->string) {
servername = r->in.servername->string;
}
fstrcpy( logname, "" );
if ( q_u->logname.string ) {
rpcstr_pull( logname, q_u->logname.string->buffer,
sizeof( logname ),
q_u->logname.string->uni_str_len * 2, 0 );
if (r->in.logname->string) {
logname = r->in.logname->string;
}
DEBUG( 10,("_eventlog_open_eventlog: Server [%s], Log [%s]\n",
@ -640,13 +635,13 @@ NTSTATUS _eventlog_open_eventlog( pipes_struct * p,
/* 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, logname, &r_u->handle )) )
if ( !NT_STATUS_IS_OK( result = elog_open( p, logname, r->out.handle )) )
return result;
if ( !(info = find_eventlog_info_by_hnd( p, &r_u->handle )) ) {
if ( !(info = find_eventlog_info_by_hnd( p, r->out.handle )) ) {
DEBUG(0,("_eventlog_open_eventlog: eventlog (%s) opened but unable to find handle!\n",
logname ));
elog_close( p, &r_u->handle );
elog_close( p, r->out.handle );
return NT_STATUS_INVALID_HANDLE;
}
@ -877,12 +872,6 @@ NTSTATUS _eventlog_ChangeNotify(pipes_struct *p, struct eventlog_ChangeNotify *r
return NT_STATUS_NOT_IMPLEMENTED;
}
NTSTATUS _eventlog_OpenEventLogW(pipes_struct *p, struct eventlog_OpenEventLogW *r)
{
p->rng_fault_state = True;
return NT_STATUS_NOT_IMPLEMENTED;
}
NTSTATUS _eventlog_RegisterEventSourceW(pipes_struct *p, struct eventlog_RegisterEventSourceW *r)
{
p->rng_fault_state = True;