title: LOWORD and HIWORD operations
body: <p>I've come into contact with some weird notation in a C++ program. I'm dealing with bit shifting and I came across the LOWORD() and HIWORD() functions. I understand that LOWORD is the value of the lower 2 bytes of an integer. I also know that HIWORD is the higher 2 byes of that integer. However, I came into contact with a code snippet which looked something like this:</p>
  
  <pre><code>#define LOWORD(l)           ((WORD)(((DWORD_PTR)(l)) &amp; 0xffff))
  #define HIWORD(l)           ((WORD)((((DWORD_PTR)(l)) &gt;&gt; 16) &amp; 0xffff))
  
  int v1 = 0x12343460;
  int v2 = 0x11111111;
  HIWORD(v2) = HIWORD(v1);
  LOWORD(v1) = LOWORD(v2);
  </code></pre>
  
  <p>From what it appears, it looks as though the programmer is suggesting to place the value of one function into another function. However, that seems impossible without some serious programmer magic. Any help whatsoever in decrypting this code snippet would be greatly appreciated. </p>