Ejemplo n.º 1
0
def gen_ipp_status():
    config = settings.CSettings("ipp_status")
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 generate_status_items)
        context["generator"] = "IPP_STATUS"

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "IPP_STATUS")
Ejemplo n.º 2
0
def gen_http():
    config = settings.CSettings("http")
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 read_status_items)
        context["generator"] = "HTTP"

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "HTTP_STATUS_CODE")
Ejemplo n.º 3
0
def gen_lresult():
    config = settings.CSettings("lresult")
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 generate_status_items)
        context["generator"] = "LRESULT"

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "LAST_RESULT")
Ejemplo n.º 4
0
def gen_errno():
    config = settings.CSettings("errno")
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 generate_errno_items)
        context["generator"] = "ERRNO"

        merge_items(context)

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "ERRNO_CODE", os_suffix=True)
Ejemplo n.º 5
0
def gen_kreturn():
    config = settings.CSettings("kreturn")
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out, generate_status_items)
        context["generator"] = "KRETURN"

        allstat.default_item(context, "kOSReturnSuccess", "0x00000000", "Operation successful.", "OSReturn.h", "AS_OS_MAC", True)
        allstat.default_item(context, "kOSReturnError", "0x00000001", "Unspecified Libkern error.", "OSReturn.h", "AS_OS_MAC", True)
        add_fw_items(context)
        add_bluetooth_items(context)

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "KERN_RETURN")
Ejemplo n.º 6
0
def gen_ntstatus():
    config = settings.CSettings("ntstatus")
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 generate_status_items)
        context["generator"] = "NTSTATUS"

        source = "ntstatus.h"
        wait_descr = "The caller specified WaitAny for WaitType and one of the dispatcher objects in the Object array has been set to the signaled state."
        allstat.default_item(context, "STATUS_WAIT_0", "0x00000000",
                             wait_descr, source, "AS_OS_WINDOWS", True)
        allstat.default_item(context, "STATUS_WAIT_1", "0x00000001",
                             wait_descr, source, "AS_OS_WINDOWS", True)
        allstat.default_item(context, "STATUS_WAIT_2", "0x00000002",
                             wait_descr, source, "AS_OS_WINDOWS", True)
        allstat.default_item(context, "STATUS_WAIT_3", "0x00000003",
                             wait_descr, source, "AS_OS_WINDOWS", True)
        allstat.default_item(context, "STATUS_WAIT_63", "0x0000003F",
                             wait_descr, source, "AS_OS_WINDOWS", True)

        allstat.default_item(context, "STATUS_SUCCESS", "0x00000000",
                             "The operation completed successfully.", source,
                             "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "STATUS_USER_APC", "0x000000C0",
            "A user-mode APC was delivered before the given Interval expired.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "STATUS_KERNEL_APC", "0x00000100",
            "A kernel-mode APC was delivered before the given Interval expired.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "STATUS_ALERTED", "0x00000101",
            "The delay completed because the thread was alerted.", source,
            "AS_OS_WINDOWS", True)
        allstat.default_item(context, "STATUS_TIMEOUT", "0x00000102",
                             "The given Timeout interval expired.", source,
                             "AS_OS_WINDOWS", True)

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "NT_STATUS")
Ejemplo n.º 7
0
def gen_bugcheck():
    config = settings.CSettings("bugcheck", ["bugcheckdescr"])
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 generate_bugcheck_items)
        context["generator"] = "BUGCHECK"
        source = "bugcodes.h"

        allstat.default_item(
            context, "WINLOGON_FATAL_ERROR", "0xC000021A",
            "This means that that the Winlogon process terminated unexpectedly.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "MANUALLY_INITIATED_CRASH1", "0xDEADDEAD",
            "This indicates that the a manually initiated crash occurred.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "THREAD_STUCK_IN_DEVICE_DRIVER", "0x000000EA",
            "This indicates that a thread in a device driver is endlessly spinning.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "THREAD_STUCK_IN_DEVICE_DRIVER_M", "0x100000EA",
            "This indicates that a thread in a device driver is endlessly spinning.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "KERNEL_MODE_EXCEPTION_NOT_HANDLED_M", "0x1000008E",
            "This indicates that a kernel-mode program generated an exception which the error handler did not catch.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "UNEXPECTED_KERNEL_MODE_TRAP_M", "0x1000007F",
            "This indicates that a trap was generated by the Intel CPU and the kernel failed to catch this trap.",
            source, "AS_OS_WINDOWS", True)
        allstat.default_item(
            context, "SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M", "0x1000007E",
            "This indicates that a system thread generated an exception which the error handler did not catch.",
            source, "AS_OS_WINDOWS", True)

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "BUG_CHECK")
Ejemplo n.º 8
0
def gen_hresult():
    config = settings.CSettings("hresult", ["hpp2source"])
    with open(config.Cpp, "w") as out:
        context = allstat.status_item_generation(config, out,
                                                 generate_status_items)
        context["generator"] = "HRESULT"

        allstat.default_item(context, "S_OK", "0x00000000",
                             "Operation successful", "winerror.h",
                             "AS_OS_WINDOWS")
        allstat.default_item(context, "S_FALSE", "0x00000001", "Not a failure",
                             "winerror.h", "AS_OS_WINDOWS")

        allstat.generate_status_item_array(out, context)
        allstat.generate_hash_tables(context)
        allstat.generate_footer(out, context)

        with open(config.Hpp, "w") as out:
            allstat.generate_hpp(out, context, "HRESULT_VALUE")