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

Date: Thu, 26 Feb 2009 9:15:04 -0600
So i tried doing:

const BYTE* target;
tvb_memcpy(tvb, target, offset, data_length);

and i get the error:
packet-icom.c
packet-icom.c(246) : error C2220: warning treated as error - no 'object' file ge
nerated
packet-icom.c(246) : warning C4090: 'function' : different 'const' qualifiers
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.EXE"' : return code '0x2'
Stop.

can someone please clarify this?

Thank you,

Greg

=============
Date: Wed, 25 Feb 2009 20:36:09 +0000
From:  <gogrady@xxxxxxxxx>
To: wireshark-dev@xxxxxxxxxxxxx
Subject: Re: [Wireshark-dev] Memory Question
Cc: sebastien@xxxxxxxxx

I'm not sure if this sent because my email is being weird, so sorry if this is a duplicate. 

>and also, how would i go about freeing the memory? 
>Depending on how you're allocating the const BYTE* 
I have no idea. short of doing const BYTE* target; i dont know how to allocate 
or free. Maybe you could give me an example of how to allocate const BYTE* target, and then free it?
 
>How are you "sending" the data to your DLL? Are you linking this DLL to 
wireshark? 
i have linked the library using LoadLibrary() in my custom dissector plugin. I 
will be sending the data as a parameter in a wrapper function within my proxy 
dll to send it to the lib. 
 
Greg 
 
 
____________________________ 
On Wed, Feb 25, 2009 at 15:16, <gogrady@xxxxxxxxx> wrote: 
 
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. 
 
 
hmmm, well, I guess you know what you're doing :) 
 
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? 
That sounds reasonable! 
 
is that a type thats possible for this? 
Yes 
 
and also, how would i go about freeing the memory? 
Depending on how you're allocating the const BYTE* 
 
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. 
 
 
How are you "sending" the data to your DLL? Are you linking this DLL to 
wireshark? 
 
 
 
 
 
 
Regards, 
Sebastien Tandel 
=============