int start = dstIndex;
if (command != SMB_COM_NT_TRANSACT_SECONDARY) {
dst[dstIndex++] = maxSetupCount;
} else {
dst[dstIndex++] = (byte)0x00; // Reserved
}
dst[dstIndex++] = (byte)0x00; // Reserved
dst[dstIndex++] = (byte)0x00; // Reserved
writeInt4( totalParameterCount, dst, dstIndex );
dstIndex += 4;
writeInt4( totalDataCount, dst, dstIndex );
dstIndex += 4;
if (command != SMB_COM_NT_TRANSACT_SECONDARY) {
writeInt4( maxParameterCount, dst, dstIndex );
dstIndex += 4;
writeInt4( maxDataCount, dst, dstIndex );
dstIndex += 4;
}
writeInt4( parameterCount, dst, dstIndex );
dstIndex += 4;
writeInt4(( parameterCount == 0 ? 0 : parameterOffset ), dst, dstIndex );
dstIndex += 4;
if (command == SMB_COM_NT_TRANSACT_SECONDARY) {
writeInt4( parameterDisplacement, dst, dstIndex );
dstIndex += 4;
}
writeInt4( dataCount, dst, dstIndex );
dstIndex += 4;
writeInt4(( dataCount == 0 ? 0 : dataOffset ), dst, dstIndex );
dstIndex += 4;
if (command == SMB_COM_NT_TRANSACT_SECONDARY) {
writeInt4( dataDisplacement, dst, dstIndex );
dstIndex += 4;
dst[dstIndex++] = (byte)0x00; // Reserved1
} else {
dst[dstIndex++] = (byte)setupCount;
writeInt2( function, dst, dstIndex );
dstIndex += 2;
dstIndex += writeSetupWireFormat( dst, dstIndex );
}
return dstIndex - start;