title: UnsafeNativeMethods in my c# winforms call stack
body: <p>I noticed the following in my call stack and wondered what things I need to be vary of.</p>
  
  <p>I am using a <code>ToolStrip</code> item click event to fire the code.  I find that VS2012 regularly locks up when I try to debug.</p>
  
  <blockquote>
    <p>System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) + 0x681 bytes</p>
  </blockquote>
  
  <p>The whole stack is </p>
  
  <blockquote>
    <p>SBD.Syrius.UI.exe!SBD.Syrius.UI.Logs.LogListForm.MyActivate() Line 35  C#
    SBD.Syrius.UI.exe!SBD.Syrius.UI.MdiController.ActivateForm(SBD.Syrius.UI.baseFeature feature, SBD.Syrius.DomainClasses.FormMode mode) Line 178 + 0x18 bytes C#
            SBD.Syrius.UI.exe!SBD.Syrius.UI.MdiController.LoadFeature(SBD.Syrius.DomainClasses.FeatureType featurenum) Line 283 + 0x49 bytes    C#
            SBD.Syrius.UI.exe!SBD.Syrius.UI.Helpers.MainMenuHelper.LoadFeature(SBD.Syrius.DomainClasses.FeatureType featureType) Line 256 + 0x33 bytes  C#
            SBD.Syrius.UI.exe!SBD.Syrius.UI.Helpers.MainMenuHelper.ConfigureToolbar.AnonymousMethod__4() Line 41 + 0xf bytes    C#
            SBD.Syrius.UI.exe!SBD.Syrius.UI.Helpers.MainMenuHelper.CreateToolStripButton.AnonymousMethod__5(object s, System.EventArgs e) Line 67 + 0x20 bytes  C#
            System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.HandleClick(System.EventArgs e) + 0xb6 bytes<br>
            System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.HandleMouseUp(System.Windows.Forms.MouseEventArgs e) + 0x237 bytes<br>
            System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.OnMouseUp(System.Windows.Forms.MouseEventArgs mea) + 0xef bytes 
            System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0x48b bytes 
            System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0xe14 bytes 
            System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.WndProc(ref System.Windows.Forms.Message m) + 0x8c bytes<br>
            System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) + 0x14c bytes<br>
            [Native to Managed Transition]<br>
            [Managed to Native Transition]<br>
            System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) + 0x681 bytes<br>
            System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) + 0x57c bytes<br>
            System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x6f bytes<br>
            SBD.Syrius.UI.exe!SBD.Syrius.UI.Program.Main(string[] args) Line 55 + 0x9 bytes C#
            [Native to Managed Transition]<br>
            [Managed to Native Transition]<br>
            mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext, string[] activationCustomData) + 0x66 bytes 
            Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() + 0x8d bytes<br>
            mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x285 bytes 
            mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x9 bytes<br>
            mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x57 bytes<br>
            mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x51 bytes<br>
            [Native to Managed Transition]  </p>
  </blockquote>