/// <exception cref="System.IO.IOException"></exception>
		public SamrPolicyHandle(DcerpcHandle handle, string server, int access)
		{
			if (server == null)
			{
				server = "\\\\";
			}
			MsrpcSamrConnect4 rpc = new MsrpcSamrConnect4(server, access, this);
			try
			{
				handle.Sendrecv(rpc);
			}
			catch (DcerpcException de)
			{
				if (de.GetErrorCode() != DcerpcError.DcerpcFaultOpRngError)
				{
					throw;
				}
				MsrpcSamrConnect2 rpc2 = new MsrpcSamrConnect2(server, access, this);
				handle.Sendrecv(rpc2);
			}
		}
Example #2
0
        /// <exception cref="System.IO.IOException"></exception>
        public SamrPolicyHandle(DcerpcHandle handle, string server, int access)
        {
            if (server == null)
            {
                server = "\\\\";
            }
            MsrpcSamrConnect4 rpc = new MsrpcSamrConnect4(server, access, this);

            try
            {
                handle.Sendrecv(rpc);
            }
            catch (DcerpcException de)
            {
                if (de.GetErrorCode() != DcerpcError.DcerpcFaultOpRngError)
                {
                    throw;
                }
                MsrpcSamrConnect2 rpc2 = new MsrpcSamrConnect2(server, access, this);
                handle.Sendrecv(rpc2);
            }
        }