BUG: WTSWaitSystemEvent Returns Terminal Services Event Twice

BUG: WTSWaitSystemEvent Returns Terminal Services Event Twice

<script type=text/javascript>function loadTOCNode(){}</script>
Article ID:249315
Last Review:November 21, 2006
Revision:3.1
This article was previously published under Q249315
<script type=text/javascript> var sectionFilter = "type != 'notice' && type != 'securedata' && type != 'querywords'"; var tocArrow = "/library/images/support/kbgraphics/public/en-us/downarrow.gif"; var depthLimit = 10; var depth3Limit = 10; var depth4Limit = 5; var depth5Limit = 3; var tocEntryMinimum = 1; </script> <script src="/common/script/gsfx/kbtoc.js?13" type=text/javascript></script>

SYMPTOMS

<script type=text/javascript>loadTOCNode(1, 'symptoms');</script>
When using WTSWaitSystemEvent in a tight loop, events are reported twice for each actual event.

Back to the top

RESOLUTION

<script type=text/javascript>loadTOCNode(1, 'resolution');</script>
The application should expect the event twice, and filter out the second occurrence.

Back to the top

STATUS

<script type=text/javascript>loadTOCNode(1, 'status');</script>
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Back to the top

MORE INFORMATION

<script type=text/javascript>loadTOCNode(1, 'moreinformation');</script>

Steps to Reproduce Behavior

<script type=text/javascript>loadTOCNode(2, 'moreinformation');</script> Compile a program that executes the following code:
    DWORD dwEvent;

    while (1){
        if (!WTSWaitSystemEvent(WTS_CURRENT_SERVER_HANDLE, WTS_EVENT_ALL, &dwEvent))
        {
            printf("WTSWaitSystemEvent failed with %u/n", GetLastError());
            break;
        }

        if (dwEvent & WTS_EVENT_CONNECT)
            printf("WTS_EVENT_CONNECT ");

        if (dwEvent & WTS_EVENT_CREATE)
            printf("WTS_EVENT_CREATE ");

        if (dwEvent & WTS_EVENT_DELETE)
            printf("WTS_EVENT_DELETE ");

        if (dwEvent & WTS_EVENT_DISCONNECT)
            printf("WTS_EVENT_DISCONNECT ");

        if (dwEvent & WTS_EVENT_LOGOFF)
            printf("WTS_EVENT_LOGOFF ");

        if (dwEvent & WTS_EVENT_LOGON)
            printf("WTS_EVENT_LOGON ");

        if (dwEvent & WTS_EVENT_RENAME)
            printf("WTS_EVENT_RENAME ");

        if (dwEvent & WTS_EVENT_STATECHANGE)
            printf("WTS_EVENT_STATECHANGE ");

        printf("/n");
    }
				
If you run the code on a terminal server computer, events are reported twice. For example, if a new session is started, WTS_EVENT_CREATE is reported twice, then WTS_EVENT_LOGON occurs twice, and so on.

Back to the top


APPLIES TO
Microsoft Win32 Application Programming Interface, when used with:
  Microsoft Windows NT 4.0
  Microsoft Windows 2000 Standard Edition

Back to the top

Keywords: 
kbapi kbbug kbkernbase kbtermserv KB249315

Back to the top

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值