Top Banner
23
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.
Page 2: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 3: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@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?

Page 4: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 5: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

WhidbeyPSDK

Page 6: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 7: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 8: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

PoGOPoGO

Page 9: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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.

Page 10: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

IsWow64ProcessSystem.environment

Page 11: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 12: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

ProcessesThe registryThe file system

Page 13: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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?

Page 14: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

Visual StudioAnd runtime

Page 15: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 16: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

MigrationMigration

• Need 64bit support for all components?

• Source unavailable?

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

Page 17: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

General Porting GuidelinesGeneral Porting Guidelines

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

Treat your 64-bit version

As a separate product release

Page 18: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 19: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 20: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 21: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 22: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

Page 23: Rona Lustig Senior Consultant Microsoft Consulting Services Ronalus@microsoft.com.

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

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