import ctypes


def generate_platform_info (platform_id_header, platform_id):
    """
    Create the platform information section of the manifest.

    :param platform_id_header: ID header for the platform
    :param platform_id: ID for the platform

    :return Platform manifest section
    """

    header_buf = (ctypes.c_ubyte * ctypes.sizeof (platform_id_header)).from_buffer_copy (
        platform_id_header)

    num_alignment = platform_id_header.id_length  % 4
    num_alignment = 0 if (num_alignment == 0) else (4 - num_alignment)
    alignment_buf = (ctypes.c_ubyte * num_alignment) ()
    ctypes.memset (alignment_buf, 0, num_alignment)

    class manifest_platform_id(ctypes.LittleEndianStructure):
        _pack_ = 1
        _fields_ = [('header', ctypes.c_ubyte * ctypes.sizeof (platform_id_header)),
                    ('platform_id', ctypes.c_char * len (platform_id)),
                    ('alignment', ctypes.c_ubyte * num_alignment)]

    platform = manifest_platform_id (header_buf, platform_id, alignment_buf)

    return platform