Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Windows SAL annotations messes "List Methods"

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
TripShock Posted - Jan 16 2013 : 1:11:24 PM
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.
4   L A T E S T    R E P L I E S    (Newest First)
support Posted - Feb 25 2013 : 12:32:15 PM
case=71855 is a duplicate of case=70669 and is fixed in build 1929
feline Posted - Jan 17 2013 : 8:20:13 PM
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.
TripShock Posted - Jan 17 2013 : 12:16:00 PM
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.
feline Posted - Jan 16 2013 : 10:25:45 PM
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

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000