Helper function for creating directories when the ``makedirs`` option is set
    to ``True``. Handles Unix and Windows based systems

    .. versionadded:: 2017.7.8

    Args:
        name (str): The directory path to create
        user (str): The linux user to own the directory
        group (str): The linux group to own the directory
        dir_mode (str): The linux mode to apply to the directory
        win_owner (str): The Windows user to own the directory
        win_perms (dict): A dictionary of grant permissions for Windows
        win_deny_perms (dict): A dictionary of deny permissions for Windows
        win_inheritance (bool): True to inherit permissions on Windows

    Returns:
        bool: True if successful, otherwise False on Windows
        str: Error messages on failure on Linux
        None: On successful creation on Linux

    Raises:
        CommandExecutionError: If the drive is not mounted on Windows

def _makedirs(name,
              user=None,
              group=None,
              dir_mode=None,
              win_owner=None,
              win_perms=None,
              win_deny_perms=None,
              win_inheritance=None):
    '''
    Helper function for creating directories when the ``makedirs`` option is set
    to ``True``. Handles Unix and Windows based systems

    .. versionadded:: 2017.7.8

    Args:
        name (str): The directory path to create
        user (str): The linux user to own the directory
        group (str): The linux group to own the directory
        dir_mode (str): The linux mode to apply to the directory
        win_owner (str): The Windows user to own the directory
        win_perms (dict): A dictionary of grant permissions for Windows
        win_deny_perms (dict): A dictionary of deny permissions for Windows
        win_inheritance (bool): True to inherit permissions on Windows

    Returns:
        bool: True if successful, otherwise False on Windows
        str: Error messages on failure on Linux
        None: On successful creation on Linux

    Raises:
        CommandExecutionError: If the drive is not mounted on Windows
    '''
    if salt.utils.platform.is_windows():
        # Make sure the drive is mapped before trying to create the
        # path in windows
        drive, path = os.path.splitdrive(name)
        if not os.path.isdir(drive):
            raise CommandExecutionError(drive)
        win_owner = win_owner if win_owner else user
        return __salt__['file.makedirs'](path=name,
                                         owner=win_owner,
                                         grant_perms=win_perms,
                                         deny_perms=win_deny_perms,
                                         inheritance=win_inheritance)
    else:
        return __salt__['file.makedirs'](path=name,
                                         user=user,
                                         group=group,
                                         mode=dir_mode)