Ldlocarect

call int32 GetWindowRect(valuetype HWND_*, valuetype tagRECT*)

The value of rect.right is retrieved indirectly. First, the address of rect.right is calculated by adding the offset of right in the RECT structure to the address of the rect variable. In this case, the offset of right in the RECT structure is 8, because right is the third of the four LONG variables, which implies that two variables of 4 bytes are located before right. After determining the address, the ldind.i4 instruction uses this address to load the rect.right value:

ldloca rect ldc.i4 8

add ldind.i4

For the rect.bottom variable, the same approach is used. Here, the offset is 12 because bottom is the last of the four LONG variables in the RECT structure:

ldloca rect ldc.i4 12

add ldind.i4

Was this article helpful?

0 0

Post a comment