Writing WIA drivers for Windows 64-Bit Edition for Extended Processors - 2

Writing WIA drivers for Windows 64-Bit Edition for Extended Processors

WinHEC 2004 Version - April 5, 2006 - ARCHIVE

Abstract

This paper provides information about writing WIA drivers for the Microsoft® Windows® for 64-bit extended processors family of operating systems. It provides guidelines for scanner and digital camera vendors to make sure their devices work with PCs based on the x64 hardware architecture.

This information applies for the following operating systems:
Windows XP 64-Bit Edition for Extended Processors
Windows Server for 64-bit extended processors

(Standard, Enterprise, and Datacenter Editions)
Windows Vista™

For up-to-date information, see “64-bit and WIA” in the Windows Driver Kit documentation at http://msdn2.microsoft.com/en-us/library/aa488942.aspx.

The current version of this paper is maintained on the Web at:

http://www.microsoft.com/whdc/archive/WIA-64bit.mspx

Contents

Introduction 3

64-bit WIA Driver Components 3

32-bit Application / 64-bit WIA Minidriver Interoperability 3

References 3

Disclaimer

This is a preliminary document and may be changed substantially prior to final commercial release of the software described herein.

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. 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 presented after the date of publication.

This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.

Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place or event is intended or should be inferred.

© 2004 Microsoft Corporation. All rights reserved.

Microsoft, Win32, Windows, Windows Server, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.


Introduction

This paper provides information about writing WIA drivers for the Microsoft® Windows® 64-Bit Edition for Extended Processors family of operating systems. It specifically explains how interoperability issues with 32-bit applications trying to access 64-bit WIA minidriver UI extensions are resolved.

64-bit WIA Driver Components

A WIA driver for Windows 64-Bit Edition for Extended Processors can only contain 64-bit driver components, i.e. 64-bit minidriver, 64-bit WIA minidriver UI extensions, and potentially a 64-bit kernel-mode driver.

32-bit Application / 64-bit WIA Minidriver Interoperability

Since on Windows for 64-bit extended processors all WIA components are 64-bit, what about interoperability with 32-bit applications? The WIA minidriver itself poses no problem as it is always loaded in the WIA service’s own process which is a 64-bit process on 64-bit Windows.

WIA minidriver UI extensions however get loaded in the application's process space. A Microsoft Win32® application’s unmodified 32-bit process running on an x64 machine wouldhence expect to load the 64-bit UI extension. Without any changes to the WIA infrastructure or the application this would fail.

To mitigate this problem Microsoft provides a 64-bit extension host that ensures transparent interoperability between 32-bit apps and 64-bit WIA UI extensions. This extension host, called wiawow64.exe, will be available on all PCs based on the x64 platform and running Microsoft Windows Server™ 2003 for 64-bit extended processors, Microsoft Windows XP 64-bit Edition for Extended Processors. or Microsoft Windows Vista™.

With the extension host in place it depends on the application type to determine where UI extensions get physically loaded:

·  64-bit application - The 64-bit WIA minidriver UI extension is loaded directly into the process space of the application. This is similar to what happens when you run a 32-bit application on 32-bit Windows.

·  32-bit application - WIA launches the wiawow64.exe “extension host” into which the UI extensions will be loaded. A separate instance of wiawow64.exe is created and launched each time a call to any of the interface methods comes in from a 32-bit application. Wiawow64.exe runs in the same context as the application and communication with the application happens through the existing COM interfaces. Wiawow64.exe is completely transparent to both WIA application writers and WIA driver developers. The single difference is that one has to debug the wiawow64.exe process rather than the 32-bit application to debug 64-bit UI extensions.

References

Call to Action

For device manufacturers: Make sure you build 64-bit WIA drivers for your devices. It is the only way to make your devices operate with PCs built on the x64 platform.

Resources

Microsoft Hardware and Driver Central

Includes WindowsDriver Development Kits (DDK), WindowsHardware Compatibility Test [HCT] Kits, and Windows Logo Program requirements
http://www.microsoft.com/whdc/default.mspx

© 2004 Microsoft Corporation. All rights reserved.