<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">I was reading the source code of the file <a href="https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/GetImage.c">GetImage.c</a> and got confused about the function XGetImage. Specifically, I'm confused about where the defined variable <span class="ydpabe48625k" style="white-space: pre-wrap;">register</span><span style="white-space: pre-wrap;"> </span><font color="#cd232c"><span class="ydpabe48625n" style="white-space: pre-wrap;">xGetImageReq</span><span style="white-space: pre-wrap;"> </span><span class="ydpabe48625o" style="white-space: pre-wrap;">*</span><span class="ydpabe48625n" style="white-space: pre-wrap;">req</span></font><span class="ydpabe48625p" style="white-space: pre-wrap;"><font color="#cd232c" style="background-color: inherit;">;</font> is used. The function never uses it again after setting values for req at <a href="https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/GetImage.c#L83" class="enhancr_card_8133735669">line 83</a></span>. At <a href="https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/GetImage.c#L85" class="enhancr_card_7849055715">line 85</a>, does the function _XReply copy the whole display/screen's data to rep or just the specified rectangle defined by req? If _XReply copies the whole display/screen's data, where does the function XGetImage crop the image to keep the specified rectangle only? </div><div dir="ltr" data-setdir="false"><div><pre class="ydpabe48625code ydpabe48625highlight" lang="c"><span id="ydpabe48625LC68" class="ydpabe48625line" lang="c"></span></pre></div></div><div><br></div><div><br></div><div><br></div><div><br></div></div></body></html>