Article ID: 920754 - Last Review: October 11, 2007 - Revision: 1.4 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: "ERROR_INSUFFICIENT_BUFFER"
SYMPTOMSConsider 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 CAUSEThis 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. WORKAROUNDTo 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. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed in the "Applies to"
section. APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |





















Back to the top