title: why CreateDIBSection() fails with certian BITMAPINFO?
body: <p>I am trying to use <code>CreateDIBSection</code>.</p>
  
  <p>Problem:</p>
  
  <p>In Windows XP, I tried to call <code>CreateDIBSection</code>, it returns <code>NULL</code> and <code>GetLastError</code> = 0</p>
  
  <p>When I try to change the screen resolution, for example to 2048 x 1536, it returns correct value. </p>
  
  <p>I have tested this function has some relationship with <code>nMemSize</code> (not necessarily small number).</p>
  
  <p>Question:</p>
  
  <p>Is there any guarantee way to ensure <code>CreateDIBSection</code> returns correct value?</p>
  
  <pre><code>nScreenWidth = 1024;
  nScreenHeight= 768;
   = nScreenWidth*nScreenHeight*3*7
  HDC hdc = ::GetDC(hWnd);
  m_hBmpMapFile = ::CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, nMemSize, NULL);
  
  BITMAPINFO bmpInfo = {0};
  bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
  bmpInfo.bmiHeader.biWidth = nScreenWidth;
  bmpInfo.bmiHeader.biHeight = nScreenHeight;
  bmpInfo.bmiHeader.biPlanes = 1;
  bmpInfo.bmiHeader.biBitCount = 24;
  bmpInfo.bmiHeader.biCompression = 0;
  bmpInfo.bmiHeader.biSizeImage = nMemSize;
  bmpInfo.bmiHeader.biXPelsPerMeter = 0;
  bmpInfo.bmiHeader.biYPelsPerMeter = 0;
  bmpInfo.bmiHeader.biClrUsed = 0;
  bmpInfo.bmiHeader.biClrImportant = 0;
  bmpInfo.bmiColors[0].rgbBlue = 204;
  bmpInfo.bmiColors[0].rgbGreen = 204;
  bmpInfo.bmiColors[0].rgbRed = 204;
  bmpInfo.bmiColors[0].rgbReserved = 0;
  PVOID pvBits;
  
  m_hBmpAllWstDskWallpaper = ::CreateDIBSection(hdc, &amp;bmpInfo, DIB_RGB_COLORS, &amp;pvBits, m_hBmpMapFile, 0); 
  </code></pre>