def msvcrt_rand(s=0, size=1):
    """
    Emulate interplay of srand() and rand()

    :param int s: The seed.
    :param int size: Desired length of returned data.

    :return: A sequence of bytes computed using the supplied arguments.
    :rtype: bytearray
    """

    result = bytearray()
    for i in range(0, size):
        s = (214013*s + 2531011) & 0x7fffffff
        result.append(s >> 16 & 0xff)
    return result