From f2381acf5a69df049dd897d40f9eb7490b33fd00 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 9 Sep 2008 19:43:02 +0200 Subject: netapi: add NetFileGetInfo skeleton. Guenther (This used to be commit 6c61c2e35e60a7b1398533311dab5eee38eb3b09) --- source3/lib/netapi/file.c | 18 +++++++++++++++++ source3/lib/netapi/libnetapi.c | 46 ++++++++++++++++++++++++++++++++++++++++++ source3/lib/netapi/libnetapi.h | 8 ++++++++ 3 files changed, 72 insertions(+) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/file.c b/source3/lib/netapi/file.c index c0edb8e062..021e4c2938 100644 --- a/source3/lib/netapi/file.c +++ b/source3/lib/netapi/file.c @@ -67,3 +67,21 @@ WERROR NetFileClose_l(struct libnetapi_ctx *ctx, { LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetFileClose); } + +/**************************************************************** +****************************************************************/ + +WERROR NetFileGetInfo_r(struct libnetapi_ctx *ctx, + struct NetFileGetInfo *r) +{ + return WERR_NOT_SUPPORTED; +} + +/**************************************************************** +****************************************************************/ + +WERROR NetFileGetInfo_l(struct libnetapi_ctx *ctx, + struct NetFileGetInfo *r) +{ + LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetFileGetInfo); +} diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c index d83dc28c43..48c019cdf9 100644 --- a/source3/lib/netapi/libnetapi.c +++ b/source3/lib/netapi/libnetapi.c @@ -2250,3 +2250,49 @@ NET_API_STATUS NetFileClose(const char * server_name /* [in] */, return r.out.result; } +/**************************************************************** + NetFileGetInfo +****************************************************************/ + +NET_API_STATUS NetFileGetInfo(const char * server_name /* [in] */, + uint32_t fileid /* [in] */, + uint32_t level /* [in] */, + uint8_t **buffer /* [out] [ref] */) +{ + struct NetFileGetInfo 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.fileid = fileid; + r.in.level = level; + + /* Out parameters */ + r.out.buffer = buffer; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetFileGetInfo, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetFileGetInfo_l(ctx, &r); + } else { + werr = NetFileGetInfo_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetFileGetInfo, &r); + } + + return r.out.result; +} + diff --git a/source3/lib/netapi/libnetapi.h b/source3/lib/netapi/libnetapi.h index 8648563665..0d2cd3107e 100644 --- a/source3/lib/netapi/libnetapi.h +++ b/source3/lib/netapi/libnetapi.h @@ -405,4 +405,12 @@ WERROR NetFileClose_r(struct libnetapi_ctx *ctx, struct NetFileClose *r); WERROR NetFileClose_l(struct libnetapi_ctx *ctx, struct NetFileClose *r); +NET_API_STATUS NetFileGetInfo(const char * server_name /* [in] */, + uint32_t fileid /* [in] */, + uint32_t level /* [in] */, + uint8_t **buffer /* [out] [ref] */); +WERROR NetFileGetInfo_r(struct libnetapi_ctx *ctx, + struct NetFileGetInfo *r); +WERROR NetFileGetInfo_l(struct libnetapi_ctx *ctx, + struct NetFileGetInfo *r); #endif /* __LIBNETAPI_LIBNETAPI__ */ -- cgit