Index: trunk/eraser/Eraser.Util/MiniDump.cs
===================================================================
--- trunk/eraser/Eraser.Util/MiniDump.cs	(revision 1976)
+++ trunk/eraser/Eraser.Util/MiniDump.cs	(revision 1976)
@@ -0,0 +1,53 @@
+﻿/* 
+ * $Id$
+ * Copyright 2008-2010 The Eraser Project
+ * Original Author: Joel Low <lowjoel@users.sourceforge.net>
+ * Modified By:
+ * 
+ * This file is part of Eraser.
+ * 
+ * Eraser is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * 
+ * A copy of the GNU General Public License can be found at
+ * <http://www.gnu.org/licenses/>.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using System.IO;
+
+namespace Eraser.Util
+{
+	public static class MiniDump
+	{
+		/// <summary>
+		/// Dumps an application minidump of the current process to the provided stream.
+		/// </summary>
+		/// <param name="stream">The stream to write the minidump to.</param>
+		public static void Dump(FileStream stream)
+		{
+			//Store the exception information
+			NativeMethods.MiniDumpExceptionInfo exception =
+				new NativeMethods.MiniDumpExceptionInfo();
+			exception.ClientPointers = false;
+			exception.ExceptionPointers = Marshal.GetExceptionPointers();
+			exception.ThreadId = (uint)AppDomain.GetCurrentThreadId();
+
+			NativeMethods.MiniDumpWriteDump(Process.GetCurrentProcess().Handle,
+				(uint)Process.GetCurrentProcess().Id, stream.SafeFileHandle,
+				NativeMethods.MiniDumpType.MiniDumpWithFullMemory,
+				ref exception, IntPtr.Zero, IntPtr.Zero);
+		}
+	}
+}
Index: trunk/eraser/Eraser.Util/Eraser.Util.csproj
===================================================================
--- trunk/eraser/Eraser.Util/Eraser.Util.csproj	(revision 1975)
+++ trunk/eraser/Eraser.Util/Eraser.Util.csproj	(revision 1976)
@@ -105,4 +105,5 @@
     <Compile Include="FileSize.cs" />
     <Compile Include="Logger.cs" />
+    <Compile Include="MiniDump.cs" />
     <Compile Include="NativeMethods\DbgHelp.cs" />
     <Compile Include="NativeMethods\Mpr.cs" />
Index: trunk/eraser/Eraser.BlackBox/BlackBox.cs
===================================================================
--- trunk/eraser/Eraser.BlackBox/BlackBox.cs	(revision 1975)
+++ trunk/eraser/Eraser.BlackBox/BlackBox.cs	(revision 1976)
@@ -170,14 +170,5 @@
 			{
 				//Store the exception information
-				NativeMethods.MiniDumpExceptionInfo exception =
-					new NativeMethods.MiniDumpExceptionInfo();
-				exception.ClientPointers = false;
-				exception.ExceptionPointers = Marshal.GetExceptionPointers();
-				exception.ThreadId = (uint)AppDomain.GetCurrentThreadId();
-
-				NativeMethods.MiniDumpWriteDump(Process.GetCurrentProcess().Handle,
-					(uint)Process.GetCurrentProcess().Id, stream.SafeFileHandle,
-					NativeMethods.MiniDumpType.MiniDumpWithFullMemory,
-					ref exception, IntPtr.Zero, IntPtr.Zero);
+				MiniDump.Dump(stream);
 			}
 		}
