mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
// refcount.cpp : Defines the entry point for the application.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include <atlbase.h>
|
|
#include <rdshost.h>
|
|
#include <rdshost_i.c>
|
|
|
|
int APIENTRY WinMain(HINSTANCE hInstance,
|
|
HINSTANCE hPrevInstance,
|
|
LPSTR lpCmdLine,
|
|
int nCmdShow)
|
|
{
|
|
DWORD cnt;
|
|
CoInitialize(NULL);
|
|
|
|
IRemoteDesktopServerHost *host;
|
|
IRemoteDesktopServer *srvr;
|
|
|
|
HRESULT hr;
|
|
hr = CoCreateInstance(
|
|
CLSID_RemoteDesktopServerHost,
|
|
NULL, CLSCTX_ALL,
|
|
__uuidof(IRemoteDesktopServerHost),
|
|
(LPVOID*)&host
|
|
);
|
|
if (!SUCCEEDED(hr)) {
|
|
fprintf(stderr, "CoCreateInstance: %08X", hr);
|
|
exit(-1);
|
|
}
|
|
|
|
hr = host->GetRemoteDesktopServer(&srvr);
|
|
if (!SUCCEEDED(hr)) {
|
|
fprintf(stderr, "GetRemoteDesktopServer: %08X", hr);
|
|
exit(-1);
|
|
}
|
|
|
|
srvr->StartListening();
|
|
srvr->StopListening();
|
|
/*
|
|
srvr->StartListening();
|
|
srvr->StopListening();
|
|
*/
|
|
cnt = srvr->Release();
|
|
cnt = host->Release();
|
|
|
|
CoUninitialize();
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
|