Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chris Jackson The App Compat Guy Microsoft Corporation WCL302.

Similar presentations


Presentation on theme: "Chris Jackson The App Compat Guy Microsoft Corporation WCL302."— Presentation transcript:

1

2 Chris Jackson The App Compat Guy Microsoft Corporation WCL302

3 Microsoft Confidential

4

5

6

7 Don’t make me chant “App compat… App compat…”

8 Microsoft Confidential

9 Few Changes: Most software that runs on Windows Vista will run on Windows 7 - exceptions will be low level code (AV, Firewall, Imaging, etc). Hardware that runs Windows Vista well will run Windows 7 well. Few Changes: Focus on quality and reliability improvements Windows 7 Builds on Windows Vista Deep Changes: New models for security, drivers, deployment, and networking

10 Windows 7 Goals Applications that worked on Windows Vista and Windows Server 2008 continue to work on Windows 7 / Windows Server 2008 R2 Broad ISV outreach for critical applications

11 Strategies Scale our compatibility efforts Automation (AAF), Telemetry Prevent using education, tools, engagement Internal resources for compatibility & impact Detect compatibility issues upstream Quality Gates for application / public API removal Mitigate compatibility issues Shim infrastructure, switchback, telemetry Partner and engage with ISVs Tools, services and labs

12 The Net Result There is no new “special sauce” that makes all software magically start working on Windows 7 if it didn’t work on Windows Vista The security bets we made in Windows Vista were good ones, and we’re not taking them back There are incremental targeted fixes – new shims have been created for some applications If you work on Windows Vista, you probably work on Windows 7, unless…

13 Application Compatibility Issues New Issues Since Windows Vista

14 Operating System Version Windows 7 is … Windows 6.1? dwMajorVersion stays the same dwMinorVersion changes Remediation Check for features, not versions Use the > key Version lies

15 Why Version 6.1? Some applications only check dwMajorVersion Some applications tried to do the right thing, but implemented it incorrectly if (majorVersion > 5 && minorVersion > 1) OSVersionMajor > 5Minor > 1ResultDesired? Windows 2000 5.0TFFYes Windows XP5.1TTTYes Windows Vista 6.0TFFNO Windows 76.1TTTYes

16 xxxVersionLie Symptoms “Unsupported operating system” Fix description Lies

17 Version Lie Shims Win95VersionLie WinNT4SP5VersionLie Win98VersionLie Win2000VersionLie Win2000SP1VersionLie Win2000SP2VersionLie Win2000SP3VersionLie WinXPVersionLie WinXPSP1VersionLie WinXPSP2VersionLie Win2K3RTMVersionLie Win2K3SP1VersionLie VistaRTMVersionLie VistaSP1VersionLie VistaSP2VersionLie

18 Version Lie Layers Win95 NT4SP5 Win98 Win2000 Win2000SP2 Win2000SP3 WinXP WinXPSP1 WinXPSP2 WinXPSP2VersionLie WinSrv03 WinSrv03SP1 VistaRTM VistaSP1 VistaSP2

19 Compatibility Tab

20 Shims and Layers WindowsWindows ShimShim ApplicationApplication Child Application LayerLayer

21 Layers: More Than Version Lies VistaRTM Layer: DelayAppDllMain ElevateCreateProcess FailObsoleteShellAPIs FaultTolerantHeap GlobalMemoryStatus2GB HandleBadPtr NoGhost RedirectMP3Codec VirtualRegistry VistaRTMVersionLie WRPDllRegister WRPMitigation

22 IE Version Without compatibility mode: Mozilla/4.0 (compatible; MSIE 8.0 ; Windows NT 6.1; WOW64; Trident/4.0; SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729; Media Center PC 6.0) With compatibility mode: Mozilla/4.0 (compatible; MSIE 7.0 ; Windows NT 6.1; WOW64; Trident/4.0; SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729; Media Center PC 6.0)

23 Detecting IE More Effectively http://msdn.microsoft.com/en-us/ library/ms537509.aspx Detect Features Define compatibility modes

24 Specifying Compatibility Mode My Web Page Content goes here.

25 IIS Compatibility Mode

26 Detecting Compat Mode engine = null; if (window.navigator.appName == "Microsoft Internet Explorer") { // This is an IE browser. What mode is the engine in? if (document.documentMode) // IE8 engine = document.documentMode; else // IE 5-7 { engine = 5; // Assume quirks mode unless proven otherwise if (document.compatMode) { if (document.compatMode == "CSS1Compat") engine = 7; // standards mode } // the engine variable now contains the document compatibility mode. }

27 Windows Mail Deprecated Replaced with Windows Live Mail – or the mail client of your choice winmail.exe no longer on the system Publicly documented APIs work APIs that display UI break (silently fail) Protocol handlers and file extensions not registered Remediation Remove calls to deprecated APIs Detect if a mail handler is installed Install a mail application

28 CoStartOutlookExpress msoert2.dll Section.text (0x43D01000) CALL DWORD PTR [KERNEL32.DLL!GetModuleFileNameW] TEST EAX,EAX JZ 0x43D0A613 LEA EAX,[EBP-0x20C] PUSH EAX CALL DWORD PTR [SHLWAPI.DLL!PathFindFileNameW] TEST EAX,EAX JZ 0x43D0A60C PUSH 'WinMail.exe' PUSH EAX CALL DWORD PTR [MSVCRT.DLL!_wcsicmp]

29 How to Write Apps that Break Ignore published APIs Reverse engineer Windows Write code depending on what you reversed, assuming that we’ll never change Windows Wait for us to change Windows

30 Windows Movie Maker Deprecated MovieMaker binaries and shortcuts removed Attempts to launch the application fail Plug-ins will remain installed, but will not be exposed to the user

31 NLS Sorting Changes New versions of Windows almost invariably incorporate changes Major version changes: re-indexing required Minor version changes: existing indexes OK, new strings can now be sorted Operating SystemNLS Version Windows XP(No GetNLSVersion API) Windows Server 20030x00 0000 01 Windows Vista0x00 0405 00 Windows Server 20080x00 0501 00 Windows 70x00 0600 00

32 NLS Sorting Changes Our most common question from English-only audiences: “What are you talking about?” Examples: The ligature æ typically equates to ae, but Icelandic sorts it after z The A Ring Å typically sorts as diacritic difference from A, but Swedish sorts it after Z CompareStringEx attempts to capture these locale-specific differences Code points are added, and changes/fixes made

33 NLS Sorting Changes If you do not check GetNLSVersion / GetNLSVersionEx (Vista+) and re-index on change: May fail to sort correctly May fail to provide requested results Sort Change Robustness Diagnostic Tool can help you diagnose

34 Removal of Registry Reflection For x64 versions of Windows, we added Registry Reflection HKLM\Software\Classes HKLM\Software\Microsoft\COM3 HKLM\Software\Microsoft\EventSystem HKLM\Software\Microsoft\Ole HKLM\Software\Microsoft\Rpc HKEY_USERS\*\Software\Classes HKEY_USERS\*_Classes

35 Removal of Registry Reflection KEY_WOW64_64KEYKEY_WOW64_64KEYKEY_WOW64_32KEYKEY_WOW64_32KEY ValueValueValueValue Value from 64 Value from 32 Value from 64 Value from 32

36 Removal of Registry Reflection Only known consumer: COM COM was updated to not assume this Motivation: feature caused inconsistencies in the state of the registry Mitigations: Use non-redirected registry keys Explicitly use KEY_WOW64_64KEY Read information from a known correct location

37 Windows Portable Devices wpdusb.sys replaced by winusb.sys Consumers of WPD API are fine Consumers of (private) IOCTL codes will break Remediation Rewrite to leverage WPD APIs

38 New Low-Level Binaries To improve the foundations of Windows, we have reorganized Example: functionality from kernel32.dll and advapi32.dll moved to kernelbase.dll Exported functions are forwarded Applications depending on offsets and undocumented APIs can break Remediation: Rewrite to use documented APIs See Mark Russinovich’s Kernel Changes

39 IE DEP Enabled by Default Data Execution Prevention (NX) now enabled by default Vista – you had to elevate IE to enable Plug-ins that have an issue with DEP may cause the browser to crash Remediation: Use DEP-compatible versions of frameworks (such as ATL) http://support.microsoft.com/kb/948468 Use the /NXCOMPAT linker option

40 File Libraries Default location of common file dialogs: Documents Library File libraries are files (not folders) IFileDialog->GetFolder() + IFileDialog->GetFilename() breaks for library GetFolder() returns a file Remediation Use IFileDialog->GetResult()

41 How We Help You Express Your Intentions More Clearly Talk to us.

42 Switchback Compatibility section in the manifest: communicate which OS you are designing for We can make breaking changes to components as long as we keep the old one available for apps designed for a previous OS! Windows Vista compatibility is the default Operating System Context is a property of a process

43 Switchback Switchpoints Component / APIWindows VistaWindows 7 RPC Default Thread PoolDefault thread poolPrivate thread pool DirectDraw LockCan acquire lock on primary video buffer Unable to lock the primary video buffer (which disables DWM) DirectDraw Bit Block TransferCan blt to the primary video buffer without a clipping window Must blt to a clipping window GetOverlappedResultProvides behavior with a race condition Resolves a race condition where the API can return without resetting the event in the overlapped structure Program Compatibility Assistant PCA is enabled – monitoring and mitigating failures PCA is disabled

44 Switchback Manifest

45 Switchback Supported OSs Which operating systems do you choose? All supported operating systems Nobody knows the Windows 8 GUID (yet) Not even Windows 7 To get Windows 7 switch points in a Windows 8 application, your manifest must include Windows 7 AND Windows 8 Try not to rely on the Windows Vista default – if that’s the mode you want, ask for it explicitly (default may change in the future)

46 What We Made Look a Little Nicer Enjoy.

47 ChooseFont() Dialog

48 User Account Control

49 Tools and Tips Helpful?

50 ACT 5.5 Full module on using the Application Compatibility Toolkit New for 5.5: DCP Tagging Application Verifier 4.0 compatibility Additional compatibility fix documentation Windows 7 deprecation checks Report filtering

51 Problem Step Recorder %windir%\system32\psr.exe Allows testers and users to track, step by step, exactly what an application is doing, creating an MHT file with screenshots illustrating the bug repro Creates a zip file containing an mht Integrated with Watson

52 Windows Troubleshooting Built-in troubleshooting for common problems accessible from the Action Center Extensible %sdkdir%\bin\tspbuilder\builder.exe Implement using PowerShell scripts http://www.withinwindows.com/2009/01/12/crash -course-on-authoring-windows-7-troubleshooting- packs/

53 http://www.appcompatguy.com chris.jackson@microsoft.com

54 www.microsoft.com/teched Sessions On-Demand & Community http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers www.microsoft.com/learning Microsoft Certification and Training Resources www.microsoft.com/learning Microsoft Certification & Training Resources Resources

55 Related Content Breakout Sessions (session codes and titles) WCL302 – Are You Breaking my Stuff Again? The Windows 7 App Compat Story WCL304 – Fix Your Broken Applications: The Black Art of Shims WCL401 – Not for the Faint of Heart: Hard Core App Compat Debugging

56 Track Resources →Want to find out which Windows Client sessions are best suited to help you in your deployment lifecycle? →Want to talk face-to-face with folks from the Windows Product Team? Meet us today at the Springboard Series Lounge, or visit us at www.microsoft.com/springboard www.microsoft.com/springboard Springboard Series The Springboard Series empowers you to select the right resources, at the right technical level, at the right point in your Windows® Client adoption and management process. Come see why Springboard Series is your destination for Windows 7.

57 Complete an evaluation on CommNet and enter to win! Required Slide

58 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Chris Jackson The App Compat Guy Microsoft Corporation WCL302."

Similar presentations


Ads by Google