From 8fd3c8902c5e953a0ddf184b08f9e37f954ee12e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 13 May 2009 16:27:58 +0200 Subject: s3-netapi: add NetShutdownInit and NetShutdownAbort skeletons. Guenther --- source3/lib/netapi/libnetapi.c | 88 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'source3/lib/netapi/libnetapi.c') diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c index 043190a1f9..6e366673f1 100644 --- a/source3/lib/netapi/libnetapi.c +++ b/source3/lib/netapi/libnetapi.c @@ -2353,3 +2353,91 @@ NET_API_STATUS NetFileEnum(const char * server_name /* [in] */, return r.out.result; } +/**************************************************************** + NetShutdownInit +****************************************************************/ + +NET_API_STATUS NetShutdownInit(const char * server_name /* [in] */, + const char * message /* [in] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */) +{ + struct NetShutdownInit r; + struct libnetapi_ctx *ctx = NULL; + NET_API_STATUS status; + WERROR werr; + + status = libnetapi_getctx(&ctx); + if (status != 0) { + return status; + } + + /* In parameters */ + r.in.server_name = server_name; + r.in.message = message; + r.in.timeout = timeout; + r.in.force_apps = force_apps; + r.in.do_reboot = do_reboot; + + /* Out parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetShutdownInit, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetShutdownInit_l(ctx, &r); + } else { + werr = NetShutdownInit_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetShutdownInit, &r); + } + + return r.out.result; +} + +/**************************************************************** + NetShutdownAbort +****************************************************************/ + +NET_API_STATUS NetShutdownAbort(const char * server_name /* [in] */) +{ + struct NetShutdownAbort r; + struct libnetapi_ctx *ctx = NULL; + NET_API_STATUS status; + WERROR werr; + + status = libnetapi_getctx(&ctx); + if (status != 0) { + return status; + } + + /* In parameters */ + r.in.server_name = server_name; + + /* Out parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetShutdownAbort, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetShutdownAbort_l(ctx, &r); + } else { + werr = NetShutdownAbort_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetShutdownAbort, &r); + } + + return r.out.result; +} + -- cgit