title: RAWINPUT strange behaviour
body: <p>I'm having some strange behaviour with RAWINPUT. The following code below WORKS:</p>
  
  <pre><code>case WM_INPUT:
  {
       UINT rawInputSize;
  
       GetRawInputData((HRAWINPUT)(lParam), RID_INPUT, nullptr, &amp;rawInputSize, sizeof(RAWINPUTHEADER));
  
       LPBYTE inputBuffer = new BYTE[rawInputSize];
  
       GetRawInputData((HRAWINPUT)(lParam), RID_INPUT, inputBuffer, &amp;rawInputSize, sizeof(RAWINPUTHEADER));
  
       RAWINPUT* inp = (RAWINPUT*)inputBuffer;   // valid
  }
  </code></pre>
  
  <p>But the following does NOT WORK:</p>
  
  <pre><code>case WM_INPUT:
  {
       UINT rawInputSize;
       BYTE inputBuffer[40];
  
       GetRawInputData((HRAWINPUT)(lParam), RID_INPUT, inputBuffer, &amp;rawInputSize, sizeof(RAWINPUTHEADER));        // returns error code
  
       RAWINPUT* inp = (RAWINPUT*)inputBuffer;
  }
  </code></pre>
  
  <p>Nor:</p>
  
  <pre><code>case WM_INPUT:
  {
       UINT rawInputSize;
       RAWINPUT inputBuffer;
  
       GetRawInputData((HRAWINPUT)(lParam), RID_INPUT, &amp;inputBuffer, &amp;rawInputSize, sizeof(RAWINPUTHEADER));      // returns error code
  }
  </code></pre>
  
  <p>Both fails at <code>GetRawInputData()</code> which returns a general error code (with no details).</p>
  
  <p>The working solution I posted first is not an option, I cannot do heap allocation at every keystroke or mouse action, I must use the stack.</p>
  
  <p>Why does the two last fail?</p>