Connecting Tech Pros Worldwide Forums | Help | Site Map

C++ interop & reliability contracts

Can
Guest
 
Posts: n/a
#1: Feb 16 '07
Some parts of my code need constrained execution regions and in most of
these regions I must call native functions to clean up unmanaged resources.
CLR requires that every method in the call graph has an appropriate
ReliabilityContract attribute applied to it in order to prepare the region.
But how is it possible to mark a native function entry point with a
ReliabilityContract attribute using C++ interop?

Or differently asked; is there a way for the compiler to generate an entry
point that is equivalent to the P/Invoke declaration below?

[ReliabilityContract(Consistency.WillNotCorruptStat e, Cer.MayFail),
DllImport(...)]
static extern bool NativeMethod(...)

Can


Closed Thread