delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/08/19/05:39:00

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AC2539AF4EC
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1629365939;
bh=mZW8VVzOPNxbECgtaxoUiqEnYgl2guS66PCeuqAfIy4=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=u9nIlDiHvXbnUkt6xNGCq98BBjYF8+ti/zndpzV7npzVphCQuXBUuw5dpofeDHN0Z
KxpJcAQoCV93q6+KojdJb3z5IDAdAet1nGZ8x5i3EMp7kyBdSQlxI70PiieyzUXy3f
1cM8VsJerMNXBWwt2acQeavMvYSeO+9lIU+dW+IA=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D69E385842A
Date: Thu, 19 Aug 2021 11:37:44 +0200
To: cygwin AT cygwin DOT com
Subject: Re: Duplicates in /proc/partitions
Message-ID: <YR4maBeZhSu0+F4y@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAPJ9Yc8KMkmkCsZH7HwzHD59ju41L0svOcCskd3e0OG4qJ8Gxw AT mail DOT gmail DOT com>
<YRp7abUpIAqLCod3 AT calimero DOT vinschen DOT de>
<9a770c83-62ef-6849-16e7-e6956f4d2fab AT SystematicSw DOT ab DOT ca>
<YRqzOZAiDEfkHBM+@calimero.vinschen.de>
<DM8PR09MB70958FD69B70B19E187BD682A5FE9 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
<YRu++uklGOPynvdf AT calimero DOT vinschen DOT de>
<DM8PR09MB709560E2652D35DBE54217C9A5FF9 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
<YR0g29R5sQpEio9A AT calimero DOT vinschen DOT de>
<DM8PR09MB7095852064F71BCCBBFB998AA5FF9 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
MIME-Version: 1.0
In-Reply-To: <DM8PR09MB7095852064F71BCCBBFB998AA5FF9@DM8PR09MB7095.namprd09.prod.outlook.com>
X-Provags-ID: V03:K1://2nWYUb9oStrLme7ZiR8wVjQJOo/+D/MtdPd6vKEGZNx7R9uEs
rFmudWKBHhA78cBzN2Fx2Y+NA2BY0j3iroWvLH/scf+J3Jc8HOHwslZBYi91OxsQoT8elme
C1+Y6iatYfZWMQrifPQwp1PLJSXYw4WaVOLDUQ0iAWRgmlXQOCF/W0Lxao5cCBxvKSoeWBN
H4rK3Pjswbs8x1A3GEQJg==
X-UI-Out-Filterresults: notjunk:1;V03:K0:bkvC7mwRgX8=:cMfdDhu4kOWCURVTc5GlON
3DhE0uAx82ZGHj6bDAZBNT/r9LR3PGUhm7GiSmF35LiQxT6KGdjmvvPQC5C8LMg027PMY/80R
Ibs12cqHQvbUCZobGMRllVRNzLD2kMRJaBr2lUXNzp0rT0C+gRmxS3Ei05PnkVrexJBTB1BeO
32EpiKtOIuUpr1E/6wNXZq4cVeCDo8FIj1H860Q41cicpfgbJT4L85Zah0ewo6k+VchwAFfEj
o0Kofm0cxTq8OBCMBmfKHL7rBm3rj+3owOhCndvLKo9xXzyS+sjXEcoKImgVMXdzhorAQBYFC
KpDp8s78QPbpqlRKqR3iRAv3BRHryQsLgksP0J3c1PHJFMHmeT7y+Uk1HXixeCdB8NN9AHb52
0bNbxCrmQ6oxdy0oMP7j1jU2jyu0VCSwns3Qdfra3eZp4FSEqvgWgCWNK8UNxRIo4t4llPwVf
POOU+u60YQhZu47Bio6p983Omn4ev5l7yeiLlUjlvRKhzQ/aH5AFt6aqS1y4BQMnlxpJuVfKx
8YfxlBicVncsuqnqs5oF/NzlI+zUc7PddSXueTCJZjGAMr0fH7wfG2yHuvUVKvJUNgrf3MDze
zMEFboTrYdeya5cYFZaBPYuKgl8lScO8kEawz0FY6Qg6Q7NzcsqcrzGD1d8k9HWzUuAt4cLRH
9dQMbsC7dTD3fRCxbqcQpq06vKv7G9D2dNa/g45N/3FZP4QF10tDFfpWaKJvGa79b7bn8XT0l
BjMOEFoUmmoEjndVTd6PXohm3R88X+29MJTCXfjRivGzC9hoCp41oSZU0ArKcHJR1W1X//bdS
exAMlvA1qfC6L243z8dllI7jRqZ1MwLNMANF1R+rT600cOb1cd+m4Hr5CzOSOAcrkRC27Hawj
Vy/5qw2I5R4dJzLzJxFg==
X-Spam-Status: No, score=-99.9 required=5.0 tests=BAYES_00,
GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,
SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Aug 18 18:18, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote:
> >       printf ("%5d %5d %9llu sd%c (%lu, %ls)\n",
> >               8, (dev_name - 'a') * 16, size >> 10, dev_name,
> >               (unsigned long) context, dbi->ObjectName.Buffer);
> 
> I replaced with this instead (read_bytes added):
> 
>       printf ("%5d %5d %9llu sd%c (%lu, %ls, %u)\n",
>               8, (dev_name - 'a') * 16, size >> 10, dev_name,
>               (unsigned long) context, dbi->ObjectName.Buffer, bytes_read);
> 
> and here's the output:
> 
> $ ./proc_partition
> major minor  #blocks  name   win-mounts
> 
>     8     0 500107608 sda (282, Harddisk0, 144)
>     8     1    102400 sda1
>     8     2 488280064 sda2    C:\
>     8    16 1000204632 sdb (299, Harddisk1, 144)
>     8    17 1000202240 sdb1    D:\
>     8    32 1000204632 sdc (300, Harddisk1, 144)
>     8    33 1000202240 sdc1    D:\
>     8    48 1000204632 sdd (313, Harddisk2, 144)
>     8    49 1000202240 sdd1    G:\
>     8    64 1000204632 sde (314, Harddisk2, 144)
>     8    65 1000202240 sde1    G:\
>     8    80 1000204632 sdf (329, Harddisk3, 144)
>     8    81 1000202240 sdf1    I:\
>     8    96 1000204632 sdg (330, Harddisk3, 144)
>     8    97 1000202240 sdg1    I:\
>     8   112 234431064 sdh (339, Harddisk4, 144)
>     8   113 234428416 sdh1    F:\
>     8   128 234431064 sdi (340, Harddisk4, 144)
>     8   129 234428416 sdi1    F:\
> DeviceIoControl (Harddisk5\Partition0, IOCTL_DISK_GET_PARTITION_INFO{_EX}) 5    8   144         0 sdj (352, Harddisk5, 624)
> 
> It prints the correct Harddisk names (corresponding to the
> duplicates), so it's consistent.
> 
> I was thinking that the "context" value seems to change just by 1 when
> there's a duplicate coming out;  otherwise, it jumps by more than 10,
> when it is really a new drive...

No, that just indicates the offset between entries, remember the "continue"
in line 77, skipping non-Harddisk entries.  NtQueryDirectoryObject returns
context values starting at 1, incrementing by 1.

> The directory handle is used (indirectly) in NtOpenFile() through the
> attributes, and I wonder if that call somehow distorts the internal
> position within the handle, and so it restarts from the wrong internal
> position in the outer loop.

Unlikely.  That's core functionality which *must* work.


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019