<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Constructopaedia</title><subtitle type="html">Martyn Lovell&amp;#39;s blog about software development</subtitle><id>http://blogs.msdn.com/b/martynl/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/martynl/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/martynl/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2005-10-05T13:56:06Z</updated><entry><title>C++ Connections</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/martynl/archive/2005/10/14/481145.aspx" /><id>http://blogs.msdn.com/b/martynl/archive/2005/10/14/481145.aspx</id><published>2005-10-14T20:27:34Z</published><updated>2005-10-14T20:27:34Z</updated><content type="html">&lt;P&gt;

&lt;div class=Section1&gt;

&lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt;
font-family:Arial'&gt;Just finished arranging my travel to &lt;a
href="http://www.devconnections.com/shows/cppfall2005/default.asp?s=67"&gt;C++
Connections&lt;/a&gt;. I&amp;#8217;m speaking on our &lt;a
href="http://www.devconnections.com/shows/cppfall2005/default.asp?c=1&amp;amp;s=67"&gt;Security
work in the Standard C++ Library&lt;/a&gt;. I&amp;#8217;ll be in &lt;a
href="http://www.luxor.com/"&gt;Vegas&lt;/a&gt; from 7&lt;sup&gt;th&lt;/sup&gt;-11&lt;sup&gt;th&lt;/sup&gt;. Hopefully
there will be a chance for some of us to meet up and chat about Libraries
futures. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt;
font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt;
font-family:Arial'&gt;Martyn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt;
font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=481145" width="1" height="1"&gt;</content><author><name>martynl</name><uri>http://blogs.msdn.com/martynl/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Why does VC8 install libraries to WinSxS?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/martynl/archive/2005/10/13/480880.aspx" /><id>http://blogs.msdn.com/b/martynl/archive/2005/10/13/480880.aspx</id><published>2005-10-14T03:50:47Z</published><updated>2005-10-14T03:50:47Z</updated><content type="html">&lt;P&gt;

&lt;div class=Section1&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;One of the changes introduced by &lt;a
href="http://msdn.microsoft.com/visualc/whidbey/"&gt;Visual C++ 2005&lt;/a&gt; is a
change in how we deploy the Visual C++ Runtime Libraries (CRT, MFC, ATL). Deployment
of the runtimes has been a complex and controversial question across many
versions. What we&amp;#8217;ve attempted to do in this version of the product is both
simplify our plan and make it more robust in the face of potential security
situations. Explaining this is going to take a while, so I&amp;#8217;m going to try
to spend a few blog posts on this theme.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Let me start with a little history. This
story explains some of the earliest, and most powerful motivation for changing
our deployment model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;b&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'&gt;Static Linking&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Microsoft C and later Visual C++ has
included libraries since the very first version of the product, as does every C
and C++ product. These libraries were typically static-link binaries,
consisting of compiled .objs (bound into .libs) that you link to your own
application. The libraries do everything from the mundane (such as running initialization
code) to the fundamental (implementing printf so that you can say &amp;#8220;hello
world&amp;#8221;). Because the libraries were static-linked into your program by
the linker, they became inescapably part of your program. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;This static linking had very clear
implications for what Microsoft call &lt;i&gt;&lt;span style='font-style:italic'&gt;servicing&lt;/span&gt;&lt;/i&gt;
&amp;#8211; the process of shipping updates to existing products. A product like
Microsoft Office has a clear Servicing model. Customers buy Microsoft Office
from their local software store, and if they later need an update to Office,
they contact Microsoft to get that update. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Servicing a development tool is more
complex. A customer goes and buys &lt;i&gt;&lt;span style='font-style:italic'&gt;LovellSoft
&lt;a href="http://www.lego.com/eng/Default.aspx"&gt;Construction Toy Organizer&lt;/a&gt;
1.0 &lt;/span&gt;&lt;/i&gt;from my local store. They find a bug in the software, and contact
&lt;i&gt;&lt;span style='font-style:italic'&gt;LovellSoft. LovellSoft&lt;/span&gt;&lt;/i&gt;, in turn,
determines that the bug was caused by a problem with a piece of Visual C++.
They contact Microsoft. Microsoft ships &lt;i&gt;&lt;span style='font-style:italic'&gt;LovellSoft&lt;/span&gt;&lt;/i&gt;
an updated version of the Visual C++ Libraries with a fix for their problem.
They then use this update to build an updated copy of &lt;i&gt;&lt;span
style='font-style:italic'&gt;Construction Toy Organizer, &lt;/span&gt;&lt;/i&gt;which they
ship back to their customer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;You can see how Microsoft has no direct
relationship with &lt;i&gt;&lt;span style='font-style:italic'&gt;LovellSoft&lt;/span&gt;&lt;/i&gt;&amp;#8217;s
customer. If the &lt;i&gt;&lt;span style='font-style:italic'&gt;Construction Toy Organizer
1.0&lt;/span&gt;&lt;/i&gt; user contacted Microsoft directly, there is no way we could have
helped, even if we had wanted to, because our code has been linked in with code
supplied by &lt;i&gt;&lt;span style='font-style:italic'&gt;LovellSoft&lt;/span&gt;&lt;/i&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;As you can see, static linking can present
a real servicing problem if a security problem is found in static linked code. This
leads to a recommendation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;i&gt;&lt;span
style='font-style:italic'&gt;Avoid static-linking library code into your
application wherever possible. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;When security problems have been
found in static linked code in the past (such as this &lt;a
href="http://www.cert.org/advisories/CA-2002-07.html"&gt;one&lt;/a&gt;), the community
has had to wait until many vendors who used the library rebuilt versions of
their product. This can take a long time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;b&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'&gt;Dynamic Linking&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;For some time, we have also shipped
our runtime libraries as a dynamic-link library (DLL). DLLs bring with them
several benefits (small binaries, less disk space, reduced code duplication), but
also creates some new problems (installation location, versioning) &amp;#8211;
collectively known as &amp;#8220;DLL Hell&amp;#8221; in some circles.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;DLLs make our servicing obligations
more ambiguous. When you ship a DLL that you got from Microsoft, it&amp;#8217;s &lt;b&gt;&lt;span
style='font-weight:bold'&gt;technically&lt;/span&gt;&lt;/b&gt; possible for &lt;i&gt;&lt;span
style='font-style:italic'&gt;LovellSoft&amp;#8217;s&lt;/span&gt;&lt;/i&gt; customer to come
directly to Microsoft and get a new version of the DLL with the fix they need.
Note that I say &amp;#8220;technically&amp;#8221;, because in practice, we&amp;#8217;ve
kept the servicing relationship for our library DLLs the same as the relationship
for our static linked code. We provide updated DLLs to software developers, who
then deploy those DLLs to their customers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;b&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'&gt;Windows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Servicing of one version of our libraries
(msvcrt.dll and mfc42.dll) is even more complex because the operating system
took a hard dependency on the library, meaning that they ship and service the
DLL. This means that if &lt;i&gt;&lt;span style='font-style:italic'&gt;LovellSoft&lt;/span&gt;&lt;/i&gt;
are using VC6 to build their application, and they find a bug that they need a
fix for, they&amp;#8217;d need to get a fix from Visual Studio (so that they could
redistribute msvcrt.dll to Windows 95 and Windows NT4), and get operating
system patches for whichever of Windows 2000, Windows XP and Windows Server 2003
that their application targets. Complicated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Of course, this problem is now
purely hypothetical, because Visual C++ 6 (from Visual Studio 98) has been unsupported
since the end of last month.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;b&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'&gt;Installation
Location Policy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;The nub of DLL hell problems is a
versioning one. Does everyone on the system get the same version of a DLL? Can
a rogue application installer &amp;#8216;roll back&amp;#8217; to an older, broken DLL?
If a new application installs a broken version of a DLL, can other applications
opt-out?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Our traditional motivation around
DLLs had been &amp;#8220;sharing&amp;#8221; disk and memory pages, so we focused on
installing DLLs like msvcr40.dll and msvcr20.dll to System32. But this strategy
created the DLL hell problem, as installation of these DLLs frequently broke
other programs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Up to VC6, our advice was &amp;#8211;
install your CRT DLL in system32 at setup time, assuming it is newer, and
reference count the installation. A side effect of this policy is that, in an
emergency, we do have a way to update msvcrt.dll. Since it&amp;#8217;s required to
be installed in a central location, and since the Windows loader prefers loading
from that location over most others, we have the ability to deploy fixes
directly into system32. This isn&amp;#8217;t as robust a plan as you might think,
but it was an avenue available to us.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;During the time of VC6, Microsoft
started to get serious about addressing DLL Hell, and as a result for VC7, our
advice was the opposite &amp;#8211; install your CRT DLL to your application&amp;#8217;s
EXE directory and NOT to system32. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;This has the advantage that one
installation won&amp;#8217;t interfere with another. It also helps create software
that can be installed by non-administrators, run from networks or &amp;#8216;xcopy-deployed&amp;#8217;
&amp;#8211; three things that we were getting much more interested in.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;However, it also has the disadvantage
that with the VC7 libraries, we have no way of servicing these DLLs centrally. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;b&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'&gt;The Need for Central
Servicing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;As described above, we normally
leave servicing of library DLLs to software vendors. They have the best
knowledge of their customers needs, and so have best judgment on when and how
to deploy updates to their software.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;But, some events transcend this kind
of policy. When a time-critical security problem is found in a &lt;a
href="http://www.microsoft.com/technet/security/bulletin/ms02-039.mspx"&gt;redistributable
component&lt;/a&gt; [such as an active worm on the Internet], Microsoft can&amp;#8217;t
just inform software developers of the problem and wait for them to update their
products. Customers and partners will expect us to provide central updates to
resolve these kinds of critical issues via &lt;a href="http://windowsupdate.com/"&gt;http://windowsupdate.com&lt;/a&gt;.
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;The event linked above happened just
after I took over leadership of the C++ Libraries team, and made me fundamentally
rethink my assumptions about how we should ship our binaries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;b&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial;font-weight:bold'&gt;A Solution&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Luckily, in 1999 a team in Windows started
work on creating solutions for exactly these kinds of problems. Their efforts
resulted in the addition of manifest support to Microsoft Windows XP, and
provided the foundation for us to solve the servicing problem described above,
as well as several others that faced us. The solution means that most Visual
C++-build DLLs and EXEs have a manifest, but also means that, if an emergency
happens, we&amp;#8217;ll be much better prepared than we were in previous versions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;In a future entry I&amp;#8217;ll describe
how this solution works, and other benefits it has, and provide some tips and
tricks for problems you might hit.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;In the mean time, write and tell me
what you think.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;Martyn &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-bottom:6.0pt'&gt;&lt;font size=2 face=Arial&gt;&lt;span
style='font-size:10.0pt;font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=480880" width="1" height="1"&gt;</content><author><name>martynl</name><uri>http://blogs.msdn.com/martynl/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Annotations - yet more help finding buffer overflows</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/martynl/archive/2005/10/10/479332.aspx" /><id>http://blogs.msdn.com/b/martynl/archive/2005/10/10/479332.aspx</id><published>2005-10-11T00:15:00Z</published><updated>2005-10-11T00:15:00Z</updated><content type="html">&lt;P&gt;
&lt;DIV class=Section1&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;a href="http://blogs.msdn.com/martynl/archive/2005/10/06/478041.aspx"&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Last time&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/A&gt; I talked about how we used template overloads to help automatically transform safe calls to strcpy into strcpy_s. But not all calls to strcpy are safe, of course. Consider this code:&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;void GetIntegratedCutlery(char *out)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy(out, “spork”);&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;In &lt;A href="http://msdn2.microsoft.com/"&gt;Visual Studio 2005&lt;/A&gt;, even with &lt;A href="http://msdn2.microsoft.com/en-us/library/ms175759"&gt;template overloads enabled&lt;/A&gt;, this will give you a &lt;A href="http://msdn2.microsoft.com/en-us/library/wd3wzwts"&gt;deprecation warning&lt;/A&gt; telling you it isn’t safe. strcpy isn’t told how big out is going to be.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Let’s imagine an improved version of the function&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;void GetIntegratedCutleryEx(char *out, size_t size)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy_s(out, size, “spork”);&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;This function is now at least safe – strcpy_s has required us to tell strcpy how large the buffer out is. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;A criticism I’ve heard of this kind of fix is that we have just ‘moved’ the problem, since now we have to ensure that the value passed to size is correct. This criticism has some validity – nothing about this code ensures that size has a correct value. One can argue that developers, especially maintenance ones, are more likely to get size correct when the have to write it explicitly. But this isn’t the strongest argument for this change. The best argument is that the buffer size is now explicit in the code and can be reasoned about by the toolset (as well as by developers themselves). &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;You may have noticed that the standard library headers have gotten much bigger in Visual C++ 2005. Compare the declaration of strstr from VC++ 2003:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="TEXT-INDENT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;_CRTIMP &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;/FONT&gt; *&amp;nbsp; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;__cdecl&lt;/SPAN&gt;&lt;/FONT&gt; strstr(&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;/FONT&gt; *, &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;/FONT&gt; *);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;with the one from VC++ 2005:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="TEXT-INDENT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;_CRTIMP __checkReturn _CONST_RETURN &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;/FONT&gt; *&amp;nbsp; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;__cdecl&lt;/SPAN&gt;&lt;/FONT&gt; strstr(__in_z &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;/FONT&gt; * _Str, __in_z &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;char&lt;/SPAN&gt;&lt;/FONT&gt; * _SubStr);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;There are three major changes here:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="mso-list: l0 level1 lfo1"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;_CONST_RETURN – this was added to bring us closer into conformance with the C++ standard. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;
&lt;LI class=MsoNormal style="mso-list: l0 level1 lfo1"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Parameter names (_Str, _SubStr) – these were added to improve the intellisense user experience in the IDE, as well as for readability&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt; 
&lt;LI class=MsoNormal style="mso-list: l0 level1 lfo1"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/d3bbz7tz"&gt;Code annotations&lt;/A&gt; (__checkReturn, __in_z) – these annotations allow analysis tools to understand the intent of code better, and detect more issues&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms140964"&gt;Annotations&lt;/A&gt; are the important ones for our purposes. __in_z actually tells the compiler quite a lot about the parameters of a function [see sal.h for the full definition], but at a high level it says “this is a input string (__in) that is null terminated (_z)”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Annotations are used to find problems when you throw the /analyze switch on the compiler. For example, consider this function:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;#include &amp;lt;string.h&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;#include &amp;lt;wchar.h&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;wchar_t *AllocateAndFillW(size_t n, wchar_t c) throw(...)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wchar_t *retVal=(wchar_t *)malloc(n*sizeof(wchar_t));&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wmemset(retVal, c, n*sizeof(wchar_t)); /* line 9 */&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;return retVal;&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;You can probably spot the bug on line 9 easily, but /analyze can do it for you:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="TEXT-INDENT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;f:\an.cpp(9) : warning C6383: buffer overrun due to conversion of an element count into a byte count: an element count is expected for parameter '3' in call to'wmemset'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;I&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-STYLE: italic"&gt;[Note that /analyze is only supported in the &lt;?xml:namespace prefix = st1 /&gt;&lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;Enterprise&lt;/st1:City&gt;&lt;/st1:place&gt; (team development) &amp;nbsp;versions of the product]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;This happens because we’ve added annotations to malloc and wmemset in the CRT headers. /analyze uses those to see the problem. It sees that malloc returns &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;__bcount_opt(_Size)&lt;/SPAN&gt;&lt;/FONT&gt; a writable block of size bytes (bcount) which may be null (_opt). It sees that wmemset takes &lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;__out_ecount_full(_N) &lt;/SPAN&gt;&lt;/FONT&gt;a writable buffer of _N elements. It then does the math and notices that the *sizeof(wchar_t) on line 9 is wrong and reports the problem. It found a buffer overrun for you. &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Returning to our original example, there is no way the compiler can tell us whether this function has an overrun because it doesn’t know about the relationship between out and size&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;void GetIntegratedCutleryEx(char *out, size_t size)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy_s(out, size, “spork”);&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;However, we can teach it about this relationship:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;void GetIntegratedCutleryEx(__out_ecount_z(size) char *out, __in size_t size)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy_s(out, size, “spork”);&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;And then when a user writes a bad piece of code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;void DeluxeExtendedCutleryEnumerationProviderManager(void)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char b[3];&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetIntegratedCutleryEx(b, _countof(b)+1);&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;You get a nice error&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="TEXT-INDENT: 0.5in"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;f:\an.cpp(23) : warning C6386: buffer overrun: accessing 'argument 1', the writable size is '3' bytes, but '4' bytes may be written: Lines: 21, 23&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;You can see how the deprecation warnings we add in the libraries (that encourage you to convert from strcpy to strcpy_s), and the annotations we added in the headers (which ensure you pass our functions the correct size) can be augmented by the annotations you write in your own code to further reduce the chance you’ll write errors (especially buffer overrun errors) in your code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;More next time. Looking forward to hearing from you.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Martyn&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=479332" width="1" height="1"&gt;</content><author><name>martynl</name><uri>http://blogs.msdn.com/martynl/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Security improvements in VC++ 2005 and the C standards committee</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/martynl/archive/2005/10/06/478041.aspx" /><id>http://blogs.msdn.com/b/martynl/archive/2005/10/06/478041.aspx</id><published>2005-10-07T02:58:00Z</published><updated>2005-10-07T02:58:00Z</updated><content type="html">&lt;P&gt;
&lt;DIV class=Section1&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Last Friday I returned from the &lt;A href="http://www.open-std.org/jtc1/sc22/wg14/"&gt;C standards committee&lt;/A&gt; meeting in &lt;A href="http://www.tremblant.ca/index-e.htm"&gt;Mont Tremblant&lt;/A&gt;, &lt;?xml:namespace prefix = st1 /&gt;&lt;st1:place w:st="on"&gt;&lt;st1:country-region w:st="on"&gt;Canada&lt;/st1:country-region&gt;&lt;/st1:place&gt; at a &lt;A href="http://www.clubtremblant.com/en/index.asp"&gt;beautiful hotel resort&lt;/A&gt;. These meetings are pretty fascinating, because of the diverse set of smart people they draw in. Even though C is quite stable at this point, there are always a range of interesting feature proposals and defect reports discussed. &lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I’ve been representing Visual C++ on this committee for a couple of years now, as part of my work on the &lt;A href="http://msdn2.microsoft.com/en-us/library/8ef0s5kh"&gt;Safe C and C++ Libraries&lt;/A&gt; [which you’ll hear more about]. My team started this work late in 2002, and I first took this to the committee back in &lt;A href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1007.pdf"&gt;April of 2003&lt;/A&gt;. There was very positive feedback, and over the last two years we’ve worked with the committee on a technical report which is now coming &lt;A href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1135.pdf"&gt;close to completion&lt;/A&gt;. The great thing about working with the committee on this project has been the opportunity to take some work we had done, get a lot of constructive and helpful feedback from a group of very knowledgeable people, and build up a standard which will help the whole C and C++ community migrate their existing code to work more safely. It’s been very fun, and a great learning experience.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You can find our implementation of these C functions, along with many others (C++, MFC, ATL), plus other safely improvements in Visual C++ 2005. We’ve tried to think what we could do to make your program safer, and that’s led to a bunch of features beyond the actual functions in question. I’ll talk about a few of these over the next few days.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;One of my favourite features is our ability to &lt;A href="http://msdn2.microsoft.com/en-us/library/ms175759"&gt;automagically transform some less safe calls into more safe ones&lt;/A&gt;. For example, imagine that you have this code&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;void foo(char *str)&lt;BR&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char buf[20];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy(buf, str);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;At this point, I hope that everyone reading already knows that this is an unsafe function. Function foo makes no attempt to ensure that str doesn’t overrun its buffer. VC8 is smart, and knows that strcpy isn’t safe, so it issues a warning when you compile this code, telling you that strcpy is unsafe and that you should use our new strcpy_s function instead. And you could do that. A basic fix for this function would be:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;void foo(char *str)&lt;BR&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char buf[20];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy_s(buf, _countof(buf), str);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This fix isn’t very tolerant (since the new code still assumes that buf is large enough – the program’s invalid_parameter_handler will abort inside strcpy_s if not). A deep question when making this kind of code safer is whether you need a string to be truncated or to be &amp;nbsp;But it’s completely safe – this code will no longer buffer overrun.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;But if you’re compiling C++, you can do something much simpler. You can simply put /D&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN class=MsoHyperlink&gt;&lt;U&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;TT&gt;&lt;FONT face="Lucida Console" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TT&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; on the compiler command line, and the original code will compile without a warning. We’ve used The Magic of Templates to transform the code into the safe code automatically. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;These templates are not over-zealous. They only do what they know to be safe. For example, if you give us a function like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;void bar(char *dest, char *src)&lt;BR&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy(dest, src);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;you'll still get the same warning you got above before you added the /D switch. The templates notice that dest is a pointer (not an array) whose size is unknown. So they allow the normal compiler warning to happen, instead of interposing themselves.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Clearly, the safest way to fix code like this is to switch to the use of a decent string class (I own at least two of these – std::string and CStringT). But much code won’t be able to be rewritten this deeply any time soon. So features like this one are intended to help those of you with large, existing code-bases to move your code forward to be safer, in much the same way that we at Microsoft have had to do over the last 6 years. We’ve taken all that we’ve learnt from our security pushes and secure development practices, and applied it to our library changes. We hope you find them helpful. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Write to me and let me know.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Martyn&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;[Edit 10/14/2005&amp;nbsp;MartynL: fix link to C starndard committee doc].&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=478041" width="1" height="1"&gt;</content><author><name>martynl</name><uri>http://blogs.msdn.com/martynl/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>I'm back</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/martynl/archive/2005/10/05/477426.aspx" /><id>http://blogs.msdn.com/b/martynl/archive/2005/10/05/477426.aspx</id><published>2005-10-05T20:56:06Z</published><updated>2005-10-05T20:56:06Z</updated><content type="html">&lt;P&gt;

&lt;div class=Section1&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;Hello.
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;Welcome
to my second generation, re-engineered, upgraded weblog. I'm really excited to
finally have enough time to return to this medium. My old &lt;a
href="http://blogs.gotdotnet.com/martynl"&gt;blog&lt;/a&gt; lasted about a month, before
I got busy and backlogged. I did keep collecting blog topics in the intervening
two years, so I now have enough to talk about to last me till next year. I&amp;#8217;ll
try to keep this one going longer. Fingers crossed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;As
you can tell from the heading, my name is Martyn Lovell. I'm a development lead
in the &lt;a href="http://msdn.microsoft.com/visualc/"&gt;Visual C++ &lt;/a&gt;group. I
currently own the &lt;a
href="http://msdn.microsoft.com/library/en-us/vclib/html/_vclibraries_home.asp"&gt;VC++
Libraries &lt;/a&gt;team, which is responsible for the &lt;a
href="http://msdn.microsoft.com/library/en-us/vclib/html/vcrefruntimelibraryreference.asp"&gt;C
Runtime Library&lt;/a&gt;&amp;nbsp;(CRT), &lt;a
href="http://msdn.microsoft.com/library/en-us/vcstdlib/html/vcoriStandardCLibraryReference.asp"&gt;Standard
C++ Library &lt;/a&gt;(SCL), &lt;a
href="http://msdn.microsoft.com/library/en-us/vclib/html/_mfc_class_library_reference_introduction.asp"&gt;Microsoft
Foundation Classes &lt;/a&gt;(MFC), &lt;a
href="http://msdn.microsoft.com/library/en-us/vclib/html/vcrefatlreference.asp"&gt;Active
Template Library &lt;/a&gt;(ATL). My team also own a bunch of new library code to
help work with managed code -- I'll take some time to talk about this here in
the future. As well as my work in libraries, I'm one of the leaders in Visual
C++&amp;#8217;s effort to allow seamless intermingling of managed and native code.
Of course, like everyone else, I work on a few other problems too... &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;I've
been at Microsoft for almost 10 years, all of it spent in the developer
division. I started out working on the Developer Studio IDE, and then was one
of the people who worked to&amp;nbsp;&lt;a href="http://www.vsipdev.com/"&gt;architect a
next generation IDE that could be an extensible&amp;nbsp;platform
for&amp;nbsp;developer tools&amp;nbsp;&lt;/a&gt;-- which became our current IDE. Next I was
on &lt;a
href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vstool2/html/veconwhatisvisualstudioanalyzer.asp"&gt;Visual
Studio Analyzer&lt;/a&gt;, a tool for understanding and visualising COM-based
applications. For several years, I also owned the &lt;a
href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsscc/html/veovrsourcecodecontrolreference.asp"&gt;source
control integration &lt;/a&gt;code in several IDEs, and was part of a project that
was a precursor of the Visual Studio Team System. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;The
best thing about the development community now (compared to 10 years ago when I
started at Microsoft) is the number of different ways we get to meet, interact
with, listen to and understand our customers and partners. I&amp;#8217;ve always
enjoyed speaking at conferences and visiting developers for just this reason.
But now we get to do so much more of this. Please keep sending me your
questions, comments and feedback. Customer input had a major impact on the
choices we made for Visual Studio 2005, and we&amp;#8217;re now just starting the
process of defining our next versions. So this is a great time to get in touch
if you have ideas on what should come next for Visual C++.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;Of
course, not &lt;em&gt;&lt;i&gt;&lt;font face=Arial&gt;&lt;span style='font-family:Arial'&gt;all&lt;/span&gt;&lt;/font&gt;&lt;/i&gt;&lt;/em&gt;
of my time is spent at work. Like most blogs on MSDN, I'll mostly focus on
technical issues here. You can find out more (too much) about me on my &lt;a
href="http://www.seanet.com/~martynl"&gt;personal web site&lt;/a&gt;. Some of it is out
of date, in keeping with the best traditions of personal web sites. You can
find everything there -- pictures, links, reviews of concerts I've gone to,
abstruse puzzles&amp;nbsp;and an insanely long list of movies. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;One
of the best things about blogging is the two-way communication it encourages.
Please do feel free to add comments, and to write to me (&lt;a
href="mailto:martynl@microsoft.com"&gt;martynl@microsoft.com&lt;/a&gt;) if you have
questions or comments on anything you find here, anything I work on or have
worked on, or anything else that takes your fancy. I'm not always rapid at
replying to email, but I do try to get there eventually. Of course, if you're
looking for immediate help with a technical problem, you'll normally be best to
start with our newsgroups. We have a very smart and highly motivated set of
MVPs who answer questions very quickly. And if you need to report a bug in
Visual Studio, then the &lt;a href="http://lab.msdn.microsoft.com/productfeedback/"&gt;Product
Feedback Centre&lt;/a&gt; is the ideal place to do that. Bugs reported there rapidly
get to the attention of the team involved, and we have great tracking
mechanisms for these issues.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;A
reminder - everything here is my personal opinion, not that of Microsoft or of
anyone else. These postings are provided &amp;quot;AS IS&amp;quot; with no warranties,
and confer no rights. Consider yourself disclaimed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;Enough
about me. On to the real content. I&amp;#8217;m looking forward to hearing from
you.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;Martyn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=3 face=Arial&gt;&lt;span style='font-size:12.0pt;font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt;
font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=477426" width="1" height="1"&gt;</content><author><name>martynl</name><uri>http://blogs.msdn.com/martynl/ProfileUrlRedirect.ashx</uri></author></entry></feed>