title: How to find what is causing heap corruption (error 0xC0000374) in my Windows Store C# app?
body: <p>My Win8 app started crashing out of blue due to a native exception. I then enabled the mixed (native + managed) debugger mode in VS and noticed the following:</p>
  
  <ul>
  <li>Before the app crashes, I get in the Output toolwindow the following message: <em>Critical error detected c0000374</em>.</li>
  <li>Then I get an <em>Unhandled exception at 0x77DFAA3C (ntdll.dll) in MyApp.exe: 0xC0000374: A heap has been corrupted (parameters: 0x77E0FE38).</em></li>
  <li>When the debugger breaks, I get a "source not available" message and the stack trace info is not useful. </li>
  </ul>
  
  <p>This seems to happen only when a Storyboard is running but that's just a wild guess. <strong>Any ideas how to rootcause what is causing the heap corruption?</strong></p>
  
  <p>PS: not sure if this is related at all, but I also noticed the following messages in the Output toolwindow before the heap corruption problem happens:</p>
  
  <ul>
  <li>First-chance exception at 0x75A84B32 (KernelBase.dll) in MyApp.exe:
  0x40080201: WinRT originate error (parameters: 0x80004005,
  0x00000026, 0x14E8F4F4).</li>
  <li>First-chance exception at 0x75A84B32
  (KernelBase.dll) in MyApp.exe: 0x40080201: WinRT originate error
  (parameters: 0x80070490, 0x00000064, 0x05FFED2C). First-chance
  exception at 0x75A84B32 (KernelBase.dll) in MyApp.exe: 0x40080202:
  WinRT transform error (parameters: 0x80070490, 0x00000000,
  0x0000001D, 0x05FFED58).</li>
  <li>First-chance exception at 0x75A84B32 in
  MyApp.exe: Microsoft C++ exception: EEMessageException at memory
  location 0x05FFD4F4.</li>
  </ul>
  
  <p>Thanks!</p>