Set the number of object’s bytes to retrieve by the SDK and pass to the callback function as the KAV_FIRSTBYTES structure. The object’s first, for example, ten bytes are sent to the function together with the EVENT_FIRSTBYTES event; the next ten bytes will be sent if the function returns with the CLBK_MOREBYTES code.
You can handle this event, for example, to initialize a pointer to the sequence of bytes which are received, as shown in the example below:
Example: CALLBACK_RESULT clbk_fn ( unsigned long dwEvent, unsigned long dwParam1, unsigned long dwParam2, const char *pObjectName, const char *pVirusName, unsigned long dwObjectID, unsigned long dwMonitorID, void *pUserContext) { switch (dwEvent) { case EVENT_FIRSTBYTES: { printf("EVENT_FIRSTBYTES\n");
union { unsigned long long qw; unsigned int dw[2]; } FBAddr; FBAddr.dw[0] = dwParam1; FBAddr.dw[1] = dwParam2;
KAV_FIRSTBYTES *ptr = reinterpret_cast<KAV_FIRSTBYTES*>(FBAddr.qw); printf(" Buffer size = %d\n", (int)ptr->m_dwBufferSize); print_hex_buf(ptr->m_Buffer, ptr->m_dwBufferSize); } break; ... |
For information on this structure, see KAV_FIRSTBYTES. For information on the EVENT_FIRSTBYTES event, see section "Event notification codes".
Requires that in-progress events are turned on. For more information about these functions, see kaveEnableInprogressEvents, kaveIsEnabledInprogressEvents, kaveSetCallbackInterval.
Syntax
HRESULT kaveSetEventFirstBytesBufferSize (
unsigned long dwBufferSize);
Parameters
The kaveSetEventFirstBytesBufferSize function has the following parameters.
kaveSetEventFirstBytesBufferSize function parameters
Name |
Type |
Description |
|---|---|---|
|
in |
The number of object’s first bytes. |
Return value
If the kaveSetEventFirstBytesBufferSize function succeeds, its return value is S_OK.
For other return codes, see section "Return codes".
Page top