def status(session, name):
    """
    Description: check status of device

    :param session: instance of Windows, which hold session to win machine
    :type session: winremote.Windows
    :param name: name of the device to fetch info
    :type name: str
    :returns: True or False, True if device is OK, False otherwise
    :rtype: bool
    """
    dev = session._wmi.query_first(
        "select * from Win32_PnPEntity where Name = '%s'" % name)
    if dev and 'ConfigManagerErrorCode' in dev:
        return dev['ConfigManagerErrorCode'] == '0'
    return False
