Changeset 77544 in vbox for trunk/include/iprt
- Timestamp:
- Mar 3, 2019 8:07:01 PM (6 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/fuzz.h
r77509 r77544 42 42 43 43 /** A fuzzer context handle. */ 44 typedef struct RTFUZZCTXINT *RTFUZZCTX;44 typedef struct RTFUZZCTXINT *RTFUZZCTX; 45 45 /** Pointer to a fuzzer context handle. */ 46 typedef RTFUZZCTX *PRTFUZZCTX;46 typedef RTFUZZCTX *PRTFUZZCTX; 47 47 /** NIL fuzzer context handle. */ 48 #define NIL_RTFUZZCTX ((RTFUZZCTX)~(uintptr_t)0)48 #define NIL_RTFUZZCTX ((RTFUZZCTX)~(uintptr_t)0) 49 49 /** A fuzzer input handle. */ 50 typedef struct RTFUZZINPUTINT *RTFUZZINPUT;50 typedef struct RTFUZZINPUTINT *RTFUZZINPUT; 51 51 /** Pointer to a fuzzer input handle. */ 52 typedef RTFUZZINPUT *PRTFUZZINPUT;52 typedef RTFUZZINPUT *PRTFUZZINPUT; 53 53 /** NIL fuzzer input handle. */ 54 #define NIL_RTFUZZINPUT ((RTFUZZINPUT)~(uintptr_t)0) 54 #define NIL_RTFUZZINPUT ((RTFUZZINPUT)~(uintptr_t)0) 55 56 57 /** A fuzzer target recorder handler. */ 58 typedef struct RTFUZZTGTRECINT *RTFUZZTGTREC; 59 /** Pointer to a fuzzer target recorder handle. */ 60 typedef RTFUZZTGTREC *PRTFUZZTGTREC; 61 /** NIL fuzzer target recorder handle. */ 62 #define NIL_RTFUZZTGTREC ((RTFUZZTGTREC)~(uintptr_t)0) 63 /** A fuzzed target state handle. */ 64 typedef struct RTFUZZTGTSTATEINT *RTFUZZTGTSTATE; 65 /** Pointer to a fuzzed target state handle. */ 66 typedef RTFUZZTGTSTATE *PRTFUZZTGTSTATE; 67 /** NIL fuzzed target state handle. */ 68 #define NIL_RTFUZZTGTSTATE ((RTFUZZTGTSTATE)~(uintptr_t)0) 55 69 56 70 57 71 /** Fuzzing observer handle. */ 58 typedef struct RTFUZZOBSINT *RTFUZZOBS;72 typedef struct RTFUZZOBSINT *RTFUZZOBS; 59 73 /** Pointer to a fuzzing observer handle. */ 60 typedef RTFUZZOBS *PRTFUZZOBS;74 typedef RTFUZZOBS *PRTFUZZOBS; 61 75 /** NIL fuzzing observer handle. */ 62 #define NIL_RTFUZZOBS ((RTFUZZOBS)~(uintptr_t)0)76 #define NIL_RTFUZZOBS ((RTFUZZOBS)~(uintptr_t)0) 63 77 64 78 … … 319 333 320 334 /** 321 * Releases a reference from the given fuzzing input handle, destroying it when rea aching 0.335 * Releases a reference from the given fuzzing input handle, destroying it when reaching 0. 322 336 * 323 337 * @returns New reference count on success, 0 if the fuzzing input got destroyed. … … 383 397 */ 384 398 RTDECL(int) RTFuzzInputRemoveFromCtxCorpus(RTFUZZINPUT hFuzzInput); 399 400 401 /** 402 * Creates a new fuzzed target recorder. 403 * 404 * @returns IPRT status code. 405 * @param phFuzzTgtRec Where to store the handle to the fuzzed target recorder on success. 406 */ 407 RTDECL(int) RTFuzzTgtRecorderCreate(PRTFUZZTGTREC phFuzzTgtRec); 408 409 /** 410 * Retains a reference to the given fuzzed target recorder handle. 411 * 412 * @returns New reference count on success. 413 * @param hFuzzTgtRec The fuzzed target recorder handle. 414 */ 415 RTDECL(uint32_t) RTFuzzTgtRecorderRetain(RTFUZZTGTREC hFuzzTgtRec); 416 417 /** 418 * Releases a reference from the given fuzzed target recorder handle, destroying it when reaching 0. 419 * 420 * @returns New reference count on success, 0 if the fuzzed target recorder got destroyed. 421 * @param hFuzzTgtRec The fuzzed target recorder handle. 422 */ 423 RTDECL(uint32_t) RTFuzzTgtRecorderRelease(RTFUZZTGTREC hFuzzTgtRec); 424 425 /** 426 * Creates a new empty fuzzed target state. 427 * 428 * @returns IPRT status code. 429 * @param hFuzzTgtRec The fuzzed target recorder handle. 430 * @param phFuzzTgtState Where to store the handle to the fuzzed target state on success. 431 */ 432 RTDECL(int) RTFuzzTgtRecorderCreateNewState(RTFUZZTGTREC hFuzzTgtRec, PRTFUZZTGTSTATE phFuzzTgtState); 433 434 /** 435 * Retains a reference to the given fuzzed target state handle. 436 * 437 * @returns New reference count on success. 438 * @param hFuzzTgtState The fuzzed target state handle. 439 */ 440 RTDECL(uint32_t) RTFuzzTgtStateRetain(RTFUZZTGTSTATE hFuzzTgtState); 441 442 /** 443 * Releases a reference from the given fuzzed target state handle, destroying it when reaching 0. 444 * 445 * @returns New reference count on success, 0 if the fuzzed target recorder got destroyed. 446 * @param hFuzzTgtState The fuzzed target state handle. 447 */ 448 RTDECL(uint32_t) RTFuzzTgtStateRelease(RTFUZZTGTSTATE hFuzzTgtState); 449 450 /** 451 * Resets the given fuzzed target state to an empty state (keeping allocated memory). 452 * 453 * @returns IPRT status code. 454 * @param hFuzzTgtState The fuzzed target state handle. 455 * 456 * @note Useful when the state is not added to the recorded set to avoid allocating memory. 457 */ 458 RTDECL(int) RTFuzzTgtStateReset(RTFUZZTGTSTATE hFuzzTgtState); 459 460 /** 461 * Finalizes the given fuzzed target state, making it readonly. 462 * 463 * @returns IPRT status code. 464 * @param hFuzzTgtState The fuzzed target state handle. 465 */ 466 RTDECL(int) RTFuzzTgtStateFinalize(RTFUZZTGTSTATE hFuzzTgtState); 467 468 /** 469 * Adds the given state to the set for the owning target recorder. 470 * 471 * @returns IPRT status code. 472 * @retval VERR_ALREADY_EXISTS if the state is already existing in the recorder set. 473 * @param hFuzzTgtState The fuzzed target state handle. 474 * 475 * @note This also finalizes the target state if not already done. 476 */ 477 RTDECL(int) RTFuzzTgtStateAddToRecorder(RTFUZZTGTSTATE hFuzzTgtState); 478 479 /** 480 * Appends the given stdout output to the given target state. 481 * 482 * @returns IPRT status code. 483 * @param hFuzzTgtState The fuzzed target state handle. 484 * @param pvStdOut Pointer to the stdout data buffer. 485 * @param cbStdOut Size of the stdout data buffer in bytes. 486 */ 487 RTDECL(int) RTFuzzTgtStateAppendStdoutFromBuf(RTFUZZTGTSTATE hFuzzTgtState, const void *pvStdOut, size_t cbStdOut); 488 489 /** 490 * Appends the given stderr output to the given target state. 491 * 492 * @returns IPRT status code. 493 * @param hFuzzTgtState The fuzzed target state handle. 494 * @param pvStdErr Pointer to the stderr data buffer. 495 * @param cbStdErr Size of the stderr data buffer in bytes. 496 */ 497 RTDECL(int) RTFuzzTgtStateAppendStderrFromBuf(RTFUZZTGTSTATE hFuzzTgtState, const void *pvStdErr, size_t cbStdErr); 498 499 /** 500 * Appends the given stdout output to the given target state, reading from the given pipe. 501 * 502 * @returns IPRT status code. 503 * @param hFuzzTgtState The fuzzed target state handle. 504 * @param hPipe The stdout pipe to read the data from. 505 */ 506 RTDECL(int) RTFuzzTgtStateAppendStdoutFromPipe(RTFUZZTGTSTATE hFuzzTgtState, RTPIPE hPipe); 507 508 /** 509 * Appends the given stderr output to the given target state, reading from the given pipe. 510 * 511 * @returns IPRT status code. 512 * @param hFuzzTgtState The fuzzed target state handle. 513 * @param hPipe The stdout pipe to read the data from. 514 */ 515 RTDECL(int) RTFuzzTgtStateAppendStderrFromPipe(RTFUZZTGTSTATE hFuzzTgtState, RTPIPE hPipe); 385 516 386 517 -
trunk/include/iprt/mangling.h
r77509 r77544 1063 1063 # define RTFuzzObsSetTestBinaryArgs RT_MANGLER(RTFuzzObsSetTestBinaryArgs) 1064 1064 # define RTFuzzObsSetTmpDirectory RT_MANGLER(RTFuzzObsSetTmpDirectory) 1065 # define RTFuzzTgtRecorderCreate RT_MANGLER(RTFuzzTgtRecorderCreate) 1066 # define RTFuzzTgtRecorderCreateNewState RT_MANGLER(RTFuzzTgtRecorderCreateNewState) 1067 # define RTFuzzTgtRecorderRelease RT_MANGLER(RTFuzzTgtRecorderRelease) 1068 # define RTFuzzTgtRecorderRetain RT_MANGLER(RTFuzzTgtRecorderRetain) 1069 # define RTFuzzTgtStateAddToRecorder RT_MANGLER(RTFuzzTgtStateAddToRecorder) 1070 # define RTFuzzTgtStateAppendStderrFromBuf RT_MANGLER(RTFuzzTgtStateAppendStderrFromBuf) 1071 # define RTFuzzTgtStateAppendStderrFromPipe RT_MANGLER(RTFuzzTgtStateAppendStderrFromPipe) 1072 # define RTFuzzTgtStateAppendStdoutFromBuf RT_MANGLER(RTFuzzTgtStateAppendStdoutFromBuf) 1073 # define RTFuzzTgtStateAppendStdoutFromPipe RT_MANGLER(RTFuzzTgtStateAppendStdoutFromPipe) 1074 # define RTFuzzTgtStateFinalize RT_MANGLER(RTFuzzTgtStateFinalize) 1075 # define RTFuzzTgtStateRelease RT_MANGLER(RTFuzzTgtStateRelease) 1076 # define RTFuzzTgtStateReset RT_MANGLER(RTFuzzTgtStateReset) 1077 # define RTFuzzTgtStateRetain RT_MANGLER(RTFuzzTgtStateRetain) 1065 1078 # define RTGetOpt RT_MANGLER(RTGetOpt) 1066 1079 # define RTGetOptArgvFree RT_MANGLER(RTGetOptArgvFree)
Note:
See TracChangeset
for help on using the changeset viewer.