首页 > 其他 > 详细

rtl

时间:2020-06-24 16:59:17      阅读:37      评论:0      收藏:0      [点我收藏+]

RtlUnsubscribeWnfNotificationWaitForCompletion()

// flush.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <Windows.h>
#include <wtsapi32.h>
#pragma comment (lib,"Wtsapi32.lib ")

int _tmain(int argc, _TCHAR* argv[])
{
/*
typedef void(__stdcall*NTPROC)();  
HINSTANCE hinst = LoadLibrary(L"ntdll.dll");  
DWORD dwMajor = 0;  
if(hinst)
{
printf("1234234\n");
NTPROC proc = (NTPROC)GetProcAddress(hinst, "RtlUnsubscribeWnfNotificationWaitForCompletion");   
if(proc)
{
printf("22222222221234234");
proc();  

}
}
if(hinst)
FreeLibrary(hinst);
*/

	BOOL bResult=FALSE;
	DWORD dwSessionID=0xFFFFFFFF;
	WTS_SESSION_INFO *sessionInfo = NULL;
	DWORD sessionInfoCount=0;
	char strWinStationName[MAX_PATH]={0};

	BOOL result = WTSEnumerateSessions(WTS_CURRENT_SERVER_HANDLE, 0, 1, &sessionInfo, &sessionInfoCount);

	for(unsigned int i = 0; i < sessionInfoCount; i++)
	{
		if( (sessionInfo[i].State == WTSActive) )//|| (sessionInfo[i].State == WTSDisconnected) )
		{
			return true;
		}
	}
	WTSFreeMemory(sessionInfo); //释放

	return 0;
}

  

 

rtl

原文:https://www.cnblogs.com/hshy/p/13188195.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!