netapi: add NetFileGetInfo skeleton.
authorGünther Deschner <gd@samba.org>
Tue, 9 Sep 2008 17:43:02 +0000 (19:43 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 11 Sep 2008 12:36:55 +0000 (14:36 +0200)
Guenther
(This used to be commit 6c61c2e35e60a7b1398533311dab5eee38eb3b09)

source3/lib/netapi/file.c
source3/lib/netapi/libnetapi.c
source3/lib/netapi/libnetapi.h

index c0edb8e0628bfc6e12b45a5007ddfe80a1105ae5..021e4c29380cb703ce346248af7dfb649f29a46e 100644 (file)
@@ -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);
+}
index d83dc28c433b93e2fc6b15450c27fde886726d31..48c019cdf9864e387c34076fbdddbb0d9700ce13 100644 (file)
@@ -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;
+}
+
index 864856366577bed9f80fb9d0709df635e04c5b96..0d2cd3107e2dc2ee4f3656dcaf2773a3d126535b 100644 (file)
@@ -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__ */