Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

We can predict everything, except the future.


devel / comp.os.ms-windows.programmer.win32 / Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

SubjectAuthor
* Console : volume name displayed by "dir" is different than returned by GetVolumeR.Wieser
`* Re: Console : volume name displayed by "dir" is different than returned by GetVoJJ
 `* Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser
  +* Re: Console : volume name displayed by "dir" is different than returned by GetVoJJ
  |`- Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser
  `* Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser
   `* Re: Console : volume name displayed by "dir" is different than returnedUwe Sieber
    `* Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser
     `* Re: Console : volume name displayed by "dir" is different than returnedUwe Sieber
      `* Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser
       +* Re: Console : volume name displayed by "dir" is different than returnedUwe Sieber
       |`- Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser
       `- Re: Console : volume name displayed by "dir" is different than returned by GetVoR.Wieser

1
Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<st8krg$2u6$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=361&group=comp.os.ms-windows.programmer.win32#361

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Mon, 31 Jan 2022 13:31:34 +0100
Organization: Aioe.org NNTP Server
Lines: 20
Message-ID: <st8krg$2u6$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="3014"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Mon, 31 Jan 2022 12:31 UTC

Hello all,

Inside an XPsp3 CMD.EXE console window :

I've just used 'GetVolumeInformation' function to retrieve a drives volume
name and noticed that it looks differently from when I did a "dir" for the
same drive.

The "dir" command returns an intended 0xFA (a small vertically-centered
dot), the GetVolumeInformation function returns a 0XB7 (single border left,
double border down).

I'm /guessing/ that some kind of characterset translation is performed
by/for the "dir" command. How can I have the same done to (the output of)
the GetVolumeInformation function ?

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=362&group=comp.os.ms-windows.programmer.win32#362

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!HE4EcRuJX5Jeqkp3AbLQWw.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Tue, 1 Feb 2022 09:41:17 +0700
Organization: Aioe.org NNTP Server
Message-ID: <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net>
References: <st8krg$2u6$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="24306"; posting-host="HE4EcRuJX5Jeqkp3AbLQWw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Notice: Filtered by postfilter v. 0.9.2
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 - Tue, 1 Feb 2022 02:41 UTC

On Mon, 31 Jan 2022 13:31:34 +0100, R.Wieser wrote:
> Hello all,
>
> Inside an XPsp3 CMD.EXE console window :
>
> I've just used 'GetVolumeInformation' function to retrieve a drives volume
> name and noticed that it looks differently from when I did a "dir" for the
> same drive.
>
> The "dir" command returns an intended 0xFA (a small vertically-centered
> dot), the GetVolumeInformation function returns a 0XB7 (single border left,
> double border down).
>
> I'm /guessing/ that some kind of characterset translation is performed
> by/for the "dir" command. How can I have the same done to (the output of)
> the GetVolumeInformation function ?
>
> Regards,
> Rudy Wieser

The Middle Dot character's Unicode Codepoint is 0xB7 which is the same
character code for Windows (ANSI) code page. DIR generates character code
translated to OEM US code page 437, which is 0xFA.

If you switch to code page 1252 in CMD using `chcp 1252` then capture the
DIR output, it'll generate character code 0xB7 instead of 0xFA.

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stavns$1866$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=363&group=comp.os.ms-windows.programmer.win32#363

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Tue, 1 Feb 2022 10:49:33 +0100
Organization: Aioe.org NNTP Server
Lines: 24
Message-ID: <stavns$1866$1@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="41158"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Tue, 1 Feb 2022 09:49 UTC

JJ,

> The Middle Dot character's Unicode Codepoint is 0xB7 which is the same
> character code for Windows (ANSI) code page. DIR generates character
> code translated to OEM US code page 437, which is 0xFA.

Thanks for confirming my guess. :-)

> If you switch to code page 1252 in CMD using `chcp 1252` then capture
> the DIR output, it'll generate character code 0xB7 instead of 0xFA.

I just wrote a "thanks, I'm going to try that", but realized that that
ofcourse affects all other console-based programs too, and only on my
current machine - neither of which is positive.

IOW, I'm going to see if I can find something that will either only change
the codepage for a single program (emulating what the DIR command seems to
be doing), or perhaps even a codepage translation for just that string.
Google/DDG, here I come :-)

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<1trrrfyy758y8$.1wk42jo2dkham.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=364&group=comp.os.ms-windows.programmer.win32#364

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!pE04nM/4DvlO2w4E2SlC2g.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Tue, 1 Feb 2022 21:25:16 +0700
Organization: Aioe.org NNTP Server
Message-ID: <1trrrfyy758y8$.1wk42jo2dkham.dlg@40tude.net>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="39447"; posting-host="pE04nM/4DvlO2w4E2SlC2g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
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-Notice: Filtered by postfilter v. 0.9.2
 by: JJ - Tue, 1 Feb 2022 14:25 UTC

