On Fri, 18 Nov 2022 23:55:40 -0800, T wrote:
Hi All,
Windows 11-pro 22H2
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea
WTSSendMessageA states:
[in] hServer
A handle to an RD Session Host server. Specify
a handle opened by the WTSOpenServer function,
or specify WTS_CURRENT_SERVER_HANDLE to indicate
the RD Session Host server on which your application
is running.
If I choose NOT to use "WTS_CURRENT_SERVER_HANDLE",
how to I get my "handle to an RD Session Host server"?
Many thanks,
-T
It's there in the text you just posted.
Hi All,
Windows 11-pro 22H2 https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea
WTSSendMessageA states:
[in] hServer
A handle to an RD Session Host server. Specify
a handle opened by the WTSOpenServer function,
or specify WTS_CURRENT_SERVER_HANDLE to indicate
the RD Session Host server on which your application
is running.
If I choose NOT to use "WTS_CURRENT_SERVER_HANDLE",
how to I get my "handle to an RD Session Host server"?
Many thanks,
-T
On 11/19/22 01:24, JJ wrote:
On Fri, 18 Nov 2022 23:55:40 -0800, T wrote:
Hi All,
Windows 11-pro 22H2
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea
WTSSendMessageA states:
[in] hServer
A handle to an RD Session Host server. Specify
a handle opened by the WTSOpenServer function,
or specify WTS_CURRENT_SERVER_HANDLE to indicate
the RD Session Host server on which your application
is running.
If I choose NOT to use "WTS_CURRENT_SERVER_HANDLE",
how to I get my "handle to an RD Session Host server"?
Many thanks,
-T
It's there in the text you just posted.
Hi JJ,
WTS_CURRENT_SERVER_HANDLE is a constant set to 0
I am after the actual handle as I am working in
an RDP environment. It is not zero.
You can get that handle with
C++
HANDLE WTSOpenServerA(
[in] LPSTR pServerName
);
Now all I am missing is the call to get my
local computer's server name (and its syntax)
-T
On Sat, 19 Nov 2022 01:30:04 -0800, T wrote:
On 11/19/22 01:24, JJ wrote:
On Fri, 18 Nov 2022 23:55:40 -0800, T wrote:
Hi All,
Windows 11-pro 22H2
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea
WTSSendMessageA states:
[in] hServer
A handle to an RD Session Host server. Specify
a handle opened by the WTSOpenServer function,
or specify WTS_CURRENT_SERVER_HANDLE to indicate
the RD Session Host server on which your application
is running.
If I choose NOT to use "WTS_CURRENT_SERVER_HANDLE",
how to I get my "handle to an RD Session Host server"?
Many thanks,
-T
It's there in the text you just posted.
Hi JJ,
WTS_CURRENT_SERVER_HANDLE is a constant set to 0
I am after the actual handle as I am working in
an RDP environment. It is not zero.
You can get that handle with
C++
HANDLE WTSOpenServerA(
[in] LPSTR pServerName
);
Now all I am missing is the call to get my
local computer's server name (and its syntax)
-T
`GetComputerName()` can be used to get the local computer name. But using that name is same as using `WTS_CURRENT_SERVER_HANDLE`. The local computer name will always resolve to `127.0.0.1` which is same as `localhost` when looked up from local computer.
On 11/19/22 21:35, T wrote:
On 11/19/22 15:45, T wrote:
What is the difference between GetComputerName and
C++
int gethostname(
�� [out] char *name,
�� [in]� int� namelen
);
Trivia.� I just noticed that "[out] char *name,"
is in UTF16 format.
Oops. My bad. It is utf8
WTSSendMessageA states:
[in] hServer
A handle to an RD Session Host server. Specify a
handle opened by the WTSOpenServer function
So which of GetComputerName and gethostname should I use?
On Sun, 20 Nov 2022 13:19:09 -0800, T wrote:
WTSSendMessageA states:
[in] hServer
A handle to an RD Session Host server. Specify a
handle opened by the WTSOpenServer function
So which of GetComputerName and gethostname should I use?
GetComputerName, since Windows networking prioritize NetBIOS name.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 166:46:26 |
| Calls: | 12,096 |
| Calls today: | 4 |
| Files: | 15,003 |
| Messages: | 6,517,808 |