コード例 #1
0
ファイル: Srvsvc.cs プロジェクト: glen61y141/WinKernelhub
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int arrayp = src.Dec_ndr_long();

                if (arrayp != 0)
                {
                    src = src.Deferred;
                    int arrays = src.Dec_ndr_long();
                    int arrayi = src.Index;
                    src.Advance(40 * arrays);
                    if (Array == null)
                    {
                        if (arrays < 0 || arrays > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Array = new ShareInfo502[arrays];
                    }
                    src = src.Derive(arrayi);
                    for (int i = 0; i < arrays; i++)
                    {
                        if (Array[i] == null)
                        {
                            Array[i] = new ShareInfo502();
                        }
                        Array[i].Decode(src);
                    }
                }
            }
コード例 #2
0
        /// <summary>
        ///     Shares a server resource.
        /// </summary>
        /// <param name="servername">
        ///     Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the
        ///     function is to execute. If this parameter is NULL, the local computer is used.
        /// </param>
        /// <param name="shareInfo502">
        ///     Specifies the information level of the data. This parameter can be one of the following
        ///     values.
        /// </param>
        /// <returns>Returns a NetApiResult Enumeration.</returns>
        public static Enum.NetApiResult Create(string servername, ShareInfo502 shareInfo502)
        {
            var  nativeShareInfo502 = ShareInfo502.MapToNativeShareInfo502(shareInfo502);
            uint error = 0;

            return((Enum.NetApiResult)DllImports.NetShareAdd(servername, 502, ref nativeShareInfo502, out error));
        }
コード例 #3
0
ファイル: Srvsvc.cs プロジェクト: Cyber-Forensic/Potato
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				Count = src.Dec_ndr_long();
				int arrayp = src.Dec_ndr_long();
				if (arrayp != 0)
				{
					src = src.Deferred;
					int arrays = src.Dec_ndr_long();
					int arrayi = src.Index;
					src.Advance(40 * arrays);
					if (Array == null)
					{
						if (arrays < 0 || arrays > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						Array = new ShareInfo502[arrays];
					}
					src = src.Derive(arrayi);
					for (int i = 0; i < arrays; i++)
					{
						if (Array[i] == null)
						{
							Array[i] = new ShareInfo502();
						}
						Array[i].Decode(src);
					}
				}
			}
コード例 #4
0
 /// <summary>
 ///     Shares a server resource.
 /// </summary>
 /// <param name="servername">
 ///     Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the
 ///     function is to execute. If this parameter is NULL, the local computer is used.
 /// </param>
 /// <param name="shareInfo502">
 ///     Specifies the information level of the data. This parameter can be one of the following
 ///     values.
 /// </param>
 /// <returns>Returns a NetApiResult Enumeration.</returns>
 public static Enum.NetApiResult Create(string servername, ShareInfo502 shareInfo502)
 {
     return(Shares.Create(servername, shareInfo502));
 }