Microsoft KB Archive/832920

= Sprintf functions that are exported by the Ntdll.lib import library file do not work as you expect in Windows Server 2003 or in Windows XP =

PSS ID Number: 832920

Article Last Modified on 2/25/2004

-

The information in this article applies to:


 * Microsoft Windows Server 2003, Enterprise Edition
 * Microsoft Windows Server 2003, Standard Edition
 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional

-





SYMPTOMS
When you link the Ntdll.lib import library file before you link the Msvcrt.lib import library file in your application, the sprintf functions do not work as you expect. If you run this same application in Microsoft Windows 2000 and in earlier versions of Windows, the sprintf functions in your application work as you expect.



CAUSE
This issue occurs because the sprintf functions that are in your code are linked to the sprintf function that is exported by the Ntdll.lib import library file. In Microsoft Windows Server 2003 and in Microsoft Windows XP, the behavior of the sprintf function in the Ntdll.lib import library file is different from earlier versions of Windows.

This issue does not occur in operating systems that are earlier than Windows Server 2003 and Windows XP because in earlier versions of Windows, the implementations of the sprintf function in the Ntdll.lib import library file and in the Msvcrt.lib import library file behave the same way. In Windows Server 2003 and in Windows XP, the implementation of the sprintf function is different for the Ntdll.lib import library file and for the Msvcrt.lib import library file. The sprintf function in the Ntdll.lib import library file does not work correctly with the %n parameter in the format string, and the sprintf function in the Ntdll.lib import library file does not recognize \n as the new line command.



STATUS
This behavior is by design.

Keywords: kbDriver kbDev kbDDK kbprb KB832920

Technology: kbWinServ2003Ent kbWinServ2003EntSearch kbWinServ2003Search kbWinServ2003St kbWinXPHome kbWinXPHomeSearch kbWinXPPro kbWinXPProSearch kbWinXPSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.