Microsoft KB Archive/920754

= Error message when you call the WTSQueryUserToken API function in a 32-bit application or a Windows Service that is running on an x64-based Windows system: &quot;ERROR_INSUFFICIENT_BUFFER&quot; =

Article ID: 920754

Article Last Modified on 10/11/2007

-

APPLIES TO


 * Microsoft Windows Server 2003 R2 Enterprise x64 Edition
 * Microsoft Windows Server 2003 R2 Standard x64 Edition
 * Microsoft Windows Server 2003, Enterprise x64 Edition
 * Microsoft Windows Server 2003, Standard x64 Edition
 * Microsoft Windows XP Professional x64 Edition
 * Microsoft Win32 Application Programming Interface

-



SYMPTOMS
Consider the following scenario. A 32-bit application or a Microsoft Windows Service is running on an x64-based Windows system. The 32-bit application or the Microsoft Windows Service has appropriate permissions. The 32-bit application or the Windows Service makes a call to the WTSQueryUserToken API function.

In this scenario, the call fails. Additionally, the GetLastError API function returns the following Windows error message:

ERROR_INSUFFICIENT_BUFFER

The error code indicates that the data area that is passed to the system call is too small.



CAUSE
This issue occurs because the WTSQueryUserToken API function internally passes a structure to another system call. However, the size of the buffer is incorrectly set to the 32-bit structure size.



WORKAROUND
To work around this issue, you must port the functionality to a native 64-bit version. Depending on the functionality that is required, you may also encapsulate the Terminal Services API functions inside a native 64-bit out-of-process COM server.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbtshoot kbbug kbprb KB920754

-

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

© Microsoft Corporation. All rights reserved.