Wireshark-dev: Re: [Wireshark-dev] Memory Question

Date: Wed, 25 Feb 2009 18:16:06 +0000
Hi Sebastien,

I will be taking the data and sending it to a dll that i am using as a proxy. the proxy will send the data to a lib that will create a msg type object to be sent back to the proxy dll, then it will be decoded by another lib that has functions to return parts of the message. the msg type object takes a const BYTE* as a parameter along with the size of the buffer. so i guess i want target to be a const BYTE* then eh? is that a type thats possible for this? and also, how would i go about freeing the memory? or if its possible to send just part of the tvbuff then i could use that as a parameter, though i dont know a function to do that. 

thanks for the help,
Greg

______________________-
Hi,

   target is what *you* want it to be. tvb_memcpy is a convenient way to copy a part of the tvbuff in a part of the memory *you* control. iow, you have *allocated* this part of memory and *you* are responsible to *free* this memory.

   Can I ask you where is this "elsewhere" and what is its purpose? Could you not simply use the tvbuff as-is instead? Could you explain us the reasons for which you would like to use tvb_memcpy?


Regards,
Sebastien Tandel

On Wed, Feb 25, 2009 at 14:35, <gogrady@xxxxxxxxx> wrote:
I am using tvb_memcpy(tvb, void* target, offset, data_length); to grab a single part of the tvbuff to send elsewhere for decoding. However, what is target? i think its memory, but how do i free memory? i'm confused about how to use tvb_memcpy for this.

Thanks,

Greg
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe