VirtualBox

Changeset 77509 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Feb 28, 2019 7:14:03 PM (6 years ago)
Author:
vboxsync
Message:

Runtime/fuzz: Updates

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/fuzz.h

    r77482 r77509  
    7878} RTFUZZCTXTYPE;
    7979
     80
    8081/** @name RTFUZZCTX_F_XXX - Flags for RTFuzzCtxCfgSetBehavioralFlags
    8182 * @{ */
     
    8687/** @} */
    8788
     89
     90/**
     91 * Fuzzing context state export callback.
     92 *
     93 * @returns IPRT status code.
     94 * @param   hFuzzCtx            Handle of the fuzzing context.
     95 * @param   pvBuf               The data to write.
     96 * @param   cbWrite             Number of bytes to write.
     97 * @param   pvUser              Opaque user data passed in RTFuzzCtxStateExport().
     98 */
     99typedef DECLCALLBACK(int) FNRTFUZZCTXEXPORT(RTFUZZCTX hFuzzCtx, const void *pvBuf, size_t cbWrite, void *pvUser);
     100/** Pointer to a fuzzing context state export callback. */
     101typedef FNRTFUZZCTXEXPORT *PFNRTFUZZCTXEXPORT;
     102
     103/**
     104 * Fuzzing context state import callback.
     105 *
     106 * @returns IPRT status code.
     107 * @param   hFuzzCtx            Handle of the fuzzing context.
     108 * @param   pvBuf               Where to store the read data.
     109 * @param   cbRead              Number of bytes to read.
     110 * @param   pcbRead             Where to store the amount of data written, optional.
     111 * @param   pvUser              Opaque user data passed in RTFuzzCtxCreateFromState().
     112 */
     113typedef DECLCALLBACK(int) FNRTFUZZCTXIMPORT(RTFUZZCTX hFuzzCtx, void *pvBuf, size_t cbRead, size_t *pcbRead, void *pvUser);
     114/** Pointer to a fuzzing context state export callback. */
     115typedef FNRTFUZZCTXIMPORT *PFNRTFUZZCTXIMPORT;
     116
     117
    88118/**
    89119 * Creates a new fuzzing context.
     
    100130 * @returns IPRT status code.
    101131 * @param   phFuzzCtx           Where to store the handle to the fuzzing context on success.
    102  * @param   pvState             The pointer to the fuzzing state.
    103  * @param   cbState             Size of the state buffer in bytes.
    104  */
    105 RTDECL(int) RTFuzzCtxCreateFromState(PRTFUZZCTX phFuzzCtx, const void *pvState, size_t cbState);
     132 * @param   pfnImport           State import callback.
     133 * @param   pvUser              Opaque user data to pass to the callback.
     134 */
     135RTDECL(int) RTFuzzCtxCreateFromState(PRTFUZZCTX phFuzzCtx, PFNRTFUZZCTXIMPORT pfnImport, void *pvUser);
     136
     137/**
     138 * Creates a new fuzzing context loading the state from the given memory buffer.
     139 *
     140 * @returns IPRT status code.
     141 * @param   phFuzzCtx           Where to store the handle to the fuzzing context on success.
     142 * @param   pvState             Pointer to the memory containing the state.
     143 * @param   cbState             Size of the state buffer.
     144 */
     145RTDECL(int) RTFuzzCtxCreateFromStateMem(PRTFUZZCTX phFuzzCtx, const void *pvState, size_t cbState);
    106146
    107147/**
     
    135175 * @returns IPRT statuse code
    136176 * @param   hFuzzCtx            The fuzzing context to export.
    137  * @param   ppvState            Where to store the buffer of the state on success, free with RTMemFree().
    138  * @param   pcbState            Where to store the size of the context on success.
    139  */
    140 RTDECL(int) RTFuzzCtxStateExport(RTFUZZCTX hFuzzCtx, void **ppvState, size_t *pcbState);
     177 * @param   pfnExport           Export callback.
     178 * @param   pvUser              Opaque user data to pass to the callback.
     179 */
     180RTDECL(int) RTFuzzCtxStateExport(RTFUZZCTX hFuzzCtx, PFNRTFUZZCTXEXPORT pfnExport, void *pvUser);
     181
     182/**
     183 * Exports the given fuzzing context state to memory allocating the buffer.
     184 *
     185 * @returns IPRT status code.
     186 * @param   hFuzzCtx            The fuzzing context to export.
     187 * @param   ppvState            Where to store the pointer to the memory containing state on success.
     188 *                              Free with RTMemFree().
     189 * @param   pcbState            Where to store the size of the state in bytes.
     190 */
     191RTDECL(int) RTFuzzCtxStateExportToMem(RTFUZZCTX hFuzzCtx, void **ppvState, size_t *pcbState);
    141192
    142193/**
  • trunk/include/iprt/mangling.h

    r77482 r77509  
    10371037# define RTFuzzCtxCreateFromState                       RT_MANGLER(RTFuzzCtxCreateFromState)
    10381038# define RTFuzzCtxCreateFromStateFile                   RT_MANGLER(RTFuzzCtxCreateFromStateFile)
     1039# define RTFuzzCtxCreateFromStateMem                    RT_MANGLER(RTFuzzCtxCreateFromStateMem)
    10391040# define RTFuzzCtxInputGenerate                         RT_MANGLER(RTFuzzCtxInputGenerate)
    10401041# define RTFuzzCtxRelease                               RT_MANGLER(RTFuzzCtxRelease)
     
    10431044# define RTFuzzCtxStateExport                           RT_MANGLER(RTFuzzCtxStateExport)
    10441045# define RTFuzzCtxStateExportToFile                     RT_MANGLER(RTFuzzCtxStateExportToFile)
     1046# define RTFuzzCtxStateExportToMem                      RT_MANGLER(RTFuzzCtxStateExportToMem)
    10451047# define RTFuzzInputAddToCtxCorpus                      RT_MANGLER(RTFuzzInputAddToCtxCorpus)
    10461048# define RTFuzzInputMutateStreamData                    RT_MANGLER(RTFuzzInputMutateStreamData)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette