e-communication masthead image
e-communication logo image
Edition for
September 9, 2004
This newsletter contains archived content. No warranty is made as to technical accuracy of content or currency of URLs.

Common-buffer DMA   

In common-buffer DMA, the driver and the device share the same area of memory for data transfer. If your driver uses common-buffer DMA, allocating that common buffer requires only a call to AllocateCommonBuffer. Your driver doesn't need to allocate contiguous memory or translate physical to virtual addresses. In fact, it shouldn't.

It might seem reasonable to allocate a buffer in contiguous memory and then translate the virtual addresses that your driver uses to access the buffer into physical addresses that your device can use. However, a straight virtual-to-physical translation doesn't account for differences in hardware architectures. A PCI bus with 32-bit addressing, for example, can't address physical memory locations above 4GB, so this technique does not work on every platform running Microsoft® Windows®.

Instead, use AllocateCommonBuffer, which provides a simple-and correct-way to get the buffer along with hardware-independent addresses.

What should you do?

  • Call AllocateCommonBuffer to allocate memory and get virtual and logical addresses for common-buffer DMA.
  • Call FreeCommonBuffer to release memory and resources allocated by AllocateCommonBuffer.
  • Do not call MmAllocateContiguousMemory to allocate the buffer and MmGetPhysicalAddress to translate its virtual address to a physical address with which to program your DMA adapter. This approach will not work on all hardware, and your device and driver will not be cross-platform compatible. Serious errors can result.
  • Some device types have device-type specific DMA routines. If these are available for your device, use them.
  • Use Driver Verifier's DMA verification option (available on Windows XP and later releases), along with the debugger's !dma extension, to test your driver's DMA implementation.

For code snippets and additional details, read the Common-buffer DMA driver tip


MVP Highlight: Yet Another Framework?

On the new DDK MVP Expert Zone, Bill McKenzie discusses some of the key features and directions of Windows Driver Foundation, highlighting reasons why it is worth taking the time to evaluate this framework.

From an MVP's viewpoint: Why the New Windows Driver Foundation Is Worth a Fresh Look


News for Kernel-Mode Developers

WDF on WHDC: Up-to-date Papers, Presentations, and Videos
Microsoft considers the Windows Driver Foundation the key strategy for the next generation of Windows drivers. The WHDC Web site features current papers, streaming video of the WDF presentations at WinHEC, and early implementers' experience, plus the invitation to the WDF Beta Program.
Visit WDF on WHDC

Hello, user mode? Plug and Play Calling
You can use Plug and Play notifications for simple one-way communication from a kernel-mode driver to a user-mode application. To do this, call IoReportTargetDeviceChangeAsynchronous with a TARGET_DEVICE_CUSTOM_NOTIFICATION structure that describes the event.
For details with code snippets, read the new driver tip on Plug and Play notifications

More Driver Tips: What Every Driver Writer Needs to Know...

Kits, Tools, and Services

Platform SDK for Windows XP Service Pack 2 Support
The XPSP2 version of the Platform SDK was developed to work either side by side with the Windows Server 2003 SDK or standalone but does not provide build environments for other Windows editions. Use SDK Update to ensure that you have the latest documentation, samples, and SDK build environment (header files, libraries, and tools). SDK Update saves you time and hard disk space by dividing the Platform SDK into component SDKs that you can download separately. Furthermore, you can separately install documentation, samples, the build environment, or any combination of this content.
Download Platform SDK Components from the SDK Update Web site


Device-Class Tips & News

Power Management of USB Host Controllers
The power capabilities for USB host controllers are controlled by the underlying PCI bus driver. The ACPI driver optionally modifies these capabilities before handing them to the host controller drivers. The drivers retain these capabilities for their hardware entities. A new paper provides guidelines for programming these capabilities and demonstrates how incorrect values can cause problems in the power management of the system.
Download the paper: Power Management of USB Host Controllers

Locked Operations on PCI Express
A locked operation is the mechanism used to execute a sequence of transactions atomically on a PCI Express Link. A new paper provides information about locked operations and discusses the impact of using locked operations with PCI Express for Windows.
Download the paper: Locked Operations on PCI Express

For information about how PCI Express is supported on current versions of Windows on Windows Longhorn, see the updated paper: PCI Express and Windows.

DDK Preview for Wireless Provisioning Services (WPS)
WPS extends the wireless client software included with Windows XP and the Internet Authentication Service (IAS) included with Windows Server 2003 to allow for a consistent, automated configuration process when connecting to public wireless hotspots. The WPS APIs allow for pre-provisioning of network information to connect to these networks. To help driver developers who create network components that take advantage of WPS capabilities, Microsoft is providing a DDK preview, including Netprov.h header and related files, plus WPS documentation.
Download the WPS DDK Preview

For background information, see Wireless Provisioning Services Overview from The Cable Guy on MSDN.

More Device Fundamentals - Overview...

Security and Reliability

Top Ten Security Tips Every Developer Must Know
There are many ways to get into trouble when it comes to security. You can trust all code that runs on your network, give any user access to important files, and never bother to check that code on your machine has not changed. You can run without virus protection software, not build security into your own code, and give too many privileges to too many accounts. You can even use a number of built-in functions carelessly enough to allow break-ins, and you can leave server ports open and unmonitored. The list continues to grow. Security experts Michael Howard and Keith Brown present 10 tips to keep you out of hot water.
Top Security Tips on the MSDN Security site

Testing for Errors in Accessing and Allocating Memory
Drivers often have errors related to memory access and allocation. Such errors can lead to memory corruption and, eventually, system crashes. You should test every driver for such errors before releasing it—even a driver that seem to be working properly. Crashes caused by memory errors can occur long after a driver accesses an invalid location. Corrupted memory can cause errors and crashes in processes that are completely unrelated to the offending driver.
Review the tools and techniques that can help you uncover problems that might otherwise go undetected

Security Update for Windows XP SP2
Includes a list of security updates, network protection technologies, patch management guidelines, and more.

Microsoft Security Developer Center on MSDN

More Driver Security and Reliability...


Tips and Directions for Testing

"Designed for Windows" Logo Program Update: New V. 2.2 Requirements
The updated FAQ for the "Designed for Windows" logo program provides information and clarifications about requirements. New requirements are defined for Virtual Disk Service (VDS) hardware provider and Fibre Channel HBA driver support for WMI methods.
Read the Logo Program FAQ

Guidelines for Windows XP MCE Logo Program
The Windows XP Media Center Edition team recently announced guidelines for accepting hardware and driver submissions for the Windows XP MCE logo program.
See the Windows XP MCE logo program announcement

How to Enable Remote Debugging on Windows XP SP2

More Tools for Testing and Tuning: Overview...

Windows Platform Directions

Update on Windows Longhorn

The Windows Code Name "Longhorn" client operating system is scheduled to be released in 2006. Release for the next version of Windows Server, code name "Longhorn Server," is currently slated for 2007. Some features previously slated for Windows Longhorn will also be available for Windows XP and Windows Server 2003 in 2006. Collectively known as Windows WinFX, these developer technologies include the new presentation subsystem, code name "Avalon," and the new communication subsystem, code name "Indigo." The increased availability will provide an opportunity for developers to write applications delivering enhanced Web services and breakthrough user experiences for hundreds of millions of existing PCs.
For details, read the complete press release

What else is new on WHDC?

WHDC Ask The Experts

Driver Hangs: Detection and Prevention
September 15, 2004
17:00-18:00 GMT

Windows Printer Driver Development
September 21, 2004
17:00-18:00 GMT

Details for WHDC Ask the Experts

Resources for Developers

Debugging Tools for Windows - Version 6.3.17.0

Which DDK and HCT to Use?

KB Articles for the DDK

Events and Errors Message Center


To cancel your subscription to this newsletter, reply to this message with the word UNSUBSCRIBE in the Subject line. You can also unsubscribe at http://www.microsoft.com/misc/unsubscribe.htm. You can manage all your Microsoft.com communication preferences at this site.

 Legal Information.

This newsletter was sent by the Microsoft Corporation
1 Microsoft Way
Redmond, Washington, USA
98052

Sign up for other newsletters | Unsubscribe | Update your profile
© 2004 Microsoft Corporation Terms of Use | Privacy Statement
Microsoft