Quantcast
Channel: Remote Desktop Services (Terminal Services) forum
Viewing all articles
Browse latest Browse all 1106

WTSVirtualChannelOpen fails with ERROR_NOT_SUPPORTED on Windows 2012 R2

$
0
0

Hi,

I am testing this simple C++ application below on Windows 2012 R2 and WTSVirtualChannelOpen fails with error code "ERROR_NOT_SUPPORTED". The same application runs fine on Windows Server 2008.

I have tried with WTSVirtualChannelOpenEx but I got the same error code.

Can anyone help me shed some light on this issue? That would be much appreciated :-)

Thank you.

#include <conio.h>
#include <windows.h>
#include <Wtsapi32.h>
#include <iostream>

#define TERMINAL_SERVICES_VC_NAME "TEST"

int _tmain(int argc, _TCHAR* argv[])
{
	std::cout << "<< Virtual Channel App >>" << std::endl;
	HANDLE hVirtualChannel = WTSVirtualChannelOpen(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, TERMINAL_SERVICES_VC_NAME);

	if(hVirtualChannel)
		std::cout << "WTSVirtualChannelOpen successful" << std::endl;
	else
		std::cerr << "WTSVirtualChannelOpen fails with error code: " << GetLastError() << std::endl;

	std::cout << "Press Enter to quit..." << std::endl;
	_getch();

	if(WTSVirtualChannelClose(hVirtualChannel))
		std::cout << "TSVirtualChannelClose successful" << std::endl;
	else
		std::cerr << "TSVirtualChannelClose fails with error code: " << GetLastError() << std::endl;
	return 0;
}


Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>