From 6729d89a506b1015ff2487f8411c513ad2b9e64a Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Wed, 16 Oct 2024 11:49:04 -0400 Subject: [PATCH 1/2] Add docs for DecodeLength and TryDecodeLength --- xml/System.Formats.Asn1/AsnDecoder.xml | 54 +++++++++++++++++++------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/xml/System.Formats.Asn1/AsnDecoder.xml b/xml/System.Formats.Asn1/AsnDecoder.xml index d04d7a494b2..b8844952602 100644 --- a/xml/System.Formats.Asn1/AsnDecoder.xml +++ b/xml/System.Formats.Asn1/AsnDecoder.xml @@ -43,12 +43,25 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The buffer containing encoded data. + The encoding constraints to use when interpreting the data. + + When this method returns, the number of bytes from the beginning of that contributed to the length. + This parameter is treated as uninitialized. + + + Decodes the data in as a length value under the specified encoding rules. + + + The decoded value of the length, or if the encoded length represents the indefinite length. + + + This method only processes the length portion of an ASN.1/BER Tag-Length-Value triplet, so needs to have already sliced off the encoded tag. + + + is not a known value. + + does not decode as a length under the specified encoding rules. @@ -1165,13 +1178,28 @@ The contents are not valid under the current encoding rules. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. + The buffer containing encoded data. + The encoding constraints to use when interpreting the data. + + When this method returns, the decoded value of the length, or if the encoded length represents the indefinite length. + This parameter is treated as uninitialized. + + + When this method returns, the number of bytes from the beginning of that contributed to the length. + This parameter is treated as uninitialized. + + + Attempts to decode the data in as a length value under the specified encoding rules. + + + + if the buffer represents a valid length under the specified encoding rules; otherwise, + + + This method only processes the length portion of an ASN.1/BER Tag-Length-Value triplet, so needs to have already sliced off the encoded tag. + + + is not a known value. From 3f3b0fdaab2c0a0357543ea2f1bf540306cfa797 Mon Sep 17 00:00:00 2001 From: Jeremy Barton Date: Wed, 16 Oct 2024 09:08:32 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- xml/System.Formats.Asn1/AsnDecoder.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/System.Formats.Asn1/AsnDecoder.xml b/xml/System.Formats.Asn1/AsnDecoder.xml index b8844952602..c5cb1a00042 100644 --- a/xml/System.Formats.Asn1/AsnDecoder.xml +++ b/xml/System.Formats.Asn1/AsnDecoder.xml @@ -46,7 +46,7 @@ The buffer containing encoded data. The encoding constraints to use when interpreting the data. - When this method returns, the number of bytes from the beginning of that contributed to the length. + When this method returns, contains the number of bytes from the beginning of that contributed to the length. This parameter is treated as uninitialized. @@ -1181,11 +1181,11 @@ The contents are not valid under the current encoding rules. The buffer containing encoded data. The encoding constraints to use when interpreting the data. - When this method returns, the decoded value of the length, or if the encoded length represents the indefinite length. + When this method returns, contains the decoded value of the length, or if the encoded length represents the indefinite length. This parameter is treated as uninitialized. - When this method returns, the number of bytes from the beginning of that contributed to the length. + When this method returns, contains the number of bytes from the beginning of that contributed to the length. This parameter is treated as uninitialized.