23

Rona Lustig Senior Consultant Microsoft Consulting Services [email protected]

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Rona LustigRona LustigSenior ConsultantSenior ConsultantMicrosoft Consulting ServicesMicrosoft Consulting [email protected]@microsoft.com

DevelopmentDevelopment

• Tools for the job

• How long is an integer?

• Where am I?

• WoW

• Mix and match

• Migration

• Where to go from here?

Tools for the JobTools for the Job

• Visual Studio 2003– .net framework 1.0, 1.1

• Platform SDK– Cross compile

• Visual Studio 2005– .net framework 2.0

WhidbeyPSDK

How long is an integer?How long is an integer?

• int, long – 32 bit (4 Byte)

• Ptr – 64 bit (8 Byte)

• Polymorphic data types– LRESULT, HANDLE, LPARAM, WPARAM– size_t intptr_t uintptr_t, …

• Don’t assume type sizes or data location– sizeof and FIELD_OFFSET are your friends

AlignmentAlignment

paddingpadding

Win64

Win32

struct node { char *l; char s; struct tnode *prev; int i; struct node *next;}

4 8 12 16 20 24 28 32 36

4 8 12 16 20 24 28 32 36

Win64

4 8 12 16 20 24 28 32 36

20% off

PoGOPoGO

Where am I?Where am I?

• A 32-bit application can detect whether it is running under WOW64 by calling the IsWow64Process function.

• It can obtain additional information about the processor using the GetNativeSystemInfo function.

IsWow64ProcessSystem.environment

WoW!WoW!

• Windows on Windows 64 (WOW64)

• Preventing file and registry collisions

• Support cut and paste and COM

• In-process– 32-bit processes CANNOT load 64-bit DLLs– 64-bit processes CANNOT load 32-bit DLLs

ProcessesThe registryThe file system

Mix and matchMix and match

• In-process– 32-bit processes CANNOT load 64-bit DLLs– 64-bit processes CANNOT load 32-bit DLLs

• Remote debugging– VS is 32bit– Your app may be 64 bit– How does VS interact with your app?

Visual StudioAnd runtime

NoNo NoNo

NoNo NoNo

NoNo NoNo

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Ye

sY

es

Ye

sY

es

PE3PE322

PE3PE322

ILONLILONLYY

ILONLILONLYY

Not Not 32BITREQUIR32BITREQUIR

EDED

Not Not 32BITREQUIR32BITREQUIR

EDED

PE32+ PE32+ launches 64bitlaunches 64bit

PE32+ PE32+ launches 64bitlaunches 64bit

Launches in Launches in WoW64WoW64

Launches in Launches in WoW64WoW64

Remap to PE32+ Remap to PE32+ and launch 64bitand launch 64bitRemap to PE32+ Remap to PE32+ and launch 64bitand launch 64bit

Launches in Launches in WoW64WoW64

Launches in Launches in WoW64WoW64

MigrationMigration

• Need 64bit support for all components?

• Source unavailable?

• Dependency!– A 64bit app cannot invoke a 32bit DLL– Use EXE instead? Port both? …

General Porting GuidelinesGeneral Porting Guidelines

• Testing– All supported environments– Interoperability– Different memory configurations

Treat your 64-bit version

As a separate product release

Installer ApplicationsInstaller Applications

• NO 16 bit installer applications supported– Except for recognized InstallShield and ACME

installers– 16 bit setup bootstraps not supported

• 32-bit installer apps cannot load and register 64-bit DLLs and vice versa– Create a 64-bit process to register 64-bit DLL– Communicate using RPC

• Same process applies to 64-bit installers

Where to go from here?Where to go from here?

http://msdn.microsoft.com/visualc/using/building/64bit/default.aspxhttp://msdn.microsoft.com/visualc/using/building/64bit/default.aspxhttp://msdn.microsoft.com/visualc/using/building/64bit/default.aspxhttp://msdn.microsoft.com/visualc/using/building/64bit/default.aspx

http://www.microsoft.com/windowsxp/64bit/techinfo/developers.asphttp://www.microsoft.com/windowsxp/64bit/techinfo/developers.asphttp://www.microsoft.com/windowsxp/64bit/techinfo/developers.asphttp://www.microsoft.com/windowsxp/64bit/techinfo/developers.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/64bitwindows.asphttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/64bitwindows.asp

© 2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only.

Microsoft makes no warranties, express or implied, in this summary.