예제 #1
0
 /// <summary>
 ///     Maps the native ShareInfo502 Structure to a managed ShareInfo502 Class.
 /// </summary>
 /// <param name="shareInfo">The native source ShareInfo502.</param>
 /// <returns>A managed ShareInfo502 Object.</returns>
 internal static ShareInfo502 MapToShareInfo502(Structs.ShareInfo502 shareInfo)
 {
     return(new ShareInfo502
     {
         CurrentUsers = shareInfo.shi502_current_uses,
         MaxUsers = shareInfo.shi502_max_uses,
         NetName = shareInfo.shi502_netname,
         Password = shareInfo.shi502_passwd,
         Path = shareInfo.shi502_path,
         Permissions = (Enum.SharePermissions)shareInfo.shi502_permissions,
         Remark = shareInfo.shi502_remark,
         ShareType = (Enum.ShareType)shareInfo.shi502_type,
         Reserved = shareInfo.shi502_reserved,
         SecurityDescriptor = shareInfo.shi502_security_descriptor
     });
 }
 internal static extern uint NetShareAdd(
     [MarshalAs(UnmanagedType.LPWStr)] string strServer,
     Int32 dwLevel,
     ref Structs.ShareInfo502 buf,
     out uint parm_err
     );