srvsvc.ndl revision 3db3f65c6274eb042354801a308c8e9bc4994553
1N/A/*
1N/A * CDDL HEADER START
1N/A *
1N/A * The contents of this file are subject to the terms of the
1N/A * Common Development and Distribution License (the "License").
1N/A * You may not use this file except in compliance with the License.
1N/A *
1N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A * or http://www.opensolaris.org/os/licensing.
1N/A * See the License for the specific language governing permissions
1N/A * and limitations under the License.
1N/A *
1N/A * When distributing Covered Code, include this CDDL HEADER in each
1N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/A * If applicable, add the following below this CDDL HEADER, with the
1N/A * fields enclosed by brackets "[]" replaced with your own identifying
1N/A * information: Portions Copyright [yyyy] [name of copyright owner]
1N/A *
1N/A * CDDL HEADER END
1N/A */
1N/A/*
1N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1N/A * Use is subject to license terms.
1N/A */
1N/A
1N/A#ifndef _MLSVC_LANMAN_NDL_
1N/A#define _MLSVC_LANMAN_NDL_
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A/*
1N/A * LanMan RPC (WKSSVC and SRVSVC) interface definitions.
1N/A */
1N/A
1N/A#include "ndrtypes.ndl"
1N/A
1N/A/*
1N/A * WARNING: The cpp(1) macros in this file are not understood by
1N/A * /usr/bin/cpp. Use /usr/libexec/cpp instead.
1N/A */
1N/A
1N/A/*
1N/A * TYPE CONSTRUCTOR MACROS FOR INFORMATION RESULTS
1N/A ****************************************************************
1N/A *
1N/A * This is an explanation of the macros that follow this comment.
1N/A *
1N/A * The LANMAN API's look something like this:
1N/A *
1N/A * NetXXXGetInfo (
1N/A * IN char * servername,
1N/A * IN char * XXX_name,
1N/A * IN int level,
1N/A * OUT char ** bufptr);
1N/A *
1N/A * The bufptr is a pointer-to-pointer (**). The NetXXXGetInfo() function
1N/A * malloc()s memory, and sets *bufptr to the memory. The API's
1N/A * are undiscriminated about what bufptr really points to.
1N/A *
1N/A * However, for RPI (Remote Procedure Interface), this just won't fly.
1N/A * We have to know what the result data looks like in order to
1N/A * properly (un)marshall it.
1N/A *
1N/A * As best we can determine, the MSC developers use an RPI that looks
1N/A * like this (approximately in IDL):
1N/A *
1N/A * RemoteNetXXXGetInfo (
1N/A * IN char * servername,
1N/A * IN char * XXX_name,
1N/A * IN int level,
1N/A * OUT union switch(level) {
1N/A * case(1): XXX_INFO_1 * info1;
1N/A * case(2): XXX_INFO_2 * info2;
1N/A * } bufptr);
1N/A *
1N/A * The level guides the (un)marshalling as it follows the pointer.
1N/A * DCE(MS) IDL will automatically form a structure for the union
1N/A * which looks about like this (much as Sun/RPC does):
1N/A *
1N/A * struct {
1N/A * int _keyvalue_;
1N/A * union {
1N/A * XXX_INFO_1 *info1;
1N/A * XXX_INFO_2 *info2;
1N/A * } _u_;
1N/A * } bufptr;
1N/A *
1N/A * This struct is not made visible to the application. It is purely
1N/A * an internal (automagic) thing. However, ndrgen does not do this.
1N/A * The ndrgen input MUST remain a valid C header file, and all
1N/A * struct and union declarations must be exact, and we (would) have
1N/A * to tediously code sequences like this (approximately NDL)):
1N/A *
1N/A * union XXXGetInfo_result_u {
1N/A * [case(1)]
1N/A * XXX_INFO_1 * info1;
1N/A * [case(2)]
1N/A * XXX_INFO_2 * info2;
1N/A * };
1N/A *
1N/A * struct XXXGetInfo_result {
1N/A * int level;
1N/A *
1N/A * union XXXGetInfo_result_u bufptr;
1N/A * };
1N/A *
1N/A * struct XXXGetInfo_param { // still have to code this one
1N/A * [in] char * servername;
1N/A * [in] ushort level;
1N/A * [out] struct XXXGetInfo_result result;
1N/A * };
1N/A *
1N/A * This is error prone and difficult to write, and more difficult
1N/A * and distracting to read. It is hard to pick through the
1N/A * necessary evils and see what's really going on. To mitigate
1N/A * the situation, we have a series of macros which generate
1N/A * the tedious code, and are easily recognized as supporting
1N/A * fluff rather than important structures:
1N/A *
1N/A * INFO1RES_DEFINITION(XXXGetInfo,
1N/A * INFO1RES_UNION_ENTRY(XXXGetInfo, 1)
1N/A * INFO1RES_UNION_ENTRY(XXXGetInfo, 2))
1N/A *
1N/A * structt XXXGetInfo_param { // still have to code this one
1N/A * [in] char * servername;
1N/A * [in] ushort level;
1N/A * [out] struct XXXGetInfo_result result;
1N/A * };
1N/A *
1N/A * The INFO1RES_DEFINITION macro defines two types:
1N/A *
1N/A * union ...__ru {...}
1N/A * struct ..._result { DWORD level; union ..._ru bufptr; }
1N/A *
1N/A * There is a similar macro, INFO1RESBUF_DEFINITION, which defines
1N/A * actual space rather than just pointers. It defines:
1N/A *
1N/A * union ...._rb {...}
1N/A * typedef union ..._rb ..._rb;
1N/A *
1N/A * Which is handy in functions because the initial coding sequence
1N/A * looks something like:
1N/A *
1N/A * XXXGetInfoParam (struct XXXGetInfo_param *param) {
1N/A * XXXGetInfo_rb rb;
1N/A *
1N/A * param->result.level = param->level; // for marshalling
1N/A * param->result.bufptr.nullptr = &rb; // anything fits
1N/A *
1N/A * There are two flavors of Info results. The first is the
1N/A * single XXX_INFO_x result, which the foregoing example
1N/A * uses. The second flavor is when there are multiple entries
1N/A * possible. Again, for the sake of guiding the marshalling,
1N/A * the RPIs use something accommodating:
1N/A *
1N/A * struct XXX_INFO_1_result {
1N/A * unsigned entriesread;
1N/A * [size_is(entriesread)]
1N/A * XXX_INFO_1 * table;
1N/A * };
1N/A *
1N/A * union { XXX_INFO_1_result *info1; ...}
1N/A *
1N/A * Notice this is using XXX_INFO_1_result rather than just XXX_INFO_1.
1N/A * The requirements from this point are much like before. Because of
1N/A * the variable-length value, there is no realistic way to do something
1N/A * like INFO1RESBUF_DEFINITION.
1N/A *
1N/A * There are two sets of macros here. INFO1RES_xxx are for the
1N/A * single result case, and INFONRES_xxx for the multiple entry case.
1N/A */
1N/A
1N/A/*
1N/A * INFO1RES_...
1N/A * Type constructors for single-result case
1N/A */
1N/A
1N/A#define INFO1RES_DEFINITION(INFOPREF, ENTRIES) \
1N/A INFO1RES_UNION(INFOPREF, ENTRIES) \
1N/A INFO1RES_STRUCT(INFOPREF)
1N/A
1N/A#define INFO1RES_UNION(INFOPREF, ENTRIES) \
1N/A union INFOPREF##__ru { \
1N/A INFO1RES_UNION_NULLPTR \
1N/A ENTRIES \
1N/A };
1N/A
1N/A#define INFO1RES_UNION_NULLPTR \
1N/A DEFAULT char * nullptr;
1N/A
1N/A#define INFO1RES_UNION_ENTRY(INFOPREF,NUM) \
1N/A CASE(NUM) struct INFOPREF##_##NUM * bufptr##NUM;
1N/A
1N/A#define INFO1RES_STRUCT(INFOPREF) \
1N/A struct INFOPREF##_result { \
1N/A DWORD level; \
1N/A SWITCH(level) \
1N/A union INFOPREF##__ru bufptr; \
1N/A };
1N/A
1N/A/*
1N/A * INFO1RESBUF_...
1N/A * Type constructors for single-result buffering.
1N/A */
1N/A
1N/A
1N/A#ifndef NDRGEN
1N/A#define INFO1RESBUF_DEFINITION(INFOPREF, ENTRIES) \
1N/A typedef union INFOPREF##_rb { \
1N/A ENTRIES \
1N/A } INFOPREF##_rb;
1N/A#define INFO1RESBUF_UNION_ENTRY(INFOPREF,NUM) \
1N/A CASE(NUM) struct INFOPREF##_##NUM buf##NUM;
1N/A#else
1N/A#define INFO1RESBUF_DEFINITION(INFOPREF, ENTRIES)
1N/A#define INFO1RESBUF_UNION_ENTRY(INFOPREF,NUM)
1N/A#endif
1N/A
1N/A
1N/A
1N/A
1N/A/*
1N/A * INFONRES_...
1N/A * Type constructors for multiple-result case
1N/A */
1N/A
1N/A#define INFONRES_RESULT(INFOPREF,NUM) \
1N/A struct INFOPREF##_##NUM##_result { \
1N/A DWORD entriesread; \
1N/A SIZE_IS(entriesread) \
1N/A struct INFOPREF##_##NUM *entries; \
1N/A };
1N/A
1N/A#define INFONRES_DEFINITION(INFOPREF, ENTRIES) \
1N/A INFONRES_UNION(INFOPREF, ENTRIES) \
1N/A INFONRES_STRUCT(INFOPREF)
1N/A
1N/A#define INFONRES_UNION(INFOPREF, ENTRIES) \
1N/A union INFOPREF##__ru { \
1N/A INFONRES_UNION_NULLPTR \
1N/A INFONRES_UNION_INFONRES \
1N/A ENTRIES \
1N/A };
1N/A
1N/A#define INFONRES_UNION_NULLPTR \
1N/A DEFAULT char * nullptr;
1N/A
1N/A#ifndef NDRGEN
1N/A#define INFONRES_UNION_INFONRES \
1N/A struct mslm_infonres * p;
1N/A#else
1N/A#define INFONRES_UNION_INFONRES
1N/A#endif
1N/A
1N/A#define INFONRES_UNION_ENTRY(INFOPREF,NUM) \
1N/A CASE(NUM) struct INFOPREF##_##NUM##_result * bufptr##NUM;
1N/A
1N/A#define INFONRES_STRUCT(INFOPREF) \
1N/A struct INFOPREF##_result { \
1N/A DWORD level; \
1N/A SWITCH(level) \
1N/A union INFOPREF##__ru bufptr; \
1N/A };
1N/A
1N/A#ifndef NDRGEN
1N/A/*
1N/A * This just makes things a little easier on the stub modules:
1N/A *
1N/A * XXXGetInfoParam (struct XXXGetInfo_param *param) {
1N/A * struct mslm_infonres infonres;
1N/A *
1N/A * infonres.entriesread = 0;
1N/A * infonres.entries = 0;
1N/A * param->result.level = param->level; // for marshalling
1N/A * param->result.bufptr.p = &infonres;
1N/A */
1N/Astruct mslm_infonres {
1N/A DWORD entriesread;
1N/A void * entries;
1N/A};
1N/A#endif
1N/A
1N/A
1N/A/*
1N/A * SRVSVC - Server Service
1N/A */
1N/A
1N/A/* Windows NT */
1N/A#define SRVSVC_OPNUM_NetCharDevEnum 0x00
1N/A#define SRVSVC_OPNUM_NetCharDevGetInfo 0x01
1N/A#define SRVSVC_OPNUM_NetCharDevControl 0x02
1N/A#define SRVSVC_OPNUM_NetCharDevQEnum 0x03
1N/A#define SRVSVC_OPNUM_NetCharDevQGetInfo 0x04
1N/A#define SRVSVC_OPNUM_NetCharDevQSetInfo 0x05
1N/A#define SRVSVC_OPNUM_NetCharDevQPurge 0x06
1N/A#define SRVSVC_OPNUM_NetCharDevQPurgeSelf 0x07
1N/A#define SRVSVC_OPNUM_NetConnectEnum 0x08
1N/A#define SRVSVC_OPNUM_NetFileEnum 0x09
1N/A#define SRVSVC_OPNUM_NetFileGetInfo 0x0a
1N/A#define SRVSVC_OPNUM_NetFileClose 0x0b
1N/A#define SRVSVC_OPNUM_NetSessionEnum 0x0c
1N/A#define SRVSVC_OPNUM_NetSessionDel 0x0d
1N/A#define SRVSVC_OPNUM_NetShareAdd 0x0e
1N/A#define SRVSVC_OPNUM_NetShareEnum 0x0f
1N/A#define SRVSVC_OPNUM_NetShareGetInfo 0x10
1N/A#define SRVSVC_OPNUM_NetShareSetInfo 0x11
1N/A#define SRVSVC_OPNUM_NetShareDel 0x12
1N/A#define SRVSVC_OPNUM_NetShareDelSticky 0x13
1N/A#define SRVSVC_OPNUM_NetShareCheck 0x14
1N/A#define SRVSVC_OPNUM_NetServerGetInfo 0x15
1N/A#define SRVSVC_OPNUM_NetServerSetInfo 0x16
1N/A#define SRVSVC_OPNUM_NetServerDiskEnum 0x17
1N/A#define SRVSVC_OPNUM_NetServerStatisticsGet 0x18
1N/A#define SRVSVC_OPNUM_NetServerTransportAdd 0x19
1N/A#define SRVSVC_OPNUM_NetServerTransportEnum 0x1a
1N/A#define SRVSVC_OPNUM_NetServerTransportDel 0x1b
1N/A#define SRVSVC_OPNUM_NetRemoteTOD 0x1c
1N/A#define SRVSVC_OPNUM_NetServerSetServiceBits 0x1d
1N/A#define SRVSVC_OPNUM_NetPathType 0x1e
1N/A#define SRVSVC_OPNUM_NetPathCanonicalize 0x1f
1N/A#define SRVSVC_OPNUM_NetPathCompare 0x20
1N/A#define SRVSVC_OPNUM_NetNameValidate 0x21
1N/A#define SRVSVC_OPNUM_NetNameCanonicalize 0x22
1N/A#define SRVSVC_OPNUM_NetNameCompare 0x23
1N/A#define SRVSVC_OPNUM_NetShareEnumSticky 0x24
1N/A#define SRVSVC_OPNUM_NetShareDelStart 0x25
1N/A#define SRVSVC_OPNUM_NetShareDelCommit 0x26
1N/A#define SRVSVC_OPNUM_NetGetFileSecurity 0x27
1N/A#define SRVSVC_OPNUM_NetSetFileSecurity 0x28
1N/A#define SRVSVC_OPNUM_NetServerTransportAddEx 0x29
1N/A#define SRVSVC_OPNUM_NetServerSetServiceBitsEx 0x2a
1N/A#define SRVSVC_OPNUM_NetDfsGetVersion 0x2b
1N/A
1N/A/* Windows 2000 */
1N/A#define SRVSVC_OPNUM_NetDfsCreateLocalPartition 0x2c
1N/A#define SRVSVC_OPNUM_NetDfsDeleteLocalPartition 0x2d
1N/A#define SRVSVC_OPNUM_NetDfsSetLocalVolumeState 0x2e
1N/A#define SRVSVC_OPNUM_NetDfsSetServerInfo 0x2f
1N/A#define SRVSVC_OPNUM_NetDfsCreateExitPoint 0x30
1N/A#define SRVSVC_OPNUM_NetDfsDeleteExitPoint 0x31
1N/A#define SRVSVC_OPNUM_NetDfsModifyPrefix 0x32
1N/A#define SRVSVC_OPNUM_NetDfsFixLocalVolume 0x33
1N/A#define SRVSVC_OPNUM_NetDfsManagerReportSiteInfo 0x34
1N/A
1N/A/* Windows XP and Windows Server 2003 */
1N/A#define SRVSVC_OPNUM_NetServerTransportDelEx 0x35
1N/A
1N/A/* Windows Vista */
1N/A#define SRVSVC_OPNUM_NetServerAliasAdd 0x36
1N/A#define SRVSVC_OPNUM_NetServerAliasEnum 0x37
1N/A#define SRVSVC_OPNUM_NetServerAliasDel 0x38
1N/A#define SRVSVC_OPNUM_NetShareDelEx 0x39
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetConnectEnum
1N/A ***********************************************************************
1N/A */
1N/A
1N/A/*
1N/A * Level 0 connect information.
1N/A */
1N/Astruct mslm_NetConnectInfoBuf0 {
1N/A DWORD coni0_id;
1N/A};
1N/A
1N/Astruct mslm_NetConnectInfo0 {
1N/A DWORD entries_read;
1N/A SIZE_IS(entries_read)
1N/A struct mslm_NetConnectInfoBuf0 *ci0;
1N/A};
1N/A
1N/A/*
1N/A * Level 1 connect information.
1N/A */
1N/Astruct mslm_NetConnectInfoBuf1 {
1N/A DWORD coni1_id;
1N/A DWORD coni1_type;
1N/A DWORD coni1_num_opens;
1N/A DWORD coni1_num_users;
1N/A DWORD coni1_time;
1N/A LPTSTR coni1_username;
1N/A LPTSTR coni1_netname; /* share name */
1N/A};
1N/A
1N/Astruct mslm_NetConnectInfo1 {
1N/A DWORD entries_read;
1N/A SIZE_IS(entries_read)
1N/A struct mslm_NetConnectInfoBuf1 *ci1;
1N/A};
1N/A
1N/Aunion mslm_NetConnectInfoResUnion {
1N/A CASE(0) struct mslm_NetConnectInfo0 *info0;
1N/A CASE(1) struct mslm_NetConnectInfo1 *info1;
1N/A DEFAULT char *nullptr;
1N/A};
1N/A
1N/Astruct mslm_NetConnectInfo {
1N/A DWORD level;
1N/A DWORD switch_value;
1N/A SWITCH(switch_value)
1N/A union mslm_NetConnectInfoResUnion ru;
1N/A};
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetConnectEnum)
1N/Astruct mslm_NetConnectEnum {
1N/A IN LPTSTR servername;
1N/A IN LPTSTR qualifier; /* share name */
1N/A INOUT struct mslm_NetConnectInfo info;
1N/A IN DWORD pref_max_len;
1N/A OUT DWORD total_entries;
1N/A INOUT DWORD *resume_handle;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetFileEnum
1N/A ***********************************************************************
1N/A */
1N/Astruct mslm_NetFileInfoBuf2 {
1N/A DWORD fi2_id;
1N/A};
1N/A
1N/Astruct mslm_NetFileInfo2 {
1N/A DWORD entries_read;
1N/A SIZE_IS(entries_read)
1N/A struct mslm_NetFileInfoBuf2 *fi2;
1N/A};
1N/A
1N/Astruct mslm_NetFileInfoBuf3 {
1N/A DWORD fi3_id;
1N/A DWORD fi3_permissions;
1N/A DWORD fi3_num_locks;
1N/A LPTSTR fi3_pathname;
1N/A LPTSTR fi3_username;
1N/A};
1N/A
1N/Astruct mslm_NetFileInfo3 {
1N/A DWORD entries_read;
1N/A SIZE_IS(entries_read)
1N/A struct mslm_NetFileInfoBuf3 *fi3;
1N/A};
1N/A
1N/Aunion mslm_NetFileInfoResUnion {
1N/A CASE(2) struct mslm_NetFileInfo2 *info2;
1N/A CASE(3) struct mslm_NetFileInfo3 *info3;
1N/A DEFAULT char *nullptr;
1N/A};
1N/A
1N/Astruct mslm_NetFileInfo {
1N/A DWORD level;
1N/A DWORD switch_value;
1N/A SWITCH(switch_value)
1N/A union mslm_NetFileInfoResUnion ru;
1N/A};
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetFileEnum)
1N/Astruct mslm_NetFileEnum {
1N/A IN LPTSTR servername;
1N/A IN DWORD basepath;
1N/A IN DWORD username;
1N/A INOUT struct mslm_NetFileInfo info;
1N/A IN DWORD pref_max_len;
1N/A OUT DWORD total_entries;
1N/A INOUT DWORD *resume_handle;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetFileClose
1N/A *
1N/A * Close files using a file id reported by NetFileEnum.
1N/A ***********************************************************************
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetFileClose)
1N/Astruct mslm_NetFileClose {
1N/A IN LPTSTR servername;
1N/A IN DWORD file_id;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetShareGetInfo: netname is the name of a share.
1N/A *
1N/A * Levels:
1N/A * 1 Sets information about the shared resource: name, type
1N/A * of resource and a comment.
1N/A * 2 Sets information about the shared resource: name, type,
1N/A * permissions, password and number of connections.
1N/A * 501 Sets information about the shared resource: name, type
1N/A * of resource and a comment.
1N/A * 502 Sets information about the shared resource, including
1N/A * the name, type, permissions, number of connections etc.
1N/A * 1004 Specifies a comment for the shared resource.
1N/A * 1005 Specifies a set of flags describing the shared resource.
1N/A * 1006 Specifies the maximum number of concurrent connections
1N/A * that the shared resource can accommodate.
1N/A * 1501 Specifies the SECURITY_DESCRIPTOR for the share.
1N/A *
1N/A * Windows Me/98/95 supports level 50, which is similar to level 1.
1N/A *
1N/A * shi1005_flags: SHI1005_VALID_FLAGS_SET defines the set of flags that
1N/A * can be set with the NetShareSetInfo function. SHI1005_FLAGS_DFS and
1N/A * SHI1005_FLAGS_DFS_ROOT can only be returned, but not set.
1N/A *
1N/A * 0x01 SHI1005_FLAGS_DFS
1N/A * The specified share is present in a Dfs tree structure.
1N/A * This flag cannot be set with NetShareSetInfo.
1N/A *
1N/A * 0x02 SHI1005_FLAGS_DFS_ROOT
1N/A * The specified share is the root volume in a Dfs tree.
1N/A * This flag cannot be set with NetShareSetInfo.
1N/A *
1N/A * 0x30 CSC_MASK Client-side caching (CSC) state:
1N/A * 0x00 CSC_CACHE_MANUAL_REINT Automatic file-by-file
1N/A * reintegration not allowed.
1N/A * 0x10 CSC_CACHE_AUTO_REINT File-by-file reintegration allowed.
1N/A * 0x20 CSC_CACHE_VDO File opens do not need to be flowed.
1N/A * 0x30 CSC_CACHE_NONE CSC is disabled for this share.
1N/A *
1N/A * 0x0100 SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS
1N/A * The specified share disallows exclusive file opens,
1N/A * where reads to an open file are disallowed.
1N/A *
1N/A * 0x0200 SHI1005_FLAGS_FORCE_SHARED_DELETE
1N/A * Shared files in the specified share can be forcibly deleted.
1N/A *
1N/A * 0x0400 SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING
1N/A * Clients are allowed to cache the namespace of the share.
1N/A *
1N/A * 0x0800 SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM
1N/A * The server will filter directory entries based on the access
1N/A * permissions of the client. This flag is only supported on
1N/A * servers running Windows Server 2003 SP1.
1N/A * Note: The access-based enumeration (ABE) flag may also
1N/A * appear as SHI1005_FLAGS_ENFORCE_NAMESPACE_ACCESS.
1N/A ***********************************************************************
1N/A */
1N/Astruct mslm_NetShareGetInfo0 {
1N/A LPTSTR shi0_netname;
1N/A};
1N/A
1N/A
1N/Astruct mslm_NetShareGetInfo1 {
1N/A LPTSTR shi1_netname;
1N/A DWORD shi1_type; /* type of resource such as IPC$ */
1N/A LPTSTR shi1_comment;
1N/A};
1N/A
1N/A
1N/Astruct mslm_NetShareGetInfo2 {
1N/A LPTSTR shi2_netname;
1N/A DWORD shi2_type;
1N/A LPTSTR shi2_comment;
1N/A DWORD shi2_permissions;
1N/A DWORD shi2_max_uses;
1N/A DWORD shi2_current_uses;
1N/A LPTSTR shi2_path;
1N/A LPTSTR shi2_passwd;
1N/A};
1N/A
1N/Astruct mslm_NetShareGetInfo501 {
1N/A LPTSTR shi501_netname;
1N/A DWORD shi501_type;
1N/A LPTSTR shi501_comment;
1N/A DWORD shi501_reserved;
1N/A};
1N/A
1N/Astruct mslm_NetShareGetInfo502 {
1N/A LPTSTR shi502_netname;
1N/A DWORD shi502_type;
1N/A LPTSTR shi502_comment;
1N/A DWORD shi502_permissions;
1N/A DWORD shi502_max_uses;
1N/A DWORD shi502_current_uses;
1N/A LPTSTR shi502_path;
1N/A LPTSTR shi502_passwd;
1N/A DWORD shi502_reserved;
1N/A DWORD shi502_security_descriptor;
1N/A};
1N/A
1N/Astruct mslm_NetShareGetInfo1005 {
1N/A DWORD shi1005_flags;
1N/A};
1N/A
1N/Aunion mlsm_NetShareGetInfoResUnion {
1N/A CASE(0) struct mslm_NetShareGetInfo0 *info0;
1N/A CASE(1) struct mslm_NetShareGetInfo1 *info1;
1N/A CASE(2) struct mslm_NetShareGetInfo2 *info2;
1N/A CASE(501) struct mslm_NetShareGetInfo501 *info501;
1N/A CASE(502) struct mslm_NetShareGetInfo502 *info502;
1N/A CASE(1005) struct mslm_NetShareGetInfo1005 *info1005;
1N/A DEFAULT char *nullptr;
1N/A};
1N/A
1N/A
1N/Astruct mlsm_NetShareGetInfoRes {
1N/A DWORD switch_value;
1N/A SWITCH(switch_value)
1N/A union mlsm_NetShareGetInfoResUnion ru;
1N/A};
1N/A
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetShareGetInfo)
1N/Astruct mlsm_NetShareGetInfo {
1N/A IN LPTSTR servername;
1N/A IN REFERENCE LPTSTR netname;
1N/A IN DWORD level;
1N/A OUT struct mlsm_NetShareGetInfoRes result;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetShareSetInfo: netname is the name of a share.
1N/A * The levels and shi1005_flags are as described for NetShareGetInfo.
1N/A *
1N/A * Support for Access-based Enumeration (ABE) was added to Windows in
1N/A * Windows Server 2003 Service Pack 1. ABE filters directory contents
1N/A * (and other shared resources) returned via a share based on a user's
1N/A * access rights, i.e. a user would not see objects that are
1N/A * inaccessible to that user. ABE requests are made using info level
1N/A * 1005 with the value 0x0800 in the flags field (see NetShareGetInfo).
1N/A ***********************************************************************
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetShareSetInfo)
1N/Astruct mlsm_NetShareSetInfo {
1N/A IN LPTSTR servername;
1N/A IN REFERENCE LPTSTR netname;
1N/A IN DWORD level;
1N/A/*
1N/A * This should accept all the same levels as NetShareGetInfo
1N/A * but we always return ACCESS_DENIED for now. So there's no
1N/A * point in unmarshalling the share information.
1N/A *
1N/A * IN struct mlsm_NetShareGetInfoRes result;
1N/A */
1N/A OUT DWORD parm_err_ptr;
1N/A OUT DWORD parm_err;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetSessionEnum
1N/A *
1N/A * The NetSessionEnum function provides information about sessions
1N/A * established on a server.
1N/A *
1N/A * Only members of the Administrators or Account Operators local groups
1N/A * can successfully execute the NetSessionEnum function at level 1 or
1N/A * level 2. No special group membership is required for level 0 or level
1N/A * 10 calls.
1N/A *
1N/A * Windows NT/2000/XP: The parameter order is as follows.
1N/A *
1N/A * NET_API_STATUS NetSessionEnum(LPWSTR servername,
1N/A * LPWSTR UncClientName,
1N/A * LPWSTR username,
1N/A * DWORD level,
1N/A * LPBYTE *bufptr,
1N/A * DWORD prefmaxlen,
1N/A * LPDWORD entriesread,
1N/A * LPDWORD totalentries,
1N/A * LPDWORD resume_handle);
1N/A *
1N/A * Windows 95/98/Me: The calling application must use the cbBuffer parameter
1N/A * to specify the size, in bytes, of the information buffer pointed to by the
1N/A * pbBuffer parameter. (The cbBuffer parameter replaces the prefmaxlen
1N/A * parameter.) Neither a user name parameter nor a resume handle parameter is
1N/A * available on this platform. Therefore, the parameter list is as follows.
1N/A *
1N/A * API_FUNCTION NetSessionEnum(const char FAR *pszServer,
1N/A * short sLevel,
1N/A * char FAR *pbBuffer,
1N/A * unsigned short cbBuffer,
1N/A * unsigned short FAR *pcEntriesRead,
1N/A * unsigned short FAR *pcTotalAvail);
1N/A *
1N/A * Parameters
1N/A *
1N/A * servername
1N/A * [in] Pointer to a string that specifies the DNS or NetBIOS name of the
1N/A * remote server on which the function is to execute. If this parameter is
1N/A * NULL, the local computer is used.
1N/A * Windows NT 4.0 and earlier: This string must begin with \\.
1N/A *
1N/A * UncClientName
1N/A * [in] Pointer to a string that specifies the name of the computer session
1N/A * for which information is to be returned. If this parameter is NULL,
1N/A * NetSessionEnum returns information for all computer sessions on the server.
1N/A *
1N/A * username
1N/A * [in] Pointer to a string that specifies the name of the user for which
1N/A * information is to be returned. If this parameter is NULL, NetSessionEnum
1N/A * returns information for all users.
1N/A *
1N/A * level
1N/A * [in] Specifies the information level of the data. This parameter can be
1N/A * one of the following values.
1N/A * Windows NT/2000/XP: The following levels are valid.
1N/A * Value Meaning
1N/A * 0 Return the name of the computer that established the session.
1N/A * The bufptr parameter points to an array of SESSION_INFO_0
1N/A * structures.
1N/A * 1 Return the name of the computer, name of the user, and open files,
1N/A * pipes, and devices on the computer. The bufptr parameter points to
1N/A * an array of SESSION_INFO_1 structures.
1N/A * 2 In addition to the information indicated for level 1, return the
1N/A * type of client and how the user established the session. The bufptr
1N/A * parameter points to an array of SESSION_INFO_2 structures.
1N/A * 10 Return the name of the computer, name of the user, and active and
1N/A * idle times for the session. The bufptr parameter points to an array
1N/A * of SESSION_INFO_10 structures.
1N/A * 502 Return the name of the computer; name of the user; open files,
1N/A * pipes, and devices on the computer; and the name of the transport
1N/A * the client is using. The bufptr parameter points to an array of
1N/A * SESSION_INFO_502 structures.
1N/A *
1N/A * Windows 95/98/Me: The following level is valid.
1N/A * Value Meaning
1N/A * 50 Return the name of the computer, name of the user, open files on
1N/A * the computer, and the name of the transport protocol the client is
1N/A * using. The pbBuffer parameter points to an array of session_info_50
1N/A * structures.
1N/A *
1N/A * bufptr
1N/A * [out] Pointer to the buffer that receives the data. The format of this
1N/A * data depends on the value of the level parameter.
1N/A * Windows NT/2000/XP: This buffer is allocated by the system and must be
1N/A * freed using the NetApiBufferFree function. Note that you must free the
1N/A * buffer even if the function fails with ERROR_MORE_DATA.
1N/A * Windows 95/98/Me: The caller must allocate and deallocate this buffer.
1N/A *
1N/A * prefmaxlen
1N/A * [in] Specifies the preferred maximum length of returned data, in bytes.
1N/A * If you specify MAX_PREFERRED_LENGTH, the function allocates the amount
1N/A * of memory required for the data. If you specify another value in this
1N/A * parameter, it can restrict the number of bytes that the function returns.
1N/A * If the buffer size is insufficient to hold all entries, the function
1N/A * returns ERROR_MORE_DATA. For more information, see Network Management
1N/A * Function Buffers and Network Management Function Buffer Lengths.
1N/A *
1N/A * entriesread
1N/A * [out] Pointer to a value that receives the count of elements actually
1N/A * enumerated.
1N/A *
1N/A * totalentries
1N/A * [out] Pointer to a value that receives the total number of entries that
1N/A * could have been enumerated from the current resume position.
1N/A *
1N/A * resume_handle
1N/A * [in/out] Pointer to a value that contains a resume handle which is used
1N/A * to continue an existing session search. The handle should be zero on the
1N/A * first call and left unchanged for subsequent calls. If resume_handle is
1N/A * NULL, no resume handle is stored.
1N/A *
1N/A *
1N/A * SESSION_INFO_1
1N/A * ==============
1N/A * The SESSION_INFO_1 structure contains information about the session,
1N/A * including name of the computer; name of the user; and open files, pipes,
1N/A * and devices on the computer.
1N/A *
1N/A * Members
1N/A *
1N/A * sesi1_cname
1N/A * Pointer to a Unicode string specifying the name of the computer that
1N/A * established the session.
1N/A *
1N/A * sesi1_username
1N/A * Pointer to a Unicode string specifying the name of the user who established
1N/A * the session.
1N/A *
1N/A * sesi1_num_opens
1N/A * Specifies a DWORD value that contains the number of files, devices,
1N/A * and pipes opened during the session.
1N/A *
1N/A * sesi1_time
1N/A * Specifies a DWORD value that contains the number of seconds the session
1N/A * has been active.
1N/A *
1N/A * sesi1_idle_time
1N/A * Specifies a DWORD value that contains the number of seconds the session
1N/A * has been idle.
1N/A *
1N/A * sesi1_user_flags
1N/A * Specifies a DWORD value that describes how the user established the
1N/A * session. This member can be one of the following values:
1N/A * SESS_GUEST The user specified by the sesi1_username member
1N/A * established the session using a guest account.
1N/A * SESS_NOENCRYPTION The user specified by the sesi1_username member
1N/A * established the session without using password
1N/A * encryption.
1N/A ***********************************************************************
1N/A */
1N/A
1N/A#define SESS_GUEST 0x00000001
1N/A#define SESS_NOENCRYPTION 0x00000002
1N/A
1N/Astruct mslm_SESSION_INFO_0 {
1N/A LPTSTR sesi0_cname;
1N/A};
1N/AINFONRES_RESULT(mslm_SESSION_INFO, 0)
1N/A
1N/Astruct mslm_SESSION_INFO_1 {
1N/A LPTSTR sesi1_cname;
1N/A LPTSTR sesi1_uname;
1N/A DWORD sesi1_nopens;
1N/A DWORD sesi1_time;
1N/A DWORD sesi1_itime;
1N/A DWORD sesi1_uflags;
1N/A};
1N/AINFONRES_RESULT(mslm_SESSION_INFO, 1)
1N/A
1N/AINFONRES_DEFINITION(mslm_NetSessionEnum,
1N/A INFONRES_UNION_ENTRY(mslm_SESSION_INFO, 0)
1N/A INFONRES_UNION_ENTRY(mslm_SESSION_INFO, 1))
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetSessionEnum)
1N/Astruct mslm_NetSessionEnum {
1N/A IN LPTSTR servername;
1N/A IN DWORD unc_clientname;
1N/A IN DWORD username;
1N/A INOUT DWORD level;
1N/A INOUT struct mslm_NetSessionEnum_result result;
1N/A IN DWORD pref_max_len;
1N/A OUT DWORD total_entries;
1N/A INOUT DWORD *resume_handle;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A ***********************************************************************
1N/A * NetSessionDel (Platform SDK: Network Management)
1N/A *
1N/A * The NetSessionDel function ends a network session between a server
1N/A * and a workstation.
1N/A *
1N/A * Security Requirements
1N/A * Only members of the Administrators or Account Operators local group
1N/A * can successfully execute the NetSessionDel function.
1N/A *
1N/A * Windows NT/2000/XP: The parameter order is as follows.
1N/A *
1N/A * NET_API_STATUS NetSessionDel(LPWSTR servername,
1N/A * LPWSTR UncClientName,
1N/A * LPWSTR username);
1N/A *
1N/A * Windows 95/98/Me: The sReserved parameter replaces the username
1N/A * parameter. For more information, see the following Remarks section.
1N/A * The parameter list is as follows.
1N/A *
1N/A * API_FUNCTION NetSessionDel(const char FAR *pszServer,
1N/A * const char FAR *pszClientName,
1N/A * short sReserved);
1N/A *
1N/A * Parameters
1N/A *
1N/A * servername
1N/A * [in] Pointer to a string that specifies the DNS or NetBIOS name
1N/A * of the remote server on which the function is to execute. If this
1N/A * parameter is NULL, the local computer is used.
1N/A * Windows NT 4.0 and earlier: This string must begin with \\.
1N/A *
1N/A * UncClientName
1N/A * [in] Pointer to a string that specifies the computer name of the
1N/A * client to disconnect. If UncClientName is NULL, then all the sessions
1N/A * of the user identified by the username parameter will be deleted on
1N/A * the server specified by servername. For more information, see
1N/A * NetSessionEnum.
1N/A *
1N/A * username
1N/A * [in] Pointer to a string that specifies the name of the user whose
1N/A * session is to be terminated. If this parameter is NULL, all users'
1N/A * sessions from the client specified by the UncClientName parameter
1N/A * are to be terminated.
1N/A *
1N/A * Remarks
1N/A * Windows 95/98/Me: You must specify the session key in the sReserved
1N/A * parameter when you call NetSessionDel. The session key is returned by
1N/A * the NetSessionEnum function or the NetSessionGetInfo function in the
1N/A * sesi50_key member of the session_info_50 structure.
1N/A ***********************************************************************
1N/A */
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetSessionDel)
1N/Astruct mslm_NetSessionDel {
1N/A IN LPTSTR servername;
1N/A IN LPTSTR unc_clientname;
1N/A IN LPTSTR username;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/A/*
1N/A * SRVSVC NetServerGetInfo (
1N/A * IN LPTSTR servername,
1N/A * IN DWORD level,
1N/A * OUT union switch(level) {
1N/A * case 100: _SERVER_INFO_100 * p100;
1N/A * case 101: _SERVER_INFO_101 * p101;
1N/A * case 102: _SERVER_INFO_102 * p102;
1N/A * } bufptr,
1N/A * OUT DWORD status
1N/A * )
1N/A */
1N/A
1N/A/* for svX_platform */
1N/A#define SV_PLATFORM_ID_OS2 400
1N/A#define SV_PLATFORM_ID_NT 500
1N/A
1N/A/* Bit-mapped values for svX_type fields */
1N/A#define SV_TYPE_WORKSTATION 0x00000001
1N/A#define SV_TYPE_SERVER 0x00000002
1N/A#define SV_TYPE_SQLSERVER 0x00000004
1N/A#define SV_TYPE_DOMAIN_CTRL 0x00000008
1N/A#define SV_TYPE_DOMAIN_BAKCTRL 0x00000010
1N/A#define SV_TYPE_TIME_SOURCE 0x00000020
1N/A#define SV_TYPE_AFP 0x00000040
1N/A#define SV_TYPE_NOVELL 0x00000080
1N/A#define SV_TYPE_DOMAIN_MEMBER 0x00000100
1N/A#define SV_TYPE_PRINTQ_SERVER 0x00000200
1N/A#define SV_TYPE_DIALIN_SERVER 0x00000400
1N/A#define SV_TYPE_XENIX_SERVER 0x00000800
1N/A#define SV_TYPE_SERVER_UNIX SV_TYPE_XENIX_SERVER
1N/A#define SV_TYPE_NT 0x00001000
1N/A#define SV_TYPE_WFW 0x00002000
1N/A
1N/A#define SV_TYPE_SERVER_MFPN 0x00004000
1N/A#define SV_TYPE_SERVER_NT 0x00008000
1N/A#define SV_TYPE_POTENTIAL_BROWSER 0x00010000
1N/A#define SV_TYPE_BACKUP_BROWSER 0x00020000
1N/A#define SV_TYPE_MASTER_BROWSER 0x00040000
1N/A#define SV_TYPE_DOMAIN_MASTER 0x00080000
1N/A#define SV_TYPE_SERVER_OSF 0x00100000
1N/A#define SV_TYPE_SERVER_VMS 0x00200000
1N/A#define SV_TYPE_WINDOWS 0x00400000 /* Windows95 and above */
1N/A#define SV_TYPE_ALTERNATE_XPORT 0x20000000 /* return list for
1N/A * alternate transport */
1N/A#define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 /* Return local list only */
1N/A#define SV_TYPE_DOMAIN_ENUM 0x80000000
1N/A#define SV_TYPE_ALL 0xFFFFFFFF /* handy for NetServerEnum2 */
1N/A
1N/A/* NT-Server 4.0 sends 0x0006_120B */
1N/A#define SV_TYPE_SENT_BY_NT_4_0_SERVER \
1N/A ( SV_TYPE_WORKSTATION \
1N/A | SV_TYPE_SERVER \
1N/A | SV_TYPE_DOMAIN_CTRL \
1N/A | SV_TYPE_NT \
1N/A | SV_TYPE_BACKUP_BROWSER \
1N/A | SV_TYPE_MASTER_BROWSER)
1N/A/* NT-workstation 4.0 send 0x0004_1013 */
1N/A#define SV_TYPE_SENT_BY_NT_4_0_WORKSTATION \
1N/A ( SV_TYPE_WORKSTATION \
1N/A | SV_TYPE_SERVER \
1N/A | SV_TYPE_DOMAIN_BAKCTRL \
1N/A | SV_TYPE_NT \
1N/A | SV_TYPE_MASTER_BROWSER)
1N/A
1N/A/* Special value for sv102_disc that specifies infinite disconnect time */
1N/A#define SV_NODISC (-1L) /* No autodisconnect timeout enforced */
1N/A
1N/A/* Values of svX_security field */
1N/A#define SV_USERSECURITY 1
1N/A#define SV_SHARESECURITY 0
1N/A
1N/A/* Values of svX_hidden field */
1N/A#define SV_HIDDEN 1
1N/A#define SV_VISIBLE 0
1N/A
1N/A
1N/A/* Let's get some info already */
1N/Astruct mslm_SERVER_INFO_100 {
1N/A DWORD sv100_platform_id;
1N/A LPTSTR sv100_name;
1N/A};
1N/A
1N/Astruct mslm_SERVER_INFO_101 {
1N/A DWORD sv101_platform_id;
1N/A LPTSTR sv101_name;
1N/A DWORD sv101_version_major;
1N/A DWORD sv101_version_minor;
1N/A DWORD sv101_type;
1N/A LPTSTR sv101_comment;
1N/A};
1N/A
1N/Astruct mslm_SERVER_INFO_102 {
1N/A DWORD sv102_platform_id;
1N/A LPTSTR sv102_name;
1N/A DWORD sv102_version_major;
1N/A DWORD sv102_version_minor;
1N/A DWORD sv102_type;
1N/A LPTSTR sv102_comment;
1N/A DWORD sv102_users;
1N/A DWORD sv102_disc;
1N/A DWORD sv102_hidden; /* BOOL */
1N/A DWORD sv102_announce;
1N/A DWORD sv102_anndelta;
1N/A DWORD sv102_licenses;
1N/A LPTSTR sv102_userpath;
1N/A};
1N/A
1N/Aunion mslm_NetServerGetInfo_ru {
1N/A CASE(100) struct mslm_SERVER_INFO_100 *bufptr100;
1N/A CASE(101) struct mslm_SERVER_INFO_101 *bufptr101;
1N/A CASE(102) struct mslm_SERVER_INFO_102 *bufptr102;
1N/A DEFAULT char *nullptr;
1N/A};
1N/A
1N/Astruct mslm_NetServerGetInfo_result {
1N/A DWORD level;
1N/A SWITCH(level)
1N/A union mslm_NetServerGetInfo_ru bufptr;
1N/A};
1N/A
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetServerGetInfo)
1N/Astruct mslm_NetServerGetInfo {
1N/A IN LPTSTR servername;
1N/A IN DWORD level;
1N/A OUT struct mslm_NetServerGetInfo_result result;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * SRVSVC NetRemoteTOD (
1N/A * IN LPTSTR servername,
1N/A * OUT _TIME_OF_DAY_INFO *bufptr,
1N/A * OUT long status
1N/A * )
1N/A */
1N/A
1N/Astruct mslm_TIME_OF_DAY_INFO {
1N/A DWORD tod_elapsedt;
1N/A DWORD tod_msecs;
1N/A DWORD tod_hours;
1N/A DWORD tod_mins;
1N/A DWORD tod_secs;
1N/A DWORD tod_hunds;
1N/A DWORD tod_timezone;
1N/A DWORD tod_tinterval;
1N/A DWORD tod_day;
1N/A DWORD tod_month;
1N/A DWORD tod_year;
1N/A DWORD tod_weekday;
1N/A};
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetRemoteTOD)
1N/Astruct mslm_NetRemoteTOD {
1N/A IN LPTSTR servername;
1N/A OUT struct mslm_TIME_OF_DAY_INFO *bufptr;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A#define NAMETYPE_USER 1
1N/A#define NAMETYPE_PASSWORD 2
1N/A#define NAMETYPE_GROUP 3
1N/A#define NAMETYPE_COMPUTER 4
1N/A#define NAMETYPE_EVENT 5
1N/A#define NAMETYPE_DOMAIN 6
1N/A#define NAMETYPE_SERVICE 7
1N/A#define NAMETYPE_NET 8
1N/A#define NAMETYPE_SHARE 9
1N/A#define NAMETYPE_MESSAGE 10
1N/A#define NAMETYPE_MESSAGEDEST 11
1N/A#define NAMETYPE_SHAREPASSWORD 12
1N/A#define NAMETYPE_WORKGROUP 13
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetNameValidate)
1N/Astruct mslm_NetNameValidate {
1N/A IN LPTSTR servername;
1N/A IN REFERENCE LPTSTR pathname;
1N/A IN DWORD type;
1N/A IN DWORD flags;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * SRVSVC NetShareEnum (
1N/A * IN LPTSTR servername,
1N/A * IN DWORD level;
1N/A * OUT union switch(level) {
1N/A * case 0: struct {
1N/A * DWORD entriesread;
1N/A * [size_is(entriesread)]
1N/A * _SHARE_INFO_0 *entries;
1N/A * } *bufptr0;
1N/A * case 1: struct {
1N/A * DWORD entriesread;
1N/A * [size_is(entriesread)]
1N/A * _SHARE_INFO_1 *entries;
1N/A * } *bufptr1;
1N/A * ...
1N/A * } bufptr,
1N/A * IN DWORD prefmaxlen,
1N/A * OUT DWORD totalentries,
1N/A * IN OUT DWORD ?* resume_handle,
1N/A * OUT DWORD status
1N/A * )
1N/A */
1N/A
1N/A/*
1N/A * Share types for shiX_type fields - duplicated from cifs.h
1N/A */
1N/A#ifndef _SHARE_TYPES_DEFINED_
1N/A#define _SHARE_TYPES_DEFINED_
1N/A#define STYPE_DISKTREE 0x00000000
1N/A#define STYPE_PRINTQ 0x00000001
1N/A#define STYPE_DEVICE 0x00000002
1N/A#define STYPE_IPC 0x00000003
1N/A#define STYPE_MASK 0x0000000F
1N/A#define STYPE_DFS 0x00000064
1N/A#define STYPE_HIDDEN 0x80000000
1N/A#define STYPE_SPECIAL 0x80000000
1N/A#endif /* _SHARE_TYPES_DEFINED_ */
1N/A
1N/A/* Maximum uses for shiX_max_uses fields */
1N/A#define SHI_USES_UNLIMITED (DWORD)-1
1N/A
1N/A
1N/Astruct mslm_SHARE_INFO_0 {
1N/A LPTSTR shi0_netname;
1N/A};
1N/AINFONRES_RESULT(mslm_SHARE_INFO,0)
1N/A
1N/Astruct mslm_SHARE_INFO_1 {
1N/A LPTSTR shi1_netname;
1N/A DWORD shi1_type;
1N/A LPTSTR shi1_remark;
1N/A};
1N/AINFONRES_RESULT(mslm_SHARE_INFO,1)
1N/A
1N/Astruct mslm_SHARE_INFO_2 {
1N/A LPTSTR shi2_netname;
1N/A DWORD shi2_type;
1N/A LPTSTR shi2_remark;
1N/A DWORD shi2_permissions;
1N/A DWORD shi2_max_uses;
1N/A DWORD shi2_current_uses;
1N/A LPTSTR shi2_path;
1N/A LPTSTR shi2_passwd;
1N/A};
1N/AINFONRES_RESULT(mslm_SHARE_INFO,2)
1N/A
1N/A/*
1N/A * shi501_flags must be zero.
1N/A */
1N/Astruct mslm_SHARE_INFO_501 {
1N/A LPTSTR shi501_netname;
1N/A DWORD shi501_type;
1N/A LPTSTR shi501_remark;
1N/A DWORD shi501_flags;
1N/A};
1N/AINFONRES_RESULT(mslm_SHARE_INFO,501)
1N/A
1N/A/*
1N/A * Note: shi502_security_descriptor should be a pointer to a
1N/A * security descriptor (W32SEC_SECURITY_DESCRIPTOR):
1N/A * PSECURITY_DESCRIPTOR shi502_security_descriptor;
1N/A *
1N/A * For now use a DWORD and set it to zero.
1N/A */
1N/Astruct mslm_SHARE_INFO_502 {
1N/A LPTSTR shi502_netname;
1N/A DWORD shi502_type;
1N/A LPTSTR shi502_remark;
1N/A DWORD shi502_permissions;
1N/A DWORD shi502_max_uses;
1N/A DWORD shi502_current_uses;
1N/A LPTSTR shi502_path;
1N/A LPTSTR shi502_passwd;
1N/A DWORD shi502_reserved;
1N/A DWORD shi502_security_descriptor;
1N/A};
1N/AINFONRES_RESULT(mslm_SHARE_INFO,502)
1N/A
1N/Aunion mslm_NetShareAddInfo_u {
1N/A CASE(2) struct mslm_SHARE_INFO_2 *info2;
1N/A CASE(502) struct mslm_SHARE_INFO_502 *info502;
1N/A};
1N/A
1N/Astruct mslm_NetShareAddInfo {
1N/A DWORD switch_value;
1N/A SWITCH(switch_value)
1N/A union mslm_NetShareAddInfo_u un;
1N/A};
1N/A
1N/A
1N/AOPERATION(SRVSVC_OPNUM_NetShareAdd)
1N/Astruct mslm_NetShareAdd {
1N/A IN LPTSTR servername;
1N/A IN DWORD level;
1N/A IN struct mslm_NetShareAddInfo info;
1N/A INOUT DWORD *parm_err;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A
1N/AINFONRES_DEFINITION(mslm_NetShareEnum,
1N/A INFONRES_UNION_ENTRY(mslm_SHARE_INFO,0)
1N/A INFONRES_UNION_ENTRY(mslm_SHARE_INFO,1)
1N/A INFONRES_UNION_ENTRY(mslm_SHARE_INFO,2)
1N/A INFONRES_UNION_ENTRY(mslm_SHARE_INFO,501)
1N/A INFONRES_UNION_ENTRY(mslm_SHARE_INFO,502))
1N/A
1N/A/*
1N/A * NetShareEnum: enumerate all shares (see also NetShareEnumSticky).
1N/A * Note: the server should ignore the content of servername.
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetShareEnum)
1N/Astruct mslm_NetShareEnum {
1N/A IN LPTSTR servername;
1N/A INOUT DWORD level;
1N/A INOUT struct mslm_NetShareEnum_result result;
1N/A IN DWORD prefmaxlen;
1N/A OUT DWORD totalentries;
1N/A INOUT DWORD *resume_handle;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * Delete a share. The reserved field appears in netmon
1N/A * but I've left it out in case it's not always present.
1N/A * This won't affect RPC processing.
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetShareDel)
1N/Astruct mslm_NetShareDel {
1N/A IN LPTSTR servername;
1N/A IN REFERENCE LPTSTR netname;
1N/A /* IN DWORD reserved; */
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * NetShareEnumSticky is the same as NetShareEnum except that
1N/A * STYPE_SPECIAL (hidden or special) shares are not returned.
1N/A * Note: the server should ignore the content of servername.
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetShareEnumSticky)
1N/Astruct mslm_NetShareEnumSticky {
1N/A IN LPTSTR servername;
1N/A INOUT DWORD level;
1N/A INOUT struct mslm_NetShareEnum_result result;
1N/A IN DWORD prefmaxlen;
1N/A OUT DWORD totalentries;
1N/A INOUT DWORD *resume_handle;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * When you install Windows NT Server Tools on a Win95 client,
1N/A * a security tab will be added to properties dialog box of files/folders.
1N/A * Within this security tab, when you try to get/set permissions on a
1N/A * file/folder the next two RPC calls are used.
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetGetFileSecurity)
1N/Astruct mslm_NetGetFileSecurity {
1N/A IN LPTSTR servername;
1N/A IN LPTSTR sharename;
1N/A IN REFERENCE LPTSTR filename;
1N/A IN DWORD securityinfo;
1N/A
1N/A /*
1N/A * Right now, we can't send back SD of the requested object
1N/A * in MLRPC code, so we just reply with access denied error
1N/A * code. Thus, this output declaration is only valid in this
1N/A * case i.e., it's not complete.
1N/A * It looks like:
1N/A *
1N/A * A Pointer
1N/A * A Length
1N/A *
1N/A * A Pointer
1N/A * A Length (equal to the prev length)
1N/A * A buffer
1N/A *
1N/A * return value
1N/A */
1N/A OUT DWORD length;
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * This is the request:
1N/A *
1N/A * R_SRVSVC: RPC Client call srvsvc:NetrpSetFileSecurity(..)
1N/A * R_SRVSVC: SRVSVC_HANDLE ServerName = \\WK76-177
1N/A * R_SRVSVC: LPWSTR ShareName = AFSHIN
1N/A * R_SRVSVC: LPWSTR lpFileName = \salek.txt
1N/A * R_SRVSVC: SECURITY_INFORMATION SecurityInformation = 4 (0x4)
1N/A * -R_SRVSVC: PADT_SECURITY_DESCRIPTOR SecurityDescriptor {..}
1N/A * R_SRVSVC: DWORD Length = 64 (0x40)
1N/A * R_SRVSVC: LPBYTE Buffer = 4496048 (0x449AB0)
1N/A * R_SRVSVC: LPBYTE Buffer [..] = 01 00 04 80 00 00 00 00 00 00 00 00 00 00 00
1N/A * ...
1N/A *
1N/A * 000000A0 00 83 46 00 0B 00 00 00 00 00 00 00 0B 00 ..F...........
1N/A * 000000B0 00 00 5C 00 5C 00 57 00 4B 00 37 00 36 00 2D 00 ..\.\.W.K.7.6.-.
1N/A * 000000C0 31 00 37 00 37 00 00 00 08 00 16 83 46 00 07 00 1.7.7.......F...
1N/A * 000000D0 00 00 00 00 00 00 07 00 00 00 41 00 46 00 53 00 ..........A.F.S.
1N/A * 000000E0 48 00 49 00 4E 00 00 00 00 00 0B 00 00 00 00 00 H.I.N...........
1N/A * 000000F0 00 00 0B 00 00 00 5C 00 73 00 61 00 6C 00 65 00 ......\.s.a.l.e.
1N/A * 00000100 6B 00 2E 00 74 00 78 00 74 00 00 00 00 00 04 00 k...t.x.t.......
1N/A * 00000110 00 00 40 00 00 00 B0 9A 44 00 40 00 00 00 01 00 ..@.....D.@.....
1N/A * 00000120 04 80 00 00 00 00 00 00 00 00 00 00 00 00 14 00 ................
1N/A * 00000130 00 00 02 00 2C 00 01 00 00 00 00 00 24 00 00 00 ....,.......$...
1N/A * 00000140 00 A0 01 05 00 00 00 00 00 05 15 00 00 00 1A 24 ...............$
1N/A * 00000150 44 38 90 00 0F 02 65 3A BE 4C FF 03 00 00 00 00 D8....e:.L......
1N/A * 00000160 00 00 00 00 00 00 00 00 00 00 ..........
1N/A */
1N/AOPERATION(SRVSVC_OPNUM_NetSetFileSecurity)
1N/Astruct mslm_NetSetFileSecurity {
1N/A IN LPTSTR servername;
1N/A IN LPTSTR sharename;
1N/A IN REFERENCE LPTSTR filename;
1N/A IN DWORD securityinfo;
1N/A /*
1N/A * IN Security Descriptor (looks like):
1N/A * Length1
1N/A * Pointer
1N/A * Length2 (== Length1)
1N/A * buffer itself
1N/A */
1N/A
1N/A OUT DWORD status;
1N/A};
1N/A
1N/A/*
1N/A * The SRVSVC already
1N/A */
1N/AINTERFACE(0)
1N/Aunion srvsvc_interface {
1N/A CASE(SRVSVC_OPNUM_NetConnectEnum)
1N/A struct mslm_NetConnectEnum NetConnectEnum;
1N/A CASE(SRVSVC_OPNUM_NetFileEnum)
1N/A struct mslm_NetFileEnum NetFileEnum;
1N/A CASE(SRVSVC_OPNUM_NetFileClose)
1N/A struct mslm_NetFileClose NetFileClose;
1N/A CASE(SRVSVC_OPNUM_NetShareGetInfo)
1N/A struct mlsm_NetShareGetInfo NetShareGetInfo;
1N/A CASE(SRVSVC_OPNUM_NetShareSetInfo)
1N/A struct mlsm_NetShareGetInfo NetShareSetInfo;
1N/A CASE(SRVSVC_OPNUM_NetSessionDel)
1N/A struct mslm_NetSessionDel NetSessionDel;
1N/A CASE(SRVSVC_OPNUM_NetSessionEnum)
1N/A struct mslm_NetSessionEnum NetSessionEnum;
1N/A CASE(SRVSVC_OPNUM_NetServerGetInfo)
1N/A struct mslm_NetServerGetInfo NetServerGetInfo;
1N/A CASE(SRVSVC_OPNUM_NetRemoteTOD)
1N/A struct mslm_NetRemoteTOD NetRemoteTOD;
1N/A CASE(SRVSVC_OPNUM_NetNameValidate)
1N/A struct mslm_NetNameValidate NetNameValidate;
1N/A CASE(SRVSVC_OPNUM_NetShareAdd)
1N/A struct mslm_NetShareAdd NetShareAdd;
1N/A CASE(SRVSVC_OPNUM_NetShareDel)
1N/A struct mslm_NetShareDel NetShareDel;
1N/A CASE(SRVSVC_OPNUM_NetShareEnum)
1N/A struct mslm_NetShareEnum NetShareEnum;
1N/A CASE(SRVSVC_OPNUM_NetShareEnumSticky)
1N/A struct mslm_NetShareEnumSticky NetShareEnumSticky;
1N/A CASE(SRVSVC_OPNUM_NetGetFileSecurity)
1N/A struct mslm_NetGetFileSecurity NetGetFileSecurity;
1N/A CASE(SRVSVC_OPNUM_NetSetFileSecurity)
1N/A struct mslm_NetSetFileSecurity NetSetFileSecurity;
1N/A};
1N/Atypedef union srvsvc_interface srvsvc_interface_t;
1N/AEXTERNTYPEINFO(srvsvc_interface)
1N/A
1N/A
1N/A
1N/A/*
1N/A * WKSSVC - Workstation Service
1N/A */
1N/A
1N/A/* Windows NT */
1N/A#define WKSSVC_OPNUM_NetWkstaGetInfo 0x00
1N/A#define WKSSVC_OPNUM_NetWkstaSetInfo 0x01
1N/A#define WKSSVC_OPNUM_NetWkstaUserEnum 0x02
1N/A#define WKSSVC_OPNUM_NetWkstaUserGetInfo 0x03
1N/A#define WKSSVC_OPNUM_NetWkstaUserSetInfo 0x04
1N/A#define WKSSVC_OPNUM_NetWkstaTransportEnum 0x05
1N/A#define WKSSVC_OPNUM_NetWkstaTransportAdd 0x06
1N/A#define WKSSVC_OPNUM_NetWkstaTransportDel 0x07
1N/A#define WKSSVC_OPNUM_NetUseAdd 0x08
1N/A#define WKSSVC_OPNUM_NetUseGetInfo 0x09
1N/A#define WKSSVC_OPNUM_NetUseDel 0x0a
1N/A#define WKSSVC_OPNUM_NetUseEnum 0x0b
1N/A#define WKSSVC_OPNUM_NetMessageBufferSend 0x0c
1N/A#define WKSSVC_OPNUM_NetWkstaStatisticsGet 0x0d
1N/A#define WKSSVC_OPNUM_NetLogonDomainNameAdd 0x0e
1N/A
1N/A/* Windows 2000 */
1N/A#define WKSSVC_OPNUM_NetLogonDomainNameDel 0x0f
1N/A#define WKSSVC_OPNUM_NetJoinDomain 0x10
1N/A#define WKSSVC_OPNUM_NetUnjoinDomain 0x11
1N/A#define WKSSVC_OPNUM_NetValidateName 0x12
1N/A#define WKSSVC_OPNUM_NetRenameMachineInDomain 0x13
1N/A#define WKSSVC_OPNUM_NetGetJoinInformation 0x14
1N/A#define WKSSVC_OPNUM_NetGetJoinableOUs 0x15
1N/A#define WKSSVC_OPNUM_NetJoinDomain2 0x16
1N/A#define WKSSVC_OPNUM_NetUnjoinDomain2 0x17
1N/A#define WKSSVC_OPNUM_NetRenameMachineInDomain2 0x18
1N/A#define WKSSVC_OPNUM_NetValidateName2 0x19
1N/A#define WKSSVC_OPNUM_NetGetJoinableOUs2 0x1a
1N/A
1N/A/* Windows XP and Windows Server 2003 */
1N/A#define WKSSVC_OPNUM_NetAddAlternateComputerName 0x1b
1N/A#define WKSSVC_OPNUM_NetRemoveAlternateComputerName 0x1c
1N/A#define WKSSVC_OPNUM_NetSetPrimaryComputerName 0x1d
1N/A#define WKSSVC_OPNUM_NetEnumerateComputerNames 0x1e
1N/A#define WKSSVC_OPNUM_NetWorkstationResetDfsCache 0x1f
1N/A
1N/A
1N/Astruct mslm_WKSTA_INFO_100 {
1N/A DWORD wki100_platform_id;
1N/A LPTSTR wki100_computername;
1N/A LPTSTR wki100_langroup;
1N/A DWORD wki100_ver_major;
1N/A DWORD wki100_ver_minor;
1N/A};
1N/A
1N/A/* NetWkstaGetInfo only. System information - user access */
1N/Astruct mslm_WKSTA_INFO_101 {
1N/A DWORD wki101_platform_id;
1N/A LPTSTR wki101_computername;
1N/A LPTSTR wki101_langroup;
1N/A DWORD wki101_ver_major;
1N/A DWORD wki101_ver_minor;
1N/A LPTSTR wki101_lanroot;
1N/A};
1N/A
1N/A/* NetWkstaGetInfo only. System information - admin or operator access */
1N/Astruct mslm_WKSTA_INFO_102 {
1N/A DWORD wki102_platform_id;
1N/A LPTSTR wki102_computername;
1N/A LPTSTR wki102_langroup;
1N/A DWORD wki102_ver_major;
1N/A DWORD wki102_ver_minor;
1N/A LPTSTR wki102_lanroot;
1N/A DWORD wki102_logged_on_users;
1N/A};
1N/A
1N/Astruct mslm_WKSTA_INFO_502 {
1N/A DWORD char_wait;
1N/A DWORD collection_time;
1N/A DWORD maximum_collection_count;
1N/A DWORD keep_connection;
1N/A DWORD max_commands;
DWORD session_timeout;
DWORD size_char_buf;
DWORD max_threads;
DWORD lock_quota;
DWORD lock_increment;
DWORD lock_maximum;
DWORD pipe_increment;
DWORD pipe_maximum;
DWORD cache_file_timeout;
DWORD dormant_file_limit;
DWORD read_ahead_throughput;
DWORD num_mailslot_buffers;
DWORD num_srv_announce_buffers;
DWORD max_illegal_dgram_events;
DWORD dgram_event_reset_freq;
DWORD log_election_packets;
DWORD use_opportunistic_locking;
DWORD use_unlock_behind;
DWORD use_close_behind;
DWORD buf_named_pipes;
DWORD use_lock_read_unlock;
DWORD utilize_nt_caching;
DWORD use_raw_read;
DWORD use_raw_write;
DWORD use_write_raw_data;
DWORD use_encryption;
DWORD buf_files_deny_write;
DWORD buf_read_only_files;
DWORD force_core_create_mode;
DWORD use_512_byte_max_transfer;
};
INFO1RES_DEFINITION(mslm_NetWkstaGetInfo,
INFO1RES_UNION_ENTRY(mslm_WKSTA_INFO,100)
INFO1RES_UNION_ENTRY(mslm_WKSTA_INFO,101)
INFO1RES_UNION_ENTRY(mslm_WKSTA_INFO,102)
INFO1RES_UNION_ENTRY(mslm_WKSTA_INFO,502))
INFO1RESBUF_DEFINITION(mslm_NetWkstaGetInfo,
INFO1RESBUF_UNION_ENTRY(mslm_WKSTA_INFO,100)
INFO1RESBUF_UNION_ENTRY(mslm_WKSTA_INFO,101)
INFO1RESBUF_UNION_ENTRY(mslm_WKSTA_INFO,102)
INFO1RESBUF_UNION_ENTRY(mslm_WKSTA_INFO,502))
OPERATION(WKSSVC_OPNUM_NetWkstaGetInfo)
struct mslm_NetWkstaGetInfo {
IN LPTSTR servername;
IN DWORD level;
OUT struct mslm_NetWkstaGetInfo_result result;
OUT DWORD status;
};
/*
***********************************************************************
* NetWkstaTransportEnum
***********************************************************************
*/
struct mslm_NetWkstaTransportInfo0 {
DWORD quality_of_service;
DWORD num_vcs;
LPTSTR transport_name;
LPTSTR transport_address;
DWORD wan_ish;
};
struct mslm_NetWkstaTransportCtr0 {
DWORD count;
SIZE_IS(count)
struct mslm_NetWkstaTransportInfo0 *ti0;
};
union mslm_NetWkstaTransportInfo_ru {
CASE(0) struct mslm_NetWkstaTransportCtr0 *info0;
DEFAULT char *nullptr;
};
struct mslm_NetWkstaTransportInfo {
DWORD address;
DWORD level;
SWITCH(level)
union mslm_NetWkstaTransportInfo_ru ru;
};
OPERATION(WKSSVC_OPNUM_NetWkstaTransportEnum)
struct mslm_NetWkstaTransportEnum {
IN LPTSTR servername;
INOUT struct mslm_NetWkstaTransportInfo info;
IN DWORD pref_max_len;
OUT DWORD total_entries;
INOUT DWORD *resume_handle;
OUT DWORD status;
};
/*
* The WKSSVC already
*/
INTERFACE(0)
union wkssvc_interface {
CASE(WKSSVC_OPNUM_NetWkstaGetInfo)
struct mslm_NetWkstaGetInfo NetWkstaGetInfo;
CASE(WKSSVC_OPNUM_NetWkstaTransportEnum)
struct mslm_NetWkstaTransportEnum NetWkstaTransportEnum;
};
typedef union wkssvc_interface wkssvc_interface_t;
EXTERNTYPEINFO(wkssvc_interface)
#endif /* _MLSVC_LANMAN_NDL_ */