Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

This system will self-destruct in five minutes.


devel / comp.os.ms-windows.programmer.win32 / WTSSendMessageA handle?

SubjectAuthor
* WTSSendMessageA handle?T
+- WTSSendMessageA handle?T
`* WTSSendMessageA handle?JJ
 `* WTSSendMessageA handle?T
  `* WTSSendMessageA handle?JJ
   `* WTSSendMessageA handle?T
    `* WTSSendMessageA handle?T
     `* WTSSendMessageA handle?T
      `* WTSSendMessageA handle?JJ
       `* WTSSendMessageA handle?T
        `* WTSSendMessageA handle?JJ
         `- WTSSendMessageA handle?T

1
WTSSendMessageA handle?

<tla25s$36el5$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1149&group=comp.os.ms-windows.programmer.win32#1149

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: WTSSendMessageA handle?
Date: Fri, 18 Nov 2022 23:55:40 -0800
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tla25s$36el5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Nov 2022 07:55:40 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e0721d9ede8cfff905f47bed27bcff85";
logging-data="3357349"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19O+pIEmKTIxObrtD9/hbtwQb250SkmbVM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:QyN8rPeT6X8RVms8gPrQpFC0KqI=
Content-Language: en-US
 by: T - Sat, 19 Nov 2022 07:55 UTC

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

Re: WTSSendMessageA handle?

<tla736$36mns$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1153&group=comp.os.ms-windows.programmer.win32#1153

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 01:19:34 -0800
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <tla736$36mns$2@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sat, 19 Nov 2022 09:19:34 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e0721d9ede8cfff905f47bed27bcff85";
logging-data="3365628"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19egz1KveoLR8X4MYGhn7rZ8czyYSD4Uqs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:jfXJJNWRj/+ZtWiMJiL+H6lLzWY=
Content-Language: en-US
In-Reply-To: <tla25s$36el5$1@dont-email.me>
 by: T - Sat, 19 Nov 2022 09:19 UTC

On 11/18/22 23:55, 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 is a call to
C++
HANDLE WTSOpenServerA(
[in] LPSTR pServerName
);

But what is the call to get my local computer's
server's name?
I suppose I could always use:
set | grep -i kvm
COMPUTERNAME=KVM-W11
LOGONSERVER=\\KVM-W11
and try to figure out what the format is.
\\ or no \\ etc.
A system call would solve that

Re: WTSSendMessageA handle?

<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1154&group=comp.os.ms-windows.programmer.win32#1154

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 16:24:38 +0700
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net>
References: <tla25s$36el5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="926565384ccc714839c51564c9375f58";
logging-data="3370603"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fBenVG1vbxeVXy+rjkUDwmXjypNSfiII="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:+jByZIQg97uP/qbSJWbG/qm+4HM=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sat, 19 Nov 2022 09:24 UTC

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.

Re: WTSSendMessageA handle?

<tla7ms$36mns$3@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1155&group=comp.os.ms-windows.programmer.win32#1155

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 01:30:04 -0800
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <tla7ms$36mns$3@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Nov 2022 09:30:04 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e0721d9ede8cfff905f47bed27bcff85";
logging-data="3365628"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Wj2SN0ocJAIXiqRIFt5W7KglfCocdC6U="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:2FpbXUOgPxc5m481wn7xnCqLdAI=
In-Reply-To: <124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net>
Content-Language: en-US
 by: T - Sat, 19 Nov 2022 09:30 UTC

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

Re: WTSSendMessageA handle?

<9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1158&group=comp.os.ms-windows.programmer.win32#1158

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 18:41:27 +0700
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net>
References: <tla25s$36el5$1@dont-email.me> <124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="926565384ccc714839c51564c9375f58";
logging-data="3390099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rsmcIWVpoqBIIEXLCYnc6FLCzoysHsdA="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:0X9aagEltfHcgriTHnzsYod/y4U=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sat, 19 Nov 2022 11:41 UTC

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.

Re: WTSSendMessageA handle?

<tlbpq2$3aqql$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1162&group=comp.os.ms-windows.programmer.win32#1162

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 15:45:06 -0800
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <tlbpq2$3aqql$1@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me>
<9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Nov 2022 23:45:06 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e9db30732ed2d58210b3efd036b7b7af";
logging-data="3500885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BnGPztYbI23RbpjBITWBQbgdcJitBYAU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:J6+tNP+tIjI9SJpVUfXmN4kx9CU=
Content-Language: en-US
In-Reply-To: <9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net>
 by: T - Sat, 19 Nov 2022 23:45 UTC

On 11/19/22 03:41, JJ wrote:
> 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.

What is the difference between GetComputerName and

C++

int gethostname(
[out] char *name,
[in] int namelen
);

Re: WTSSendMessageA handle?

<tlcebm$3f1vk$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1165&group=comp.os.ms-windows.programmer.win32#1165

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 21:35:49 -0800
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <tlcebm$3f1vk$1@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me>
<9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net> <tlbpq2$3aqql$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sun, 20 Nov 2022 05:35:50 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e9db30732ed2d58210b3efd036b7b7af";
logging-data="3639284"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nhDmeye5d4nXjAv+03xzpelzlJnp+kMs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:Zbn54FtwapCMgrstFcSuIK9AMyI=
In-Reply-To: <tlbpq2$3aqql$1@dont-email.me>
Content-Language: en-US
 by: T - Sun, 20 Nov 2022 05:35 UTC

On 11/19/22 15:45, T wrote:
> On 11/19/22 03:41, JJ wrote:
>> 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.
>
>
> 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.

Re: WTSSendMessageA handle?

<tlcg8v$3f7gt$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1166&group=comp.os.ms-windows.programmer.win32#1166

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sat, 19 Nov 2022 22:08:31 -0800
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <tlcg8v$3f7gt$1@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me>
<9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net> <tlbpq2$3aqql$1@dont-email.me>
<tlcebm$3f1vk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sun, 20 Nov 2022 06:08:32 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e9db30732ed2d58210b3efd036b7b7af";
logging-data="3644957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BNBniozy6KHQY7aMmO9XMNRbbZL5jd7U="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:Wz2T9Dvcv7/6x3SPsqsVLZk8BVk=
Content-Language: en-US
In-Reply-To: <tlcebm$3f1vk$1@dont-email.me>
 by: T - Sun, 20 Nov 2022 06:08 UTC

On 11/19/22 21:35, T wrote:
> On 11/19/22 15:45, T wrote:
>> On 11/19/22 03:41, JJ wrote:
>>> 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.
>>
>>
>> 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

Re: WTSSendMessageA handle?

<q4m8qkz4rxi7$.pxmmy8hcrnv3.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1167&group=comp.os.ms-windows.programmer.win32#1167

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sun, 20 Nov 2022 21:07:01 +0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <q4m8qkz4rxi7$.pxmmy8hcrnv3.dlg@40tude.net>
References: <tla25s$36el5$1@dont-email.me> <124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me> <9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net> <tlbpq2$3aqql$1@dont-email.me> <tlcebm$3f1vk$1@dont-email.me> <tlcg8v$3f7gt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="91448c461c171840ab632fb3684b5b94";
logging-data="3711126"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hytRs5BB8R65aiRpJFrcpviwgxCGa0jA="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:+zk/EvIR3VsW8K8utiUiXNsKXfE=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sun, 20 Nov 2022 14:07 UTC

On Sat, 19 Nov 2022 22:08:31 -0800, T wrote:
> 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

"Host name" is not same as "computer name".

`GetComputerName()` returns the computer name as specified in the "System
properties" Control Panel.

`gethostname()` returns the (network) host name as specified in the `HOSTS`
file, which is by default is `localhost`.

Re: WTSSendMessageA handle?

<tle5kd$3jii1$3@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1169&group=comp.os.ms-windows.programmer.win32#1169

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Sun, 20 Nov 2022 13:19:09 -0800
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <tle5kd$3jii1$3@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me>
<9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net> <tlbpq2$3aqql$1@dont-email.me>
<tlcebm$3f1vk$1@dont-email.me> <tlcg8v$3f7gt$1@dont-email.me>
<q4m8qkz4rxi7$.pxmmy8hcrnv3.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sun, 20 Nov 2022 21:19:09 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ae6805cbe50cca276346f0582c64b393";
logging-data="3787329"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jD1AaUW+WhX6BQUNhftjuR2W3s0po+ak="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:5PPawEawmqkmoYEA9YBdCMJU9Zo=
Content-Language: en-US
In-Reply-To: <q4m8qkz4rxi7$.pxmmy8hcrnv3.dlg@40tude.net>
 by: T - Sun, 20 Nov 2022 21:19 UTC

On 11/20/22 06:07, JJ wrote:
> On Sat, 19 Nov 2022 22:08:31 -0800, T wrote:
>> 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
>
> "Host name" is not same as "computer name".
>
> `GetComputerName()` returns the computer name as specified in the "System
> properties" Control Panel.
>
> `gethostname()` returns the (network) host name as specified in the `HOSTS`
> file, which is by default is `localhost`.

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?

Re: WTSSendMessageA handle?

<zv94ch63ckk2$.5bb9pf6z2dhr.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1170&group=comp.os.ms-windows.programmer.win32#1170

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Mon, 21 Nov 2022 08:23:59 +0700
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <zv94ch63ckk2$.5bb9pf6z2dhr.dlg@40tude.net>
References: <tla25s$36el5$1@dont-email.me> <124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me> <9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net> <tlbpq2$3aqql$1@dont-email.me> <tlcebm$3f1vk$1@dont-email.me> <tlcg8v$3f7gt$1@dont-email.me> <q4m8qkz4rxi7$.pxmmy8hcrnv3.dlg@40tude.net> <tle5kd$3jii1$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="1188fdb01d749e2a8236543e9a589473";
logging-data="3822745"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+eET1Xk6m5ErU1ap9DijSzVfEG99vel3Y="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:7mfEQKOSKtSSlmSm6TIzJyKQEfk=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Mon, 21 Nov 2022 01:23 UTC

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.

Re: WTSSendMessageA handle?

<tlfnad$3psh6$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=1171&group=comp.os.ms-windows.programmer.win32#1171

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: T@invalid.invalid (T)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: WTSSendMessageA handle?
Date: Mon, 21 Nov 2022 03:27:09 -0800
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <tlfnad$3psh6$1@dont-email.me>
References: <tla25s$36el5$1@dont-email.me>
<124w5o84i1bk4$.6okzj059xuk9$.dlg@40tude.net> <tla7ms$36mns$3@dont-email.me>
<9njecifn5tq2.1e5nyctxmi84$.dlg@40tude.net> <tlbpq2$3aqql$1@dont-email.me>
<tlcebm$3f1vk$1@dont-email.me> <tlcg8v$3f7gt$1@dont-email.me>
<q4m8qkz4rxi7$.pxmmy8hcrnv3.dlg@40tude.net> <tle5kd$3jii1$3@dont-email.me>
<zv94ch63ckk2$.5bb9pf6z2dhr.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 21 Nov 2022 11:27:10 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="92b72b8768ca081cce688cd461b0a325";
logging-data="3994150"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xvqmGkSUOuGTXuI4SAOgRsKjvpzrPKuM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:kcm1yputbUElj6wIY+MT8CvDHNk=
Content-Language: en-US
In-Reply-To: <zv94ch63ckk2$.5bb9pf6z2dhr.dlg@40tude.net>
 by: T - Mon, 21 Nov 2022 11:27 UTC

On 11/20/22 17:23, JJ wrote:
> 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.

Thank you!

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor