def METHOD_NAME(session, devcon_folder, hwid, virtio_mode):
    """
    Check devices' memory range in windows guests. Memory range should be
    larger than 0xFFF in transitional mode, no more than 0xFFF in legacy mode.
    :param session: shell Object
    :param devcon_folder: devcon.exe folder path
    :param hwid: hardware id of a specific device
    :param virtio_mode: VirtIO mode for the device
    """
    mem_check_cmd = ('%sdevcon.exe resources @"%s" | find "MEM"' %
                     (devcon_folder, hwid))
    status, output = session.cmd_status_output(mem_check_cmd)
    guest_mode = "legacy"
    if status == 0:
        for out in output.split("\n")[0:-2]:
            out = re.split(r':+', out)[1].split("-")
            if int(out[1], 16) - int(out[0], 16) - int("0xFFF", 16):
                guest_mode = "transitional"
    return guest_mode