Questions tagged [wtsapi32]

For questions about how to use Windows Terminal Services (WTS) API functions (named WTS*), declared in wtsapi32.h / wtsapi32.lib.

Windows Terminal Services (WTS) API functions (named WTS*), declared in wtsapi32.h / wtsapi32.lib, provide a mechanism for querying and manipulating Windows Remote Desktop sessions. Since the underlying WTS session mechanism is also used for local sessions, these APIs can also be used to inquire about and modify local Windows GUI sessions, including those used for Fast User Switching. See also Microsoft's documentation

27 questions
0
votes
0 answers

Some questions about WTSInfoExLevel

I did not get much help from MSDN so posting question on the expert forum: What is the difference between WTSInfoExLevel1.IncomingCompressedBytes and WTSInfoExLevel1.IncomingBytes Is WTSInfoExLevel1.IncomingCompressedBytes the size of the data…
anup kataria
  • 109
  • 5
0
votes
0 answers

Access denied in WinStationConnectW on Windows10

I have been using code which worked well on XP 32bit for years, now PC is upgraded to Windows10 Home 32bit and code no longer works. ProcessId := GetCurrentProcessId; ProcessIdToSessionId(ProcessId,SessionId); WinStationConnectW(SERVERNAME_CURRENT,…
amilewski
  • 125
  • 2
  • 6
0
votes
1 answer

C++ Port Monitor (mfilemon.dll) RDP Virtual Channel code not executing

I recently started working with open source mfilemon.dll and trying to add additional features to it. The feature I am adding is to transmit data over a virtual channel. I wrote a small console exe to test the code and what I have below successfully…
David Bentley
  • 824
  • 1
  • 8
  • 27
0
votes
0 answers

WTSQuerySessionInformation on VPN

We are trying to write a C++ DLL that would run on VMWare server and would return the client (terminal user) IP Address and name. I am using WTSQuerySessionInformation to fetch the IP Address. The problem is when I am running from within the…
VkG
  • 1
  • 2
0
votes
0 answers

Terminal Services - Access Denied from ASMX web service

I'm using the Cassia library to get terminal service information on Server 2008R2. Further more, this is being called from a ASMX web service. I'm having problems with an Access Denied error: System.ComponentModel.Win32Exception: Access is…
Gerneio
  • 1,290
  • 10
  • 13
0
votes
1 answer

WTSRegisterSessionNotification causing process to hang

I followed the "A Simple Window" tutorial from the WinProg website. When the code from the tutorial is compiled without C runtime library, everything seems to work as intended. The window is created and visibly shown to the user. If I close the…
303
  • 2,417
  • 1
  • 11
  • 25
0
votes
1 answer

Export VirtualChannelGetInstance function from c#

I want to export this function from C#: HRESULT VCAPITYPE VirtualChannelGetInstance( _In_ REFIID refiid, _Inout_ ULONG *pNumObjs, _Out_ VOID **ppObjArray ); I have tried following code: public static uint VirtualChannelGetInstance(IntPtr…
iz25
  • 274
  • 1
  • 11
0
votes
1 answer

WTSEnumerateServers ERROR_INVALID_DOMAINNAME

I'm trying to enumerate Terminal servers in our local domain, but WTSEnumerateServers() fails with ErrorCode 1212 ( The format of the specified domain name is invalid. ). I tried it with the subdomain name "sub", with the full domain name …
robin.koch
  • 1,223
  • 1
  • 13
  • 20
0
votes
1 answer

How do I enumerate open windows in a different session from a service?

I've seen this question, but I was hoping to avoid using CreateProcessAsUser. I can enumerate windows by calling EnumDesktopWindows, and I can get the desktops by calling EnumDesktops. Unfortunately, EnumDesktops requires a window station name, and…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
0
votes
1 answer

Programly detect if my machine remotely accessed

I have a winservice running in one PC, it connected to server so we can push a command to this winservcice. One of the command should be : isConnectedRemotly : which should return true if anyone connect to this machine from other machine (remotely),…
Joseph
  • 1,716
  • 3
  • 24
  • 42
0
votes
1 answer

How can I get the domain\user for the logged on user to the current session

I am looking for a way to get the username and domain of the user that is logged on to the session that my process runs in. I can't rely on my process token info since it was created from the token of a different user and contains incorrect info. I…
OSH
  • 2,847
  • 3
  • 25
  • 46
-1
votes
1 answer

Send Notification to specific RDP user from a WTS app that runs as a Windows service

I am trying to send a user a message from a C++ app that runs as a service on a WTS server. Multiple users are logged in via RDP, so I just want to send User X a notification. I have done this using WTSSendMessage(). I am just looking for a more…
hvolks
  • 1
1
2