// D import file generated from '../../../../libphobos/libdruntime/core/sys/windows/stacktrace.d'
module core.sys.windows.stacktrace;
version (Windows)
{
	import core.demangle;
	import core.runtime;
	import core.stdc.stdlib;
	import core.stdc.string;
	import core.sys.windows.dbghelp;
	import core.sys.windows.windows;
	debug (PRINTF)
	{
		import core.stdc.stdio;
	}
	extern (Windows) void RtlCaptureContext(CONTEXT* ContextRecord);

	extern (Windows) DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR pBuffer, DWORD nSize);

	private immutable __gshared bool initialized;


	class StackTrace : Throwable.TraceInfo
	{
		public 
		{
			this();
			const int opApply(scope int delegate(ref const(char[])) dg);
			const int opApply(scope int delegate(ref size_t, ref const(char[])) dg);
			override @safe const pure nothrow string toString();

			private 
			{
				char[][] m_trace;
				static char[][] trace();

				static char[][] traceNoSync();

				static char[] formatStackFrame(void* pc);

				static char[] formatStackFrame(void* pc, char* symName);

				static char[] formatStackFrame(void* pc, char* symName, in char* fileName, uint lineNum);

			}
		}
	}
	extern (Windows) BOOL FixupDebugHeader(HANDLE hProcess, ULONG ActionCode, ulong CallbackContext, ulong UserContext);

	private string generateSearchPath();

	shared static this();
}
