<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">David,<o:p></o:p></p>
<p class="MsoNormal">We have completed our investigation on this issue regarding server handling of SMB2 FSCTL_SRV_COPYCHUNK overlapping ranges. As a result a future release of MS-SMB2 will include the following updates.<o:p></o:p></p>
<p class="MsoNormal">The attached pdf to this email contains the changes with highlights of the updates.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Provisional MS-SMB2 changes<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:0in;text-indent:-9.35pt;page-break-after:avoid">
<b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">3.3.1.10 Per Open<o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">Open.ResumeKey</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">: A 24-byte key that
identifies a source file in Server side Data Copy Operation.</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:0in;text-indent:-9.35pt;page-break-after:avoid">
<b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">3.3.5.15.5 Handling a Source File Key Request<o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#1F497D">…<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST provide a 24-byte value that is used to uniquely identify the open. The server SHOULD use
<b>Open.DurableFileId</b>, or alternately, MAY use an internally generated value that is unique for all opens on the server.</span><a href="#z782"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#0066FF"><283></span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">The
server MUST set <b>Open.ResumeKey</b> and <b>ResumeKey</b> in SRV_REQUEST_RESUME_KEY Response to the generated value.</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:0in;text-indent:-9.35pt;page-break-after:avoid">
<b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">3.3.5.15.6 Handling a Server-Side Data Copy Request<o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<a name="z783"></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">When the server receives a request with an
</span><a href="#z5cd6452260b34f3ea157fe66f1228052"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SMB2 header</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> with a
<b>Command</b> value equal to SMB2 IOCTL, and a <b>CtlCode</b> of FSCTL_SRV_COPYCHUNK or FSCTL_SRV_COPYCHUNK_WRITE, message handling proceeds as follows:<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST locate the source open from where data will be read by locating the open
<span style="background:yellow;mso-highlight:yellow">where <b>Open.ResumeKey</b> matches
<b>SourceKey</b></span><span style="color:red"> </span>received in the </span><a href="#z1c91ae6146ad4953805fafc06ce4c70b"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SRV_COPYCHUNK_COPY</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">
structure received in the buffer described by <b>InputCount</b> and <b>InputOffset</b> of the
</span><a href="#z5c03c9d615de48a298358fb37f8a79d8"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SMB2 IOCTL Request</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">. If the open is not found, the server MUST fail
the request with STATUS_OBJECT_NAME_NOT_FOUND.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">If<b> OutputCount</b> in SMB2 IOCTL request is less than the size of SRV_COPYCHUNK_RESPONSE structure, the server MUST fail the SMB2 IOCTL request with STATUS_INVALID_PARAMETER.<b><o:p></o:p></b></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">If
<b>OutputCount</b> in SMB2 IOCTL request is greater or equal to the size of SRV_COPYCHUNK_RESPONSE structure and under any of the following conditions, the server MUST send an SMB2 IOCTL Response as specified in section 3.3.5.15.6.2:</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol;background:yellow;mso-highlight:yellow">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";background:yellow;mso-highlight:yellow">
</span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">InputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow"> in SMB2 IOCTL request
is less than the size of Buffer field containing SRV_COPYCHUNK_COPY structure<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol;background:yellow;mso-highlight:yellow">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";background:yellow;mso-highlight:yellow">
</span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">ChunkCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow"> is greater than
<b>ServerSideCopyMaxNumberofChunks</b><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol;background:yellow;mso-highlight:yellow">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";background:yellow;mso-highlight:yellow">
</span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">Length</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow"> in a single chunk is
greater than <b>ServerSideCopyMaxChunkSize </b>or equal to zero<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol;background:yellow;mso-highlight:yellow">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";background:yellow;mso-highlight:yellow">
</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">Sum of
<b>Length</b>s in all chunks is greater than <b>ServerSideCopyMaxDataSize</b><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol;background:yellow;mso-highlight:yellow">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";background:yellow;mso-highlight:yellow">
</span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">TargetOffset
</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">in
<span style="color:#1F497D">any </span>chunk is <span style="color:#1F497D">less than zero but
</span>not equal to 0xFFFFFFFFFFFFFFFF.<b><o:p></o:p></b></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol;background:yellow;mso-highlight:yellow">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";background:yellow;mso-highlight:yellow">
</span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">Open.TreeConnect</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow"> of the source
or destination file is on a named pipe<span style="color:#1F497D"> filesystem</span><b><o:p></o:p></b></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">If <b>Open.GrantedAccess</b> of the destination file does not include FILE_WRITE_DATA
<span style="background:yellow;mso-highlight:yellow">or FILE_APPEND_DATA</span>, then the request MUST be failed with STATUS_ACCESS_DENIED. If
<b>Open.GrantedAccess</b> of the <span style="background:yellow;mso-highlight:yellow">
source</span> file does not include FILE_READ_DATA access, then the request MUST be failed with STATUS_ACCESS_DENIED.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">If <b>Open.TreeConnect.Session</b> of the destination file is not equal to
<b>Open.TreeConnect.Session</b> of the source file, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">Starting with the first chunk received in the Chunks field and for each chunk, the server MUST apply the following processing rules:</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif""> </span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST issue a read using the
<b>SourceOffset</b> and <b>Length</b> from the source file.</span><a href="#z785"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><284></span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> If the
<b>SourceOffset</b> or <b>SourceOffset</b> + <b>Length</b> extends beyond the end of file, the server SHOULD</span><a href="#z787"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><285></span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">
treat this as a STATUS_END_OF_FILE error. If the read fails, the server MUST map the error code returned to a valid status code as described in section
</span><a href="#z6eaf6e759c234edabe99c9223c60b181"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, and MUST send an SMB2 IOCTL response as specified in
</span><a href="#z27659167b3b74925a589710f96b20ea6"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">Sending a Copy Failure Server-Side Copy Response (section
</span></a><a href="#z27659167b3b74925a589710f96b20ea6"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">3.3.5.15.6.1</span></a><a href="#z27659167b3b74925a589710f96b20ea6"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">)</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:.5in;text-indent:-.25in">
<span style="font-size:9.0pt;font-family:Symbol">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif"">
</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";background:yellow;mso-highlight:yellow">If the read operation is successful,</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> the server MUST issue a write
<span style="background:yellow;mso-highlight:yellow">of the data read</span> using the
<b>TargetOffset</b> and <b>Length</b> in the range against the destination file.</span><a href="#z789"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""><286></span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> If the
write fails, the server MUST send an SMB2 IOCTL response as specified in Sending a Copy Failure Server-Side Copy Response (section 3.3.5.15.6.1).<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">If all ranges are copied successfully, the server MUST construct an SMB2 IOCTL Response following the syntax specified in the section
</span><a href="#zf70eccb6e1be4db89c479ac86ef18dbb"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2.32</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, with the following values:<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">CtlCode</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to FSCTL_SRV_COPYCHUNK or FSCTL_SRV_COPYCHUNK_WRITE.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">FileId.Persistent</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<b>Open.DurableFileId</b>. <b>FileId.Volatile</b> MUST be set to <b>Open.FileId</b>.
<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">InputOffset</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> SHOULD be set to the offset, in bytes, from
the beginning of the SMB2 header to the <b>Buffer[]</b> field of the response.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">InputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> SHOULD be set to zero.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">OutputOffset</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<b>InputOffset</b> + <b>InputCount</b>, rounded up to a multiple of 8.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">OutputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to 12.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">Flags</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to zero.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST copy a
</span><a href="#z80d85df3a4dc4418ac7e93dd67e423e9"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SRV_COPYCHUNK_RESPONSE</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> following the syntax specified in section
</span><a href="#z80d85df3a4dc4418ac7e93dd67e423e9"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2.32.1</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> into the
<b>Buffer</b> field at the <b>OutputOffset</b> computed above. <b>ChunksWritten</b> MUST be set to the number of chunks processed.
<b>ChunkBytesWritten</b> MUST be set to zero. <b>TotalBytesWritten</b> MUST be set to the total number of bytes written to the destination file across all chunk writes.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The response MUST be sent to the client.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:0in;text-indent:-9.35pt;page-break-after:avoid">
<a name="_Toc343220645"><b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">3.3.5.15.6.1 Sending a Copy Failure Server-Side Copy Response</span></b></a><b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<a name="z790"></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">If a range is encountered that is not copied successfully, the server MUST construct an
</span><a href="#zf70eccb6e1be4db89c479ac86ef18dbb"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SMB2 IOCTL Response</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> following the syntax specified in section
</span><a href="#zf70eccb6e1be4db89c479ac86ef18dbb"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2.32</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, with the following values:<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">Status</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> in the
</span><a href="#z5cd6452260b34f3ea157fe66f1228052"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SMB2 header</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<span style="background:yellow;mso-highlight:yellow">the error returned during processing specified in section 3.3.5.15.6</span>.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">CtlCode</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<span style="background:yellow;mso-highlight:yellow">the CtlCode in SMB2 IOCTL Request</span>.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">FileId.Persistent</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<b>Open.DurableFileId</b>. <b>FileId.Volatile</b> MUST be set to <b>Open.FileId</b>.
<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">InputOffset</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> SHOULD be set to the offset, in bytes, from
the beginning of the SMB2 header to the <b>Buffer[]</b> field of the response.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">InputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> SHOULD be set to zero.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">OutputOffset</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<b>InputOffset</b> + <b>InputCount</b>, rounded up to a multiple of 8.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">OutputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to 12.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">Flags</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to zero.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST copy a
</span><a href="#z80d85df3a4dc4418ac7e93dd67e423e9"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SRV_COPYCHUNK_RESPONSE</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> following the syntax specified in section
</span><a href="#z80d85df3a4dc4418ac7e93dd67e423e9"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2.32.1</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> into the
<b>Buffer</b> field at the <b>OutputOffset</b> computed above. <b>ChunksWritten</b> MUST be set to the number of chunks successfully written. If the error was encountered partway through a write,
<b>ChunkBytesWritten</b> MUST be set to the number of bytes written in the final, partial write. Otherwise,
<b>ChunkBytesWritten</b> MUST be set to 0. <b>TotalBytesWritten</b> MUST be set to the total number of bytes written to the destination file across all chunk writes.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The response MUST be sent to the client.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:0in;text-indent:-9.35pt;page-break-after:avoid">
<a name="_Toc343220646"><b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">3.3.5.15.6.2 Sending an Invalid Parameter Server-Side Copy Response</span></b></a><b><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<a name="z791"></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST construct an
</span><a href="#zf70eccb6e1be4db89c479ac86ef18dbb"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SMB2 IOCTL Response</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, following the syntax specified in section
</span><a href="#zf70eccb6e1be4db89c479ac86ef18dbb"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2.32</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, with the following values:<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">Status</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> in the
</span><a href="#z5cd6452260b34f3ea157fe66f1228052"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SMB2 header</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to STATUS_INVALID_PARAMETER.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">CtlCode</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<span style="background:yellow;mso-highlight:yellow">the</span> <span style="background:yellow;mso-highlight:yellow">
CtlCode in SMB2 IOCTL Request</span>.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">FileId.Persistent</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<b>Open.DurableFileId</b>. <b>FileId.Volatile</b> MUST be set to <b>Open.FileId</b>.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">InputOffset</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> SHOULD be set to the offset, in bytes, from
the beginning of the SMB2 header to the <b>Buffer[]</b> field of the response.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">InputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> SHOULD be set to zero.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">OutputOffset</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to
<b>InputOffset</b> + <b>InputCount</b>, rounded up to a multiple of 8.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">OutputCount</span></b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif""> MUST be set to 12.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">Flags MUST be set to zero.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:13.7pt;text-indent:-13.7pt">
<span style="font-size:9.0pt;font-family:Wingdings">§ </span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The server MUST copy a
</span><a href="#z80d85df3a4dc4418ac7e93dd67e423e9"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">SRV_COPYCHUNK_RESPONSE</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, following the syntax specified in section
</span><a href="#z80d85df3a4dc4418ac7e93dd67e423e9"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">2.2.32.1</span></a><span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">, into the
<b>Buffer</b> field at the <b>OutputOffset</b> computed above, with the following differences.
<b>ChunksWritten</b> MUST be set <b>ServerSideCopyMaxNumberofChunks</b>. <b>ChunkBytesWritten</b> MUST be set
<b>ServerSideCopyMaxChunkSize</b>. <b>TotalBytesWritten</b> MUST be set to <b>ServerSideCopyMaxDataSize</b>.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in">
<span style="font-size:9.0pt;font-family:"Verdana","sans-serif"">The response MUST be sent to the client.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Edgar<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: Edgar Olougouna <br>
Sent: Monday, December 03, 2012 2:19 PM<br>
To: David Disseldorp<br>
Cc: cifs-protocol@cifs.org; pfif@tridgell.net; MSSolve Case Email<br>
Subject: RE: [REG:112120310051084] FSCTL_SRV_COPYCHUNK overlapping ranges</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">David,<o:p></o:p></p>
<p class="MsoPlainText">I will investigate this and follow-up.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Thanks,<o:p></o:p></p>
<p class="MsoPlainText">Edgar<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<o:p></o:p></p>
<p class="MsoPlainText">From: Obaid Farooqi <o:p></o:p></p>
<p class="MsoPlainText">Sent: Monday, December 03, 2012 11:09 AM<o:p></o:p></p>
<p class="MsoPlainText">To: David Disseldorp<o:p></o:p></p>
<p class="MsoPlainText">Cc: <a href="mailto:cifs-protocol@cifs.org"><span style="color:windowtext;text-decoration:none">cifs-protocol@cifs.org</span></a>;
<a href="mailto:pfif@tridgell.net"><span style="color:windowtext;text-decoration:none">pfif@tridgell.net</span></a>; MSSolve Case Email<o:p></o:p></p>
<p class="MsoPlainText">Subject: RE:[REG:112120310051084] FSCTL_SRV_COPYCHUNK overlapping ranges<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Hi David:<o:p></o:p></p>
<p class="MsoPlainText">I have created a case to track this issue. A member of the open specification team will be in touch to further assist you soon.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Regards,<o:p></o:p></p>
<p class="MsoPlainText">Obaid Farooqi<o:p></o:p></p>
<p class="MsoPlainText">Escalation Engineer | Microsoft<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Exceeding your expectations is my highest priority. If you would like to provide feedback on your case you may contact my manager at nkang at Microsoft dot com<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<o:p></o:p></p>
<p class="MsoPlainText">From: David Disseldorp [<a href="mailto:ddiss@suse.de"><span style="color:windowtext;text-decoration:none">mailto:ddiss@suse.de</span></a>]<o:p></o:p></p>
<p class="MsoPlainText">Sent: Monday, December 03, 2012 6:48 AM<o:p></o:p></p>
<p class="MsoPlainText">To: Interoperability Documentation Help; <a href="mailto:cifs-protocol@cifs.org">
<span style="color:windowtext;text-decoration:none">cifs-protocol@cifs.org</span></a>;
<a href="mailto:pfif@tridgell.net"><span style="color:windowtext;text-decoration:none">pfif@tridgell.net</span></a><o:p></o:p></p>
<p class="MsoPlainText">Subject: FSCTL_SRV_COPYCHUNK overlapping ranges<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Hi DocHelp,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">FSCTL_SRV_COPYCHUNK requests may refer to overlapping file ranges. The handling of such requests is currently unclear from the documentation in [MS-SMB2] 3.3.5.15.6 Handling a Server-Side Data Copy Request.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I've outlined two such cases below, where the subsequent on disk state is dependent on specific server behaviour.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">1) An FSCTL_SRV_COPYCHUNK request includes two chunks (SRV_COPYCHUNK<o:p></o:p></p>
<p class="MsoPlainText"> records), where both specify a target range which overlaps with the<o:p></o:p></p>
<p class="MsoPlainText"> other.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Initial State<o:p></o:p></p>
<p class="MsoPlainText">-------------<o:p></o:p></p>
<p class="MsoPlainText"> File: src dest<o:p></o:p></p>
<p class="MsoPlainText"> Offset: 01234567 01234567<o:p></o:p></p>
<p class="MsoPlainText"> Data: ABCDEFGH abcdefgh<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Request<o:p></o:p></p>
<p class="MsoPlainText">-------<o:p></o:p></p>
<p class="MsoPlainText"> FSCTL_SRV_COPYCHUNK(dest)<o:p></o:p></p>
<p class="MsoPlainText"> SourceKey = SRV_REQUEST_RESUME_KEY(src)<o:p></o:p></p>
<p class="MsoPlainText"> ChunkCount = 2<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[0].SourceOffset = 0<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[0].TargetOffset = 0<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[0].Length = 4<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[1].SourceOffset = 4<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[1].TargetOffset = 0<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[1].Length = 4<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Resultant State<o:p></o:p></p>
<p class="MsoPlainText">---------------<o:p></o:p></p>
<p class="MsoPlainText"> File: src dest<o:p></o:p></p>
<p class="MsoPlainText"> Offset: 01234567 01234567<o:p></o:p></p>
<p class="MsoPlainText"> Data: ABCDEFGH EFGHefgh<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The resultant contents of dest is dependent on the order in which the chunks are processed. In the above example, Chunks[0] is written to disk before Chunks[1]. If the server where to process Chunks[1] before Chunks[0], then the resultant
data would be ABCDefgh. If the server where to dispatch both both IOs simultaneously (asynchronously) the resultant data would be undefined.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Windows (tested against Server 2008 & 2012) appears to always process chunks sequentially, starting at Chunks[0] and working its way up.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Is this order of processing required, such that a chunk with a higher index must overwrite data from chunks with a lesser array index?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">2) An FSCTL_SRV_COPYCHUNK request includes a single chunk, where the<o:p></o:p></p>
<p class="MsoPlainText"> source and target ranges overlap, and the SourceKey refers to the<o:p></o:p></p>
<p class="MsoPlainText"> same target file.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Initial State<o:p></o:p></p>
<p class="MsoPlainText">-------------<o:p></o:p></p>
<p class="MsoPlainText"> File: src_and_dest<o:p></o:p></p>
<p class="MsoPlainText"> Offset: 0123456789<o:p></o:p></p>
<p class="MsoPlainText"> Data: abcdefghij<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Request<o:p></o:p></p>
<p class="MsoPlainText">-------<o:p></o:p></p>
<p class="MsoPlainText"> FSCTL_SRV_COPYCHUNK(src_and_dest)<o:p></o:p></p>
<p class="MsoPlainText"> SourceKey = SRV_REQUEST_RESUME_KEY(src_and_dest)<o:p></o:p></p>
<p class="MsoPlainText"> ChunkCount = 1<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[0].SourceOffset = 0<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[0].TargetOffset = 4<o:p></o:p></p>
<p class="MsoPlainText"> Chunks[0].Length = 6<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Resultant State<o:p></o:p></p>
<p class="MsoPlainText">---------------<o:p></o:p></p>
<p class="MsoPlainText"> File: src_and_dest<o:p></o:p></p>
<p class="MsoPlainText"> Offset: 0123456789<o:p></o:p></p>
<p class="MsoPlainText"> Data: abcdabcdef<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The resultant contents of src_and_dest is dependent on the server's copy algorithm. In the above example, the server uses an IO buffer large enough to hold the entire six-byte source data before writing to TargetOffset. If the server
were to use a four-byte IO buffer and started reads/writes from the lowest offset, then the two overlapping bytes in the above example would be overwritten before being read. The resultant file contents would be abcdabcdab.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Windows 2008r2 appears to use a 2048 byte copy buffer, overlapping bytes after this offset are written before being read. Windows 2012 on the other hand appears to use a buffer large enough to hold its maximum supported chunk size (1M).<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Does Windows make any guarantees on what data will end up on disk when such a copychunk source/target overlap exists?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Regards, David<o:p></o:p></p>
<p class="MsoPlainText">Microsoft is committed to protecting your privacy. Please read the Microsoft Privacy Statement for more information.The above is an email for a support case from Microsoft Corp.REPLY ALL TO THIS MESSAGE or INCLUDE
<a href="mailto:casemail@microsoft.com"><span style="color:windowtext;text-decoration:none">casemail@microsoft.com</span></a> IN YOUR REPLY if you want your response added to the case automatically. For technical assistance, please include the Support Engineer
on the TO: line. Thank you.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
</body>
</html>