Getting Started with the Code in this Book


All the code in this book was written primarily in C, C++ and, to a lesser extent, C# using Microsoft Visual Studio 2005 Team Suite Service Pack 1 and the Windows Software Development Kit (SDK). For C and C++ development Visual Studio was installed first followed by the Windows SDK. Next, we added references to the various Windows SDK headers and libraries to Visual Studio so it would read from the updated directories first. You can do this by performing the following steps:

  1. Open Visual Studio

  2. Select Tools | Options

  3. Navigate to and expand Projects and Solutions

  4. Select VC++ Directories

  5. Click the New Line icon

  6. Add the directory to the Windows SDK include files

Repeat the steps above for the executable and library files. The following figure shows the dia-log in question. You can also simply accept the option to update your environment when you install the SDK – remember to restart the development environment.

image from book

Finally, you should add the following line before you include any header files in your application. A good place is the first line in stdafx.h.

  #define _WIN32_WINNT 0x0600

If you don’t add this line to your code, your code will probably fail to compile if it references functions, definitions, constants or structures new to Windows Vista.

Important  

Note that all the sample C and C++ code makes full use of SAL (described in chapter 1) where appropriate and compiles with no warnings at warning level 4 (/W4) and has no PREfast warnings (/analyze.) The only exception is where we show examples of insecure practices.

For C# development there is no need to change anything to the development environment so long as you are running on a Windows Vista computer.



Writing Secure Code for Windows Vista
Writing Secure Code for Windows Vista (Best Practices (Microsoft))
ISBN: 0735623937
EAN: 2147483647
Year: 2004
Pages: 122

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net