<<

Getting Ready for ®

Kev Gee ® Game Technology Group

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Windows Vista Highlights

• Desktop uses 9 – Model 2.0 • New display and audio driver models • (aka LUA/UAP)

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Windows Vista for Gamers

•Direct3D 10 • Game Explorer • Parental Controls

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Developing for Windows Vista • Ideally develop using Visual Studio 2005 – Compile should include the following flags • /W4 for Warning Level 4 • /Wp64 for 64 bit compilation warnings • /GS for stack checking for buffer overrun elimination • /SafeSEH for Safe Structured Exception Handling (when relevant)

– VS 2003 requires BufferOverflowU.lib to link with Vista libs

• Use StringCchPrintf, etc rather than unsafe routines – strcpy(), sprintf(), strcat(), strncpy() are unsecure – Use strsafe.h

• Use the latest available Beta OS and SDK versions – (DirectX / Windows Platform SDK)

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Feature Agenda • Game Explorer • Account Privilege and Parental Controls • Application Compatibility • Installation & Patching • Windows Best Practices

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Games Explorer • Linked directly off the • Displays games installed on the system • Displays meta-data such as developer, publisher, various ratings, links, etc. • Parental controls system can lock out some games based on rating if enabled • Basic information including rating is already provided for many legacy titles (~2000)

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Games Definition File • A title provides meta-data through a piece of XML called a Game Definition File (GDF) • The GDF is embedded as a resource into a binary (exe or dll) – Thumbnail image must be also embedded in the same binary • Game Definition File Editor tool in the DirectX SDK

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Aside: Code signing • GDF containing binary must have a valid Authenticode signing to provide a rating • Great security measure to ensure bits you ship are the bits a user has on their machine – Works on exe, dll, msi/msp, cab files – Windows XP presents this data in many places – Windows Vista relies on this even more • Verisign ID required to access WinQual data • See DirectX Documentation topic Authenticode Signing for Game Developers

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Game Explorer Integration

•Use IGameExplorer COM object to register the GDF- containing binary during install/ • Use the COM object to double-check ratings access in your game’s startup (VerifyAccess) • GE can show saved games with thumbnails – Prepending a structure at the beginning of your save game files – Support command-line launch with a save game file – Depends on the existing extension/ launch system – Use a unique extension for your save game files! • See the DirectX Documentation topic “Windows Game Explorer Integration” and GE documentation

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Feature Agenda • Game Explorer • Account Privilege and Standard Users • Application Compatibility • Installation & Patching • Windows Best Practices

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Account Privilege • User Account Control (UAC) – Key security feature in Windows Vista • “Standard User” – New name for Restricted User (LUA) on Windows XP – Does not have full access to the system • Read only to most of the hard drive and registry • Can only write to per-user and specific common areas • Cannot install drivers, start/stop services, change settings – Changes in the OS make heavy use of this • Every account on the system runs most processes as “Standard User”!

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Account Privilege Elevation • “Administrator” – A user with administrator privileges can elevate a process to run at ‘admin’ level • Must happen when the process is created! • The system prompts every you launch the app • Child processes do inherit the elevation – UAC may detects common exe names that require admin rights (SETUP.EXE, etc.) – Don’t Rely on this feature, be explicit with your apps. • Executables can be marked in a manifest to require ‘admin’ privileges • User can also explicitly use “Run As…”

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Supporting UAC • Follow all the guidance for Limited User Accounts on Windows XP! • Parental Controls only enforced on “Standard User” accounts – i.e. a controlled account cannot have any admin rights – If your game requires admin privileges to run, it cannot be played by accounts with Parental Controls active • See the article Gaming with Least-Privileged User Accounts in the DirectX SDK

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Files and Standard Users •The SHGetFolderPath() API returns the correct locations for classes of file access tag">C:\Documents and Settings \username CSIDL_LOCAL_APPDATA \Local Settings\ApplicationData • Works on XP, including 64 bit

versions C:\Documents and Settings\All Users\ CSIDL_COMMON_ APPDATA – Vista also provides an Application Data SHGetFolderPathEX() version C:\Documents and Settings\username CSIDL_PERSONAL \

C:\Documents and Settings\All Users CSIDL_COMMON_ DOCUMENTS \Documents

• Do NOT make assumptions CSIDL_PROGRAM_FILES C:\ about these paths. CSIDL_PROGRAM_FILES_COMMO C:\Program Files\Common • For example, on 64-bit Windows N the program files is – “C:\Program Files (x86)” for 32-bit programs – “C:\Program Files” for 64-bit programs and might not be on the C drive!

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Standard User Registry Access • Your installer can write information to HKEY_LOCAL_MACHINE – But your title cannot modify those entries – (since it requires Admin privilege to install)

• Registry will map HKEY_CURRENT_USER to a different hive depending on the active account

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. • Windows Firewall is on by default to protect users

• Standard Users require elevation to add apps to the Firewall exception list • When you need to, add an entry to the Firewall exception list. • Best to register during game install. – Note: Only requires configuration for a or peer-to-peer scenario, works as-is for pure clients

See the “Games and Firewalls” article in the DX SDK updates for more details

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Agenda • Game Explorer • Account Privilege • Application Compatibility • Installation & Patching • Windows Best Practices

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Application Compatibility • Windows Vista is compatible with most existing Windows applications • Common compatibility concerns for games – x64 Edition – Media Center Edition –Multicore – Legacy • Current and upcoming technical articles in the DirectX SDK address these in detail

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Improving Application Compatibility

• Use the Application Verifier tool – http://msdn.microsoft.com/compatibility – Integrated version in VS 2005 Team System • Make sure any drivers you install have both 32-bit and 64-bit versions • Investigate deprecation warnings from VS2005 • Be sure to revisit your game timing code! – See the DirectX SDK topic Game Timing and Multicore Processors

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. App Compat Testing

• Include testing on Windows XP Pro x64 Edition, Windows XP MCE, Windows Vista consumer SKUs (Home Basic, Home Premium, Ultimate) • Test using single and multicore CPUs • Be sure to try 4 GB RAM configurations – Has exposed 32-bit overflows in configuration code • Do not force your game to run with or require ‘admin’ privileges enabled! – Test on Windows XP under a Limited User Account – Test on Windows Vista with UAC active

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Agenda • Game Explorer • Account Privilege and Standard Users • Application Compatibility • Installation & Patching • Windows Best Practices

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Installation • Traditional installers are way too complicated! – Simplify the setup Q & A – Create an Express install option that bypasses most prompting – Consider play from media, background copy, or install on demand approaches – See the installation articles in the DirectX SDK

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. DirectX Setup • The DirectX runtime install is usually not optional! – DirectSetup needs to install components like D3DX, XINPUT, XACT, etc. not part of “DirectX 9.0c” – Combine the DirectX EULA into your own, always run Direct Setup in silent mode – Don’t prompt user about installing DirectX or try to guard it with a version check!

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Aside: Direct Setup size • Don’t assume you have to ship every cab in the REDIST folder for your game – You can save a lot of space on media and in your self-extracting download packages –See Installing DirectX with Direct Setup in the DirectX SDK for details

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Installation Issues • Watch out for 16-bit code in older installers – Will fail to run on x64 Editions

• Drivers have to be code signed by default to install on Windows Vista – Check with your supplier

• Uninstall will likely need to walk per-user registry and directories to fully clean up – Use the SHFileOperation(), SHDeleteKey() shell functions for this

• Badly written OS version checks are common! – Don’t do them – If you must do them, do them right and test thoroughly!

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Patching • Need to plan how patching will work under “Standard User” scenarios – MSP technology – Can specify that you require elevation to patch (this works well, if you patch rarely!) – Use of per-user and common data areas – See article in the DirectX SDK for details

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Agenda • Game Explorer • Account Privilege and Standard Users • Application Compatibility • Installation & Patching • Windows Best Practices

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Windows Best Practices • Task Switching – Many developers are handling this well – Fast User Switching exists in Windows Vista! – See the DirectX Documentation topic “Games for Logo for Applications” for scenarios to test • Preventing Accidental Task Switch – If the or the accessibility features conflict with your game’s , see the DirectX Documentation topic •“Disabling Shortcut Keys in Games”

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Windows Best Practices (ctd.) • – Rethrow or call ReportFault API in any custom UEH – Avoid using catch(…) in your code – Make sure all your binaries (exe, dll) have a VERSIONINFO resource with real information! – See the DirectX Documentation topic Dump Analysis

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Call to Action! • Read the DirectX SDK articles. • Make sure your dev and test teams understand “Standard Accounts” and “User Account Control” • Test your games on Windows Vista Beta 2 – Those in production and your Back catalogue • Support the “Game Explorer”, “Standard User” and “Windows Firewall” features of the OS

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Questions?

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Additional Information DirectX Developer Center http://msdn.com/directx XNA Developer Center http://msdn.com/xna Discussion Forums (DirectX & XNA) http://msdn.com/directx/forums Microsoft Gaming http://www.microsoft.com/games

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. © 2006 Microsoft Corporation. All rights reserved. Microsoft, DirectX, 360, the Xbox logo, and XNA are either registered trademarks or trademarks of Microsoft Corporation in the United Sates and / or other countries. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.