Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Nasty bug caused by incorrect VA tooltip
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BruteForce
Senior Member

Greece
32 Posts

Posted - Oct 29 2008 :  08:39:49 AM  Show Profile  Reply with Quote
First let's start with the definitions:

WinBase.h ==> #define FillMemory RtlFillMemory
WinNT.h ==> #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))


Note that RtlFillMemory and memset have their two numeric parameters in reverse order.

So in my source file I started typing: "FillMemory("
The VA tooltip appears showing the definition of RtlFillMemory but note that the highlighted parameter is that of memset NOT of RtlFillMemory.
Of course that's a bit hard to spot when all you care about is to write some code, so I didn't notice at that time.
As soon as I typed my pointer variable and entered the comma then the "Fill" parameter of memset got highlighted, so I naturally entered the fill value... Then another comma and the "Length" parameter got highlighted... so I entered the length. Everything compiled normally and I started to debug the code.

As you can realize the catastrophic results widely depend on the values entered and where the target memory is... In my case the buffer was on the stack, so I got some nasty debug warnings when I returned from the function which made me start looking as to what could be going wrong in such a simple function.

Warm Regards,
Dimitris Staikos

When all else fails try common sense.

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Oct 29 2008 :  2:25:38 PM  Show Profile  Reply with Quote
*ah* yes, a very nasty problem:





I am wondering how to solve it. We have the opposite problem when the function return type contains round brackets, e.g.

#define FIREAPI_DLL_SPEC __declspec(dllimport)
#define FIREAPI(type) FIREAPI_DLL_SPEC type

FIREAPI(long) ReturnTypeInBrackets(int nParam1, int nParam2) { return 0; }


which has been recently fixed.

I wonder if adding a special case for macro tooltips would work correctly.

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jan 27 2009 :  9:06:40 PM  Show Profile  Reply with Quote
Bolding of macro parameters is case=22603.

case=22603 is fixed in build 1715

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000