コード例 #1
0
  public void encode(NdrBuffer buf) throws NdrException {
    int start = buf.getIndex();
    int alloc_hint_index = 0;

    buf.advance(16); /* momentarily skip header */
    if (ptype == 0) {
      /* Request */
      alloc_hint_index = buf.getIndex();
      buf.enc_ndr_long(0); /* momentarily skip alloc hint */
      buf.enc_ndr_short(0); /* context id */
      buf.enc_ndr_short(getOpnum());
    }

    encode_in(buf);
    length = buf.getIndex() - start;

    if (ptype == 0) {
      buf.setIndex(alloc_hint_index);
      alloc_hint = length - alloc_hint_index;
      buf.enc_ndr_long(alloc_hint);
    }

    buf.setIndex(start);
    encode_header(buf);
    buf.setIndex(start + length);
  }
コード例 #2
0
ファイル: srvsvc.java プロジェクト: fzoske/jcifs
    public void decode(NdrBuffer _src) throws NdrException {
      _src.align(4);
      count = (int) _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(4 * _arrays);

        if (array == null) {
          if (_arrays < 0 || _arrays > 0xFFFF)
            throw new NdrException(NdrException.INVALID_CONFORMANCE);
          array = new ShareInfo0[_arrays];
        }
        _src = _src.derive(_arrayi);
        for (int _i = 0; _i < _arrays; _i++) {
          if (array[_i] == null) {
            array[_i] = new ShareInfo0();
          }
          array[_i].decode(_src);
        }
      }
    }
コード例 #3
0
ファイル: srvsvc.java プロジェクト: fzoske/jcifs
    public void decode(NdrBuffer _src) throws NdrException {
      _src.align(4);
      int _netnamep = _src.dec_ndr_long();
      type = (int) _src.dec_ndr_long();
      int _remarkp = _src.dec_ndr_long();
      permissions = (int) _src.dec_ndr_long();
      max_uses = (int) _src.dec_ndr_long();
      current_uses = (int) _src.dec_ndr_long();
      int _pathp = _src.dec_ndr_long();
      int _passwordp = _src.dec_ndr_long();
      sd_size = (int) _src.dec_ndr_long();
      int _security_descriptorp = _src.dec_ndr_long();

      if (_netnamep != 0) {
        _src = _src.deferred;
        netname = _src.dec_ndr_string();
      }
      if (_remarkp != 0) {
        _src = _src.deferred;
        remark = _src.dec_ndr_string();
      }
      if (_pathp != 0) {
        _src = _src.deferred;
        path = _src.dec_ndr_string();
      }
      if (_passwordp != 0) {
        _src = _src.deferred;
        password = _src.dec_ndr_string();
      }
      if (_security_descriptorp != 0) {
        _src = _src.deferred;
        int _security_descriptors = _src.dec_ndr_long();
        int _security_descriptori = _src.index;
        _src.advance(1 * _security_descriptors);

        if (security_descriptor == null) {
          if (_security_descriptors < 0 || _security_descriptors > 0xFFFF)
            throw new NdrException(NdrException.INVALID_CONFORMANCE);
          security_descriptor = new byte[_security_descriptors];
        }
        _src = _src.derive(_security_descriptori);
        for (int _i = 0; _i < _security_descriptors; _i++) {
          security_descriptor[_i] = (byte) _src.dec_ndr_small();
        }
      }
    }
コード例 #4
0
ファイル: srvsvc.java プロジェクト: fzoske/jcifs
    public void encode(NdrBuffer _dst) throws NdrException {
      _dst.align(4);
      _dst.enc_ndr_long(count);
      _dst.enc_ndr_referent(array, 1);

      if (array != null) {
        _dst = _dst.deferred;
        int _arrays = count;
        _dst.enc_ndr_long(_arrays);
        int _arrayi = _dst.index;
        _dst.advance(4 * _arrays);

        _dst = _dst.derive(_arrayi);
        for (int _i = 0; _i < _arrays; _i++) {
          array[_i].encode(_dst);
        }
      }
    }
コード例 #5
0
ファイル: srvsvc.java プロジェクト: fzoske/jcifs
    public void encode(NdrBuffer _dst) throws NdrException {
      _dst.align(4);
      _dst.enc_ndr_referent(netname, 1);
      _dst.enc_ndr_long(type);
      _dst.enc_ndr_referent(remark, 1);
      _dst.enc_ndr_long(permissions);
      _dst.enc_ndr_long(max_uses);
      _dst.enc_ndr_long(current_uses);
      _dst.enc_ndr_referent(path, 1);
      _dst.enc_ndr_referent(password, 1);
      _dst.enc_ndr_long(sd_size);
      _dst.enc_ndr_referent(security_descriptor, 1);

      if (netname != null) {
        _dst = _dst.deferred;
        _dst.enc_ndr_string(netname);
      }
      if (remark != null) {
        _dst = _dst.deferred;
        _dst.enc_ndr_string(remark);
      }
      if (path != null) {
        _dst = _dst.deferred;
        _dst.enc_ndr_string(path);
      }
      if (password != null) {
        _dst = _dst.deferred;
        _dst.enc_ndr_string(password);
      }
      if (security_descriptor != null) {
        _dst = _dst.deferred;
        int _security_descriptors = sd_size;
        _dst.enc_ndr_long(_security_descriptors);
        int _security_descriptori = _dst.index;
        _dst.advance(1 * _security_descriptors);

        _dst = _dst.derive(_security_descriptori);
        for (int _i = 0; _i < _security_descriptors; _i++) {
          _dst.enc_ndr_small(security_descriptor[_i]);
        }
      }
    }