From 9d064b24c7a358b1ed12899bc36c541a934cd1e6 Mon Sep 17 00:00:00 2001 From: pan-wang Date: Wed, 14 Mar 2018 14:29:25 -0700 Subject: [PATCH] enable debug print in aspnetcore.dll (#663) --- src/AspNetCore/Src/dllmain.cpp | 12 ++++++++++++ src/CommonLib/aspnetcoreconfig.cxx | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/AspNetCore/Src/dllmain.cpp b/src/AspNetCore/Src/dllmain.cpp index 41a4b4bd7c..2e4f87e542 100644 --- a/src/AspNetCore/Src/dllmain.cpp +++ b/src/AspNetCore/Src/dllmain.cpp @@ -143,6 +143,18 @@ HRESULT fDisableANCM = (dwData != 0); } + cbData = sizeof(dwData); + if ((RegQueryValueEx(hKey, + L"DebugFlags", + NULL, + &dwType, + (LPBYTE)&dwData, + &cbData) == NO_ERROR) && + (dwType == REG_DWORD)) + { + g_dwAspNetCoreDebugFlags = dwData; + } + RegCloseKey(hKey); } diff --git a/src/CommonLib/aspnetcoreconfig.cxx b/src/CommonLib/aspnetcoreconfig.cxx index 1cc53416b5..97a7d0c63e 100644 --- a/src/CommonLib/aspnetcoreconfig.cxx +++ b/src/CommonLib/aspnetcoreconfig.cxx @@ -3,6 +3,7 @@ #include "stdafx.h" #include "aspnetcoreconfig.h" +#include "debugutil.h" ASPNETCORE_CONFIG::~ASPNETCORE_CONFIG() { @@ -135,6 +136,8 @@ ASPNETCORE_CONFIG::GetConfig( } else { + DebugPrintf(ASPNETCORE_DEBUG_FLAG_INFO, + "ASPNETCORE_CONFIG::GetConfig, set config to ModuleContext"); // set appliction info here instead of inside Populate() // as the destructor will delete the backend process hr = pAspNetCoreConfig->QueryApplicationPath()->Copy(pHttpApplication->GetApplicationId());