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
 Windows SAL annotations messes "List Methods"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

TripShock
Junior Member

12 Posts

Posted - Jan 16 2013 :  1:11:24 PM  Show Profile  Reply with Quote
I am writing Windows KMDF code in Visual Studio 2012. You can easily generate a simple KMDF project using the New Project wizard if you have Windows Driver Kit 8.0 installed.

When writing Windows driver code, one can annotate their functions using SAL. Example:


_IRQL_requires_(PASSIVE_LEVEL)
NTSTATUS
SimpleDriverCreateDevice(
    _Inout_ PWDFDEVICE_INIT DeviceInit
    );


The _IRQL_requires_(PASSIVE_LEVEL) is a SAL annotation on the function. In the presence of such annotations, when I go to the implementation file, and hit Alt-M to list the methods, what is listed is _IRQL_requires_(PASSIVE_LEVEL) instead of SimpleDriverCreateDevice. Unfortunately, this makes this feature completely useless in the presence of such code.

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Jan 16 2013 :  10:25:45 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=71855

Can you please try editing VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add the lines:


#define _IRQL_requires_max_(IRQL)
#define _IRQL_requires_min_(IRQL)
#define _IRQL_requires_(IRQL)
#define _IRQL_raises_(IRQL)
#define _IRQL_saves_
#define _IRQL_restores_
#define _IRQL_saves_global_(KIND, PARAM)
#define _IRQL_restores_global_(KIND, PARAM)
#define _IRQL_always_function_min_(VALUE)
#define _IRQL_always_function_max_(VALUE)
#define _IRQL_requires_same_
#define _IRQL_uses_cancel_
#define _IRQL_is_cancel_


at the bottom, making sure there is a blank line at the end of the file. This file is used to help VA's parser with difficult code, and can be used to work around odd effects. After modifying this file you need to rebuild the VA symbol database for the changes to take effect:

VA Options -> Performance -> General -> Rebuild symbol databases

This fixes the problem for me. The extra entries came from this page:

http://msdn.microsoft.com/en-us/library/windows/hardware/hh454226%28v=vs.85%29.aspx

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

TripShock
Junior Member

12 Posts

Posted - Jan 17 2013 :  12:16:00 PM  Show Profile  Reply with Quote
Thanks! That worked.

%ProgramFile% was not where Visual Assist was installed. I had to dig for it in %LocalAppData%\\Microsoft\\VisualStudio\\11.0\\Extensions. Although this may be because I am currently using the trial version.

As a suggestion for the next release, you should probably just take the entire contents of no_sal2.h (ships with the Windows 8 SDK/WDK) and dump it into StdAfx.h. I see that SAL v1 definitions are already in StdAfx.h. SAL is now in v2, so you should #define those as well.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Jan 17 2013 :  8:20:13 PM  Show Profile  Reply with Quote
I have added the comment about no_sal2.h to the case, thank you for this.

The FAQ was out of date, apologies for that, and I am glad you found the VA stdafx.h file, hopefully without to many difficulties. I have now updated the FAQ to explain where to look for VS2010 and VS2012, which both use a different install directory for VA.

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

support
Whole Tomato Software

5566 Posts

Posted - Feb 25 2013 :  12:32:15 PM  Show Profile  Reply with Quote
case=71855 is a duplicate of case=70669 and is fixed in build 1929
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000