On Tue, 1 Feb 2022 10:49:33 +0100, R.Wieser wrote:
>
> IOW, I'm going to see if I can find something that will either only change
> the codepage for a single program (emulating what the DIR command seems to
> be doing), or perhaps even a codepage translation for just that string.
> Google/DDG, here I come :-)

I use Microsoft AppLocale for that.

https://en.wikipedia.org/wiki/AppLocale

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stbhl1$22j$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=365&group=comp.os.ms-windows.programmer.win32#365

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Tue, 1 Feb 2022 15:51:19 +0100
Organization: Aioe.org NNTP Server
Lines: 11
Message-ID: <stbhl1$22j$1@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="2131"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Tue, 1 Feb 2022 14:51 UTC

> IOW, I'm going to see if I can find something that will either only change
> the codepage for a single program

I found and tried SetConsoleOutputCP as well as SetConsoleCP, but neither
seems to affect the output I'm writing (to the STD_OUTPUT_HANDLE file).
And both seem to remain after my program terminates. :-|

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stbhl3$22j$2@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=366&group=comp.os.ms-windows.programmer.win32#366

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Tue, 1 Feb 2022 15:55:10 +0100
Organization: Aioe.org NNTP Server
Lines: 12
Message-ID: <stbhl3$22j$2@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <1trrrfyy758y8$.1wk42jo2dkham.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="2131"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Tue, 1 Feb 2022 14:55 UTC

JJ,

> I use Microsoft AppLocale for that.

Thanks. But I need my program set it for itself, and just for the 32...255
range.

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<j5v6b6Fdu7jU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=367&group=comp.os.ms-windows.programmer.win32#367

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: mail@uwe-sieber.de (Uwe Sieber)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned
by GetVolumeInformation ?
Date: Wed, 02 Feb 2022 11:56:31 +0100
Lines: 24
Message-ID: <j5v6b6Fdu7jU1@mid.individual.net>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net J9maKuCx0SeZcQOH430NvgL5fuzp+W1iRU0RQWrcc2bJxSuQ==
Cancel-Lock: sha1:aEwdu9j2dZPYBs0zO1zX3zYQTrM=
User-Agent: nix Hamster/1.3.23.4
In-Reply-To: <stbhl1$22j$1@gioia.aioe.org>
 by: Uwe Sieber - Wed, 2 Feb 2022 10:56 UTC

R.Wieser wrote:
>> IOW, I'm going to see if I can find something that will either only change
>> the codepage for a single program
>
> I found and tried SetConsoleOutputCP as well as SetConsoleCP, but neither
> seems to affect the output I'm writing (to the STD_OUTPUT_HANDLE file).
> And both seem to remain after my program terminates. :-|

Just make a unicode application and write the output by means of
WriteConsoleW(), which performs the translation to the console's
codepage which works without any losses if it is UTF-8 and no
bitmap font is used.

But if the output is redirected then WriteConsole fails and WriteFile
must be used. Here you write raw data and are reponsible to translate
the text to the desired format. I use GetACP() for WideCharToMultiByte.

m_OutputRedirected = ( GetFileType(GetStdHandle(STD_OUTPUT_HANDLE)) != FILE_TYPE_CHAR );
m_ErrorRedirected = ( GetFileType(GetStdHandle(STD_ERROR_HANDLE )) != FILE_TYPE_CHAR );

Or just assume redirection if WriteConsole fails ;-)

Uwe

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stebqu$p4t$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=368&group=comp.os.ms-windows.programmer.win32#368

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Wed, 2 Feb 2022 17:33:50 +0100
Organization: Aioe.org NNTP Server
Lines: 34
Message-ID: <stebqu$p4t$1@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org> <j5v6b6Fdu7jU1@mid.individual.net>
Injection-Info: gioia.aioe.org; logging-data="25757"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Wed, 2 Feb 2022 16:33 UTC

Uwe,

> Just make a unicode application

Thanks, but no. I like ASCII too much to ditch it for a problem like this.

> and write the output by means of WriteConsoleW()

The last time I looked that needed a console screen buffer. And while
playing with that I had to experience that those do not really work nicely
alongside of STD_OUTPUT_HANDLE file output (strange stuff happened).

> m_OutputRedirected = ( GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))
> != FILE_TYPE_CHAR );

(Named) Pipes are also character devices ...

> Or just assume redirection if WriteConsole fails ;-)

That sounds like something I would do. Its too damn hard to figure out if
a handle is redirected or not. Although MSDN mentiones GetConsoleMode I do
not see how (also, it has side effects when used on a pipe).

Thanks for the suggestion though.

I'm currently thinking of trying to use a MultiByteToWideChar,
WideCharToMultiByte pair to do the translation. Not elegant, but with
(seemingly) the absense of anything else it will have to do. :-\

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<j61ne9FcinhU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=369&group=comp.os.ms-windows.programmer.win32#369

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: mail@uwe-sieber.de (Uwe Sieber)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned
by GetVolumeInformation ?
Date: Thu, 03 Feb 2022 09:14:54 +0100
Lines: 38
Message-ID: <j61ne9FcinhU1@mid.individual.net>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org> <j5v6b6Fdu7jU1@mid.individual.net> <stebqu$p4t$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net BLHjlG+bGFAwESeMp6LYOgF3FckZ+KFa+P/kXs0FSlGxHAhA==
Cancel-Lock: sha1:QIlCEdajCl7ySOW7uS29qSo10Zg=
User-Agent: nix Hamster/1.3.23.4
In-Reply-To: <stebqu$p4t$1@gioia.aioe.org>
 by: Uwe Sieber - Thu, 3 Feb 2022 08:14 UTC

R.Wieser wrote:
>
>> Just make a unicode application
>
> Thanks, but no. I like ASCII too much to ditch it for a problem like this.

Then just use W functions here and there...

>> and write the output by means of WriteConsoleW()
>
> The last time I looked that needed a console screen buffer. And while
> playing with that I had to experience that those do not really work nicely
> alongside of STD_OUTPUT_HANDLE file output (strange stuff happened).

No, WriteConsoleOutput needs console buffer, WriteConsole just a string buffer.

>
>> m_OutputRedirected = ( GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))
>> != FILE_TYPE_CHAR );
>
> (Named) Pipes are also character devices ...

Nope, they are FILE_TYPE_PIPE.

> I'm currently thinking of trying to use a MultiByteToWideChar,
> WideCharToMultiByte pair to do the translation. Not elegant, but with
> (seemingly) the absense of anything else it will have to do. :-\

W function plus WriteConsoleW plus non-bitmap font plus codepage 65001 (UTF-8)
is the only way to avoid character translation losses.
Until you hit a FAT drive with non-ASCII charcters in the volume label (which
is OEM-CP on disk) written under a dfferent OEM-CP than the current one :-)

Uwe

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stgc2q$1njs$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=370&group=comp.os.ms-windows.programmer.win32#370

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Thu, 3 Feb 2022 11:50:44 +0100
Organization: Aioe.org NNTP Server
Lines: 47
Message-ID: <stgc2q$1njs$1@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org> <j5v6b6Fdu7jU1@mid.individual.net> <stebqu$p4t$1@gioia.aioe.org> <j61ne9FcinhU1@mid.individual.net>
Injection-Info: gioia.aioe.org; logging-data="56956"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Thu, 3 Feb 2022 10:50 UTC

Uwe,

> No, WriteConsoleOutput needs console buffer, WriteConsole just a string
> buffer.

I'm afraid MS begs to differ :

https://docs.microsoft.com/en-us/windows/console/writeconsole

"hConsoleOutput [in]
A handle to the console screen buffer."

>>> m_OutputRedirected = ( GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))
>>> != FILE_TYPE_CHAR );
>>
>> (Named) Pipes are also character devices ...
>
> Nope, they are FILE_TYPE_PIPE.

My apologies, I was (somehow) looking at GetConsoleMode.

And although I wondered about a redirected-to-another-programs StdIn, a
quick test showed that that also returns the "pipe" type.

> W function plus WriteConsoleW plus non-bitmap font plus codepage 65001
> (UTF-8) is the only way to avoid character translation losses.

That does limit my options a bit. :-|

> Until you hit a FAT drive with non-ASCII charcters in the volume label
> (which is OEM-CP on disk) written under a dfferent OEM-CP than the current
> one :-)

At the time I created that volume label (first letter of my christian name,
vertically centered dot, family name - on an USB stick) I already wondered
how long it would take before some kind of a problem with it would pop up
....

Although it didn't for a decade or so I think I should re-think the wisdom
of it. :-)

Thanks for the information.

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<j64caqFs4ptU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=371&group=comp.os.ms-windows.programmer.win32#371

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: mail@uwe-sieber.de (Uwe Sieber)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned
by GetVolumeInformation ?
Date: Fri, 04 Feb 2022 09:09:14 +0100
Lines: 23
Message-ID: <j64caqFs4ptU1@mid.individual.net>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org> <j5v6b6Fdu7jU1@mid.individual.net> <stebqu$p4t$1@gioia.aioe.org> <j61ne9FcinhU1@mid.individual.net> <stgc2q$1njs$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 7YhoHUrbVKPNwoJXxyp4CQ3bpg8tI1NvjBCbP8CJBNq8Lutw==
Cancel-Lock: sha1:M2+/jX2Aed4Ep0QB5H8XZq0IBlg=
User-Agent: nix Hamster/1.3.23.4
In-Reply-To: <stgc2q$1njs$1@gioia.aioe.org>
 by: Uwe Sieber - Fri, 4 Feb 2022 08:09 UTC

R.Wieser wrote:
>
>> No, WriteConsoleOutput needs console buffer, WriteConsole just a string
>> buffer.
>
> I'm afraid MS begs to differ :
>
> https://docs.microsoft.com/en-us/windows/console/writeconsole
>
> "hConsoleOutput [in]
> A handle to the console screen buffer."

I thought you talk about the buffer with the characters to write...

About the handle:
GetStdHandle(STD_OUTPUT_HANDLE) is the handle to the current console
screen buffer and can be used with WriteConsole and WriteConsoleOutput.

Uwe

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stivhj$iud$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=372&group=comp.os.ms-windows.programmer.win32#372

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Fri, 4 Feb 2022 11:35:19 +0100
Organization: Aioe.org NNTP Server
Lines: 26
Message-ID: <stivhj$iud$1@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org> <j5v6b6Fdu7jU1@mid.individual.net> <stebqu$p4t$1@gioia.aioe.org> <j61ne9FcinhU1@mid.individual.net> <stgc2q$1njs$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="19405"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Response
 by: R.Wieser - Fri, 4 Feb 2022 10:35 UTC

Uwe,

> I'm afraid MS begs to differ :
>
> https://docs.microsoft.com/en-us/windows/console/writeconsole
>
> "hConsoleOutput [in]
> A handle to the console screen buffer."

I thought "what the heck, the program can only crash" and just now tried
providing it the StdOut handle. Unexpected (by me) I got output on the
screen *and* I could use WriteFile to the same StdOut handle without it
becoming a mess.

And oh yeah, it gave me the output I needed too (regardless of using the W
or A version).

IOW, I owe you another thanks.

As for MS, I guess its another example of how hard it is to write good
documentation. :-\

Regards,
Rudy Wieser

Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?

<stjb11$3po$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=373&group=comp.os.ms-windows.programmer.win32#373

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Console : volume name displayed by "dir" is different than returned by GetVolumeInformation ?
Date: Fri, 4 Feb 2022 14:51:18 +0100
Organization: Aioe.org NNTP Server
Lines: 20
Message-ID: <stjb11$3po$1@gioia.aioe.org>
References: <st8krg$2u6$1@gioia.aioe.org> <8c0l6zjviggg$.oam8mhu5lnj4.dlg@40tude.net> <stavns$1866$1@gioia.aioe.org> <stbhl1$22j$1@gioia.aioe.org> <j5v6b6Fdu7jU1@mid.individual.net> <stebqu$p4t$1@gioia.aioe.org> <j61ne9FcinhU1@mid.individual.net> <stgc2q$1njs$1@gioia.aioe.org> <j64caqFs4ptU1@mid.individual.net>
Injection-Info: gioia.aioe.org; logging-data="3896"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-MSMail-Priority: Normal
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Fri, 4 Feb 2022 13:51 UTC

Uwe,

> I thought you talk about the buffer with the characters to write...

:-) And I was thinking that that is normally referred to as "a string" ...

I on my side did not recognise that "the console screen buffer" is not just
an array of bytes.

> About the handle:
> GetStdHandle(STD_OUTPUT_HANDLE) is the handle to the current console
> screen buffer and can be used with WriteConsole and WriteConsoleOutput.

Thanks. Having to rely on the MS docs for most of what I do I surely miss
(in more than one sense of the word) details like that. :-\

Regards,
Rudy Wieser

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor