srvsvc.ndl revision 29bd28862cfb8abbd3a0f0a4b17e08bbc3652836
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borrego * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LanMan RPC (WKSSVC and SRVSVC) interface definitions.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * WARNING: The cpp(1) macros in this file are not understood by
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * TYPE CONSTRUCTOR MACROS FOR INFORMATION RESULTS
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ****************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This is an explanation of the macros that follow this comment.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The LANMAN API's look something like this:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NetXXXGetInfo (
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN char * servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN char * XXX_name,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN int level,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT char ** bufptr);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The bufptr is a pointer-to-pointer (**). The NetXXXGetInfo() function
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * malloc()s memory, and sets *bufptr to the memory. The API's
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * are undiscriminated about what bufptr really points to.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * However, for RPI (Remote Procedure Interface), this just won't fly.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * We have to know what the result data looks like in order to
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * properly (un)marshall it.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * As best we can determine, the MSC developers use an RPI that looks
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * like this (approximately in IDL):
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * RemoteNetXXXGetInfo (
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN char * servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN char * XXX_name,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN int level,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT union switch(level) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case(1): XXX_INFO_1 * info1;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case(2): XXX_INFO_2 * info2;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * } bufptr);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The level guides the (un)marshalling as it follows the pointer.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * DCE(MS) IDL will automatically form a structure for the union
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * which looks about like this (much as Sun/RPC does):
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * int _keyvalue_;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXX_INFO_1 *info1;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXX_INFO_2 *info2;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * } bufptr;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This struct is not made visible to the application. It is purely
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * an internal (automagic) thing. However, ndrgen does not do this.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The ndrgen input MUST remain a valid C header file, and all
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct and union declarations must be exact, and we (would) have
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * to tediously code sequences like this (approximately NDL)):
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * union XXXGetInfo_result_u {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [case(1)]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXX_INFO_1 * info1;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [case(2)]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXX_INFO_2 * info2;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct XXXGetInfo_result {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * int level;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * union XXXGetInfo_result_u bufptr;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct XXXGetInfo_param { // still have to code this one
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] char * servername;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] ushort level;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [out] struct XXXGetInfo_result result;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This is error prone and difficult to write, and more difficult
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and distracting to read. It is hard to pick through the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * necessary evils and see what's really going on. To mitigate
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the situation, we have a series of macros which generate
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the tedious code, and are easily recognized as supporting
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fluff rather than important structures:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * INFO1RES_DEFINITION(XXXGetInfo,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * INFO1RES_UNION_ENTRY(XXXGetInfo, 1)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * INFO1RES_UNION_ENTRY(XXXGetInfo, 2))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * structt XXXGetInfo_param { // still have to code this one
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] char * servername;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] ushort level;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [out] struct XXXGetInfo_result result;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The INFO1RES_DEFINITION macro defines two types:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * union ...__ru {...}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct ..._result { DWORD level; union ..._ru bufptr; }
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * There is a similar macro, INFO1RESBUF_DEFINITION, which defines
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * actual space rather than just pointers. It defines:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * union ...._rb {...}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * typedef union ..._rb ..._rb;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Which is handy in functions because the initial coding sequence
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * looks something like:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXXGetInfoParam (struct XXXGetInfo_param *param) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXXGetInfo_rb rb;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * param->result.level = param->level; // for marshalling
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * param->result.bufptr.nullptr = &rb; // anything fits
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * There are two flavors of Info results. The first is the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * single XXX_INFO_x result, which the foregoing example
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * uses. The second flavor is when there are multiple entries
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * possible. Again, for the sake of guiding the marshalling,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the RPIs use something accommodating:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct XXX_INFO_1_result {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * unsigned entriesread;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [size_is(entriesread)]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXX_INFO_1 * table;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * union { XXX_INFO_1_result *info1; ...}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Notice this is using XXX_INFO_1_result rather than just XXX_INFO_1.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The requirements from this point are much like before. Because of
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the variable-length value, there is no realistic way to do something
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * like INFO1RESBUF_DEFINITION.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * There are two sets of macros here. INFO1RES_xxx are for the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * single result case, and INFONRES_xxx for the multiple entry case.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * INFO1RES_...
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Type constructors for single-result case
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * INFO1RESBUF_...
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Type constructors for single-result buffering.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * INFONRES_...
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Type constructors for multiple-result case
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw CASE(NUM) struct INFOPREF##_##NUM##_result * bufptr##NUM;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This just makes things a little easier on the stub modules:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * XXXGetInfoParam (struct XXXGetInfo_param *param) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * struct mslm_infonres infonres;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * infonres.entriesread = 0;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * infonres.entries = 0;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * param->result.level = param->level; // for marshalling
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * param->result.bufptr.p = &infonres;
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * SRVSVC - Server Service
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows NT */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows 2000 */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows XP and Windows Server 2003 */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows Vista */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
3db3f65c6274eb042354801a308c8e9bc4994553amw * NetConnectEnum
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Level 0 connect information.
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetConnectInfoBuf0 srvsvc_NetConnectInfoBuf0_t;
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetConnectInfo0 srvsvc_NetConnectInfo0_t;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Level 1 connect information.
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetConnectInfoBuf1 srvsvc_NetConnectInfoBuf1_t;
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetConnectInfo1 srvsvc_NetConnectInfo1_t;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
3db3f65c6274eb042354801a308c8e9bc4994553amw * NetFileEnum
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetFileInfoBuf2 srvsvc_NetFileInfoBuf2_t;
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetFileInfo2 srvsvc_NetFileInfo2_t;
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetFileInfoBuf3 srvsvc_NetFileInfoBuf3_t;
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borregotypedef struct mslm_NetFileInfo3 srvsvc_NetFileInfo3_t;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NetFileClose
3db3f65c6274eb042354801a308c8e9bc4994553amw * Close files using a file id reported by NetFileEnum.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * NetShareGetInfo/NetShareSetInfo: netname is the name of a share.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 0 The share name.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 1 Information about the shared resource: name, type of resource
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * and a comment.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 2 Information about the shared resource: name, type, permissions,
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * password and number of connections.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 501 Information about the shared resource: name, type of resource
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * and a comment.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 502 Information about the shared resource, including the name, type,
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * permissions, number of connections etc.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 503 Contains information about the shared resource; identical to 502
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * except for the addition of a servername.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 1004 A comment for the shared resource.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 1005 A set of flags describing the shared resource.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 1006 The maximum number of concurrent connections that the shared
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * resource can accommodate.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 1501 Specifies the SECURITY_DESCRIPTOR for the share.
3db3f65c6274eb042354801a308c8e9bc4994553amw * Windows Me/98/95 supports level 50, which is similar to level 1.
3db3f65c6274eb042354801a308c8e9bc4994553amw * shi1005_flags: SHI1005_VALID_FLAGS_SET defines the set of flags that
3db3f65c6274eb042354801a308c8e9bc4994553amw * can be set with the NetShareSetInfo function. SHI1005_FLAGS_DFS and
3db3f65c6274eb042354801a308c8e9bc4994553amw * SHI1005_FLAGS_DFS_ROOT can only be returned, but not set.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x01 SHI1005_FLAGS_DFS
3db3f65c6274eb042354801a308c8e9bc4994553amw * The specified share is present in a Dfs tree structure.
3db3f65c6274eb042354801a308c8e9bc4994553amw * This flag cannot be set with NetShareSetInfo.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x02 SHI1005_FLAGS_DFS_ROOT
3db3f65c6274eb042354801a308c8e9bc4994553amw * The specified share is the root volume in a Dfs tree.
3db3f65c6274eb042354801a308c8e9bc4994553amw * This flag cannot be set with NetShareSetInfo.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x30 CSC_MASK Client-side caching (CSC) state:
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x00 CSC_CACHE_MANUAL_REINT Automatic file-by-file
3db3f65c6274eb042354801a308c8e9bc4994553amw * reintegration not allowed.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x10 CSC_CACHE_AUTO_REINT File-by-file reintegration allowed.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x20 CSC_CACHE_VDO File opens do not need to be flowed.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x30 CSC_CACHE_NONE CSC is disabled for this share.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x0100 SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS
3db3f65c6274eb042354801a308c8e9bc4994553amw * The specified share disallows exclusive file opens,
3db3f65c6274eb042354801a308c8e9bc4994553amw * where reads to an open file are disallowed.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x0200 SHI1005_FLAGS_FORCE_SHARED_DELETE
3db3f65c6274eb042354801a308c8e9bc4994553amw * Shared files in the specified share can be forcibly deleted.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x0400 SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING
3db3f65c6274eb042354801a308c8e9bc4994553amw * Clients are allowed to cache the namespace of the share.
3db3f65c6274eb042354801a308c8e9bc4994553amw * 0x0800 SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM
3db3f65c6274eb042354801a308c8e9bc4994553amw * The server will filter directory entries based on the access
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * permissions of the client. The access-based enumeration (ABE)
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * flag may also appear as SHI1005_FLAGS_ENFORCE_NAMESPACE_ACCESS.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * Support for Access-based Enumeration (ABE) was added to Windows in
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * Windows Server 2003 Service Pack 1. ABE filters directory contents
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * (and other shared resources) returned via a share based on a user's
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * access rights, i.e. a user would not see objects that are
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * inaccessible to that user. ABE requests are made using info level
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * 1005 with the value 0x0800 in the flags field.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * Definition for a SID. The ndl compiler does not allow a typedef of
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * a structure containing variable size members.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright * SRVSVC definition of a security_descriptor.
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wrighttypedef struct mslm_security_descriptor mslm_security_descriptor_t;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_0 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_1 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_2 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States/*
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States * shi501_reserved (AKA shi501_flags) must be zero.
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States */
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_501 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_502 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_503 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_1004 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_1005 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United Statesstruct mslm_NetShareInfo_1006 {
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(0) struct mslm_NetShareInfo_0 *info0;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(1) struct mslm_NetShareInfo_1 *info1;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(2) struct mslm_NetShareInfo_2 *info2;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(501) struct mslm_NetShareInfo_501 *info501;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(502) struct mslm_NetShareInfo_502 *info502;
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright CASE(503) struct mslm_NetShareInfo_503 *info503;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(1004) struct mslm_NetShareInfo_1004 *info1004;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(1005) struct mslm_NetShareInfo_1005 *info1005;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(1006) struct mslm_NetShareInfo_1006 *info1006;
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright CASE(1501) struct mslm_NetShareInfo_1501 *info1501;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NetSessionEnum
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The NetSessionEnum function provides information about sessions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * established on a server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Only members of the Administrators or Account Operators local groups
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * can successfully execute the NetSessionEnum function at level 1 or
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * level 2. No special group membership is required for level 0 or level
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 10 calls.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows NT/2000/XP: The parameter order is as follows.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NET_API_STATUS NetSessionEnum(LPWSTR servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPWSTR UncClientName,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPWSTR username,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * DWORD level,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPBYTE *bufptr,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * DWORD prefmaxlen,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPDWORD entriesread,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPDWORD totalentries,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPDWORD resume_handle);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows 95/98/Me: The calling application must use the cbBuffer parameter
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * to specify the size, in bytes, of the information buffer pointed to by the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * pbBuffer parameter. (The cbBuffer parameter replaces the prefmaxlen
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * parameter.) Neither a user name parameter nor a resume handle parameter is
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * available on this platform. Therefore, the parameter list is as follows.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * API_FUNCTION NetSessionEnum(const char FAR *pszServer,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * short sLevel,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * char FAR *pbBuffer,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * unsigned short cbBuffer,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * unsigned short FAR *pcEntriesRead,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * unsigned short FAR *pcTotalAvail);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Parameters
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * servername
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Pointer to a string that specifies the DNS or NetBIOS name of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * remote server on which the function is to execute. If this parameter is
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NULL, the local computer is used.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows NT 4.0 and earlier: This string must begin with \\.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UncClientName
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Pointer to a string that specifies the name of the computer session
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * for which information is to be returned. If this parameter is NULL,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NetSessionEnum returns information for all computer sessions on the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * username
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Pointer to a string that specifies the name of the user for which
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information is to be returned. If this parameter is NULL, NetSessionEnum
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * returns information for all users.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Specifies the information level of the data. This parameter can be
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * one of the following values.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows NT/2000/XP: The following levels are valid.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Value Meaning
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 0 Return the name of the computer that established the session.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The bufptr parameter points to an array of SESSION_INFO_0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * structures.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 1 Return the name of the computer, name of the user, and open files,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * pipes, and devices on the computer. The bufptr parameter points to
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * an array of SESSION_INFO_1 structures.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 2 In addition to the information indicated for level 1, return the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * type of client and how the user established the session. The bufptr
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * parameter points to an array of SESSION_INFO_2 structures.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 10 Return the name of the computer, name of the user, and active and
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * idle times for the session. The bufptr parameter points to an array
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * of SESSION_INFO_10 structures.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 502 Return the name of the computer; name of the user; open files,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * pipes, and devices on the computer; and the name of the transport
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the client is using. The bufptr parameter points to an array of
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SESSION_INFO_502 structures.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows 95/98/Me: The following level is valid.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Value Meaning
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 50 Return the name of the computer, name of the user, open files on
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the computer, and the name of the transport protocol the client is
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * using. The pbBuffer parameter points to an array of session_info_50
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * structures.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [out] Pointer to the buffer that receives the data. The format of this
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * data depends on the value of the level parameter.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows NT/2000/XP: This buffer is allocated by the system and must be
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * freed using the NetApiBufferFree function. Note that you must free the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * buffer even if the function fails with ERROR_MORE_DATA.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows 95/98/Me: The caller must allocate and deallocate this buffer.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * prefmaxlen
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Specifies the preferred maximum length of returned data, in bytes.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If you specify MAX_PREFERRED_LENGTH, the function allocates the amount
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * of memory required for the data. If you specify another value in this
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * parameter, it can restrict the number of bytes that the function returns.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If the buffer size is insufficient to hold all entries, the function
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * returns ERROR_MORE_DATA. For more information, see Network Management
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Function Buffers and Network Management Function Buffer Lengths.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * entriesread
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [out] Pointer to a value that receives the count of elements actually
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * enumerated.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * totalentries
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [out] Pointer to a value that receives the total number of entries that
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * could have been enumerated from the current resume position.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * resume_handle
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in/out] Pointer to a value that contains a resume handle which is used
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * to continue an existing session search. The handle should be zero on the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * first call and left unchanged for subsequent calls. If resume_handle is
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NULL, no resume handle is stored.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SESSION_INFO_1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ==============
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The SESSION_INFO_1 structure contains information about the session,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * including name of the computer; name of the user; and open files, pipes,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and devices on the computer.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi1_cname
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Pointer to a Unicode string specifying the name of the computer that
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * established the session.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi1_username
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Pointer to a Unicode string specifying the name of the user who established
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the session.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi1_num_opens
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Specifies a DWORD value that contains the number of files, devices,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and pipes opened during the session.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi1_time
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Specifies a DWORD value that contains the number of seconds the session
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * has been active.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi1_idle_time
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Specifies a DWORD value that contains the number of seconds the session
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * has been idle.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi1_user_flags
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Specifies a DWORD value that describes how the user established the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * session. This member can be one of the following values:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SESS_GUEST The user specified by the sesi1_username member
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * established the session using a guest account.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SESS_NOENCRYPTION The user specified by the sesi1_username member
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * established the session without using password
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * encryption.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NetSessionDel (Platform SDK: Network Management)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The NetSessionDel function ends a network session between a server
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and a workstation.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Security Requirements
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Only members of the Administrators or Account Operators local group
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * can successfully execute the NetSessionDel function.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows NT/2000/XP: The parameter order is as follows.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NET_API_STATUS NetSessionDel(LPWSTR servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPWSTR UncClientName,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * LPWSTR username);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows 95/98/Me: The sReserved parameter replaces the username
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * parameter. For more information, see the following Remarks section.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The parameter list is as follows.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * API_FUNCTION NetSessionDel(const char FAR *pszServer,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * const char FAR *pszClientName,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * short sReserved);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Parameters
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * servername
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Pointer to a string that specifies the DNS or NetBIOS name
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * of the remote server on which the function is to execute. If this
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * parameter is NULL, the local computer is used.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows NT 4.0 and earlier: This string must begin with \\.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * UncClientName
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Pointer to a string that specifies the computer name of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * client to disconnect. If UncClientName is NULL, then all the sessions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * of the user identified by the username parameter will be deleted on
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the server specified by servername. For more information, see
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * NetSessionEnum.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * username
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [in] Pointer to a string that specifies the name of the user whose
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * session is to be terminated. If this parameter is NULL, all users'
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sessions from the client specified by the UncClientName parameter
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * are to be terminated.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Windows 95/98/Me: You must specify the session key in the sReserved
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * parameter when you call NetSessionDel. The session key is returned by
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the NetSessionEnum function or the NetSessionGetInfo function in the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * sesi50_key member of the session_info_50 structure.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SRVSVC NetServerGetInfo (
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN LPTSTR servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN DWORD level,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT union switch(level) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case 100: _SERVER_INFO_100 * p100;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case 101: _SERVER_INFO_101 * p101;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case 102: _SERVER_INFO_102 * p102;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * } bufptr,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT DWORD status
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* for svX_platform */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* Bit-mapped values for svX_type fields */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define SV_TYPE_WINDOWS 0x00400000 /* Windows95 and above */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define SV_TYPE_ALTERNATE_XPORT 0x20000000 /* return list for
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * alternate transport */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 /* Return local list only */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define SV_TYPE_ALL 0xFFFFFFFF /* handy for NetServerEnum2 */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* NT-Server 4.0 sends 0x0006_120B */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* NT-workstation 4.0 send 0x0004_1013 */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* Special value for sv102_disc that specifies infinite disconnect time */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define SV_NODISC (-1L) /* No autodisconnect timeout enforced */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* Values of svX_security field */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* Values of svX_hidden field */
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright CASE(502) struct mslm_SERVER_INFO_502 *bufptr502;
29bd28862cfb8abbd3a0f0a4b17e08bbc3652836Alan Wright CASE(503) struct mslm_SERVER_INFO_503 *bufptr503;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SRVSVC NetRemoteTOD (
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN LPTSTR servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT _TIME_OF_DAY_INFO *bufptr,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT long status
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * SRVSVC NetShareEnum (
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN LPTSTR servername,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN DWORD level;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT union switch(level) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case 0: struct {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * DWORD entriesread;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [size_is(entriesread)]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * _SHARE_INFO_0 *entries;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * } *bufptr0;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case 1: struct {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * DWORD entriesread;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * [size_is(entriesread)]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * _SHARE_INFO_1 *entries;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * } *bufptr1;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * } bufptr,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN DWORD prefmaxlen,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT DWORD totalentries,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN OUT DWORD ?* resume_handle,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * OUT DWORD status
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Share types for shiX_type fields - duplicated from cifs.h
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* Maximum uses for shiX_max_uses fields */
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United StatesINFONRES_RESULT(mslm_NetShareInfo,0)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United StatesINFONRES_RESULT(mslm_NetShareInfo,1)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United StatesINFONRES_RESULT(mslm_NetShareInfo,2)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United StatesINFONRES_RESULT(mslm_NetShareInfo,501)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United StatesINFONRES_RESULT(mslm_NetShareInfo,502)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(2) struct mslm_NetShareInfo_2 *info2;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States CASE(502) struct mslm_NetShareInfo_502 *info502;
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States INFONRES_UNION_ENTRY(mslm_NetShareInfo,0)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States INFONRES_UNION_ENTRY(mslm_NetShareInfo,1)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States INFONRES_UNION_ENTRY(mslm_NetShareInfo,2)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States INFONRES_UNION_ENTRY(mslm_NetShareInfo,501)
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States INFONRES_UNION_ENTRY(mslm_NetShareInfo,502))
19d41fcc9d25d65db5db7c75dc9bbb68550868d2amw * NetShareEnum: enumerate all shares (see also NetShareEnumSticky).
19d41fcc9d25d65db5db7c75dc9bbb68550868d2amw * Note: the server should ignore the content of servername.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Delete a share. The reserved field appears in netmon
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * but I've left it out in case it's not always present.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This won't affect RPC processing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /* IN DWORD reserved; */
19d41fcc9d25d65db5db7c75dc9bbb68550868d2amw * NetShareEnumSticky is the same as NetShareEnum except that
19d41fcc9d25d65db5db7c75dc9bbb68550868d2amw * STYPE_SPECIAL (hidden or special) shares are not returned.
19d41fcc9d25d65db5db7c75dc9bbb68550868d2amw * Note: the server should ignore the content of servername.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When you install Windows NT Server Tools on a Win95 client,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * a security tab will be added to properties dialog box of files/folders.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Within this security tab, when you try to get/set permissions on a
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file/folder the next two RPC calls are used.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Right now, we can't send back SD of the requested object
8d7e41661dc4633488e93b13363137523ce59977jose borrego * in RPC code, so we just reply with access denied error
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * code. Thus, this output declaration is only valid in this
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * case i.e., it's not complete.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * It looks like:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * A Pointer
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * A Length
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * A Pointer
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * A Length (equal to the prev length)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * A buffer
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * return value
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This is the request:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: RPC Client call srvsvc:NetrpSetFileSecurity(..)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: SRVSVC_HANDLE ServerName = \\WK76-177
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: LPWSTR ShareName = AFSHIN
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: LPWSTR lpFileName = \salek.txt
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: SECURITY_INFORMATION SecurityInformation = 4 (0x4)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * -R_SRVSVC: PADT_SECURITY_DESCRIPTOR SecurityDescriptor {..}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: DWORD Length = 64 (0x40)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: LPBYTE Buffer = 4496048 (0x449AB0)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * R_SRVSVC: LPBYTE Buffer [..] = 01 00 04 80 00 00 00 00 00 00 00 00 00 00 00
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 000000A0 00 83 46 00 0B 00 00 00 00 00 00 00 0B 00 ..F...........
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 000000B0 00 00 5C 00 5C 00 57 00 4B 00 37 00 36 00 2D 00 ..\.\.W.K.7.6.-.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 000000C0 31 00 37 00 37 00 00 00 08 00 16 83 46 00 07 00 1.7.7.......F...
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 000000D0 00 00 00 00 00 00 07 00 00 00 41 00 46 00 53 00 ..........A.F.S.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 000000E0 48 00 49 00 4E 00 00 00 00 00 0B 00 00 00 00 00 H.I.N...........
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 000000F0 00 00 0B 00 00 00 5C 00 73 00 61 00 6C 00 65 00 ......\.s.a.l.e.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000100 6B 00 2E 00 74 00 78 00 74 00 00 00 00 00 04 00 k...t.x.t.......
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000110 00 00 40 00 00 00 B0 9A 44 00 40 00 00 00 01 00 ..@.....D.@.....
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000120 04 80 00 00 00 00 00 00 00 00 00 00 00 00 14 00 ................
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000130 00 00 02 00 2C 00 01 00 00 00 00 00 24 00 00 00 ....,.......$...
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000140 00 A0 01 05 00 00 00 00 00 05 15 00 00 00 1A 24 ...............$
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000150 44 38 90 00 0F 02 65 3A BE 4C FF 03 00 00 00 00 D8....e:.L......
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 00000160 00 00 00 00 00 00 00 00 00 00 ..........
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * IN Security Descriptor (looks like):
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Length2 (== Length1)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * buffer itself
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The SRVSVC already
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * WKSSVC - Workstation Service
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows NT */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows 2000 */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/* Windows XP and Windows Server 2003 */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* NetWkstaGetInfo only. System information - user access */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* NetWkstaGetInfo only. System information - admin or operator access */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb ***********************************************************************
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * NetWkstaTransportEnum
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb ***********************************************************************
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The WKSSVC already