Skip to content

Commit e51e9d2

Browse files
committed
Feedback
1 parent 83cd83d commit e51e9d2

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/applicationinfo.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
#include "applicationinfo.h"
55

6-
#include "rpcdce.h"
7-
#include "Rpc.h"
86
#include "proxymodule.h"
97
#include "HostFxrResolver.h"
108
#include "debugutil.h"
@@ -93,7 +91,7 @@ APPLICATION_INFO::CreateApplication(IHttpContext& pHttpContext)
9391
m_pApplication = make_application<ServerErrorApplication>(
9492
pHttpApplication,
9593
E_FAIL,
96-
false /* disableStartupPage */,
94+
options.QueryDisableStartupPage() /* disableStartupPage */,
9795
"" /* responseContent */,
9896
503i16 /* statusCode */,
9997
0i16 /* subStatusCode */,
@@ -192,7 +190,7 @@ APPLICATION_INFO::TryCreateApplication(IHttpContext& pHttpContext, const ShimOpt
192190
}
193191
}
194192

195-
std::filesystem::path shadowCopyPath = HandleShadowCopy(options, pHttpContext);
193+
auto shadowCopyPath = HandleShadowCopy(options, pHttpContext);
196194

197195
RETURN_IF_FAILED(m_handlerResolver.GetApplicationFactory(*pHttpContext.GetApplication(), shadowCopyPath, m_pApplicationFactory, options, error));
198196
LOG_INFO(L"Creating handler application");
@@ -253,7 +251,7 @@ APPLICATION_INFO::ShutDownApplication(const bool fServerInitiated)
253251
m_pApplicationFactory = nullptr;
254252
}
255253

256-
std::wstring
254+
std::filesystem::path
257255
APPLICATION_INFO::HandleShadowCopy(const ShimOptions& options, IHttpContext& pHttpContext)
258256
{
259257
std::filesystem::path shadowCopyPath;
@@ -289,11 +287,12 @@ APPLICATION_INFO::HandleShadowCopy(const ShimOptions& options, IHttpContext& pHt
289287
{
290288
try
291289
{
292-
int intFileName = std::stoi(entry.path().filename().string());
290+
auto tempDirName = entry.path().filename().string();
291+
int intFileName = std::stoi(tempDirName);
293292
if (intFileName > directoryName)
294293
{
295294
directoryName = intFileName;
296-
directoryNameStr = entry.path().filename().string();
295+
directoryNameStr = tempDirName;
297296
}
298297
}
299298
catch (...)

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/applicationinfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class APPLICATION_INFO: NonCopyable
7979
HRESULT
8080
TryCreateApplication(IHttpContext& pHttpContext, const ShimOptions& options, ErrorContext& error);
8181

82-
std::wstring
82+
std::filesystem::path
8383
HandleShadowCopy(const ShimOptions& options, IHttpContext& pHttpContext);
8484

8585
IHttpServer &m_pServer;

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ IN_PROCESS_APPLICATION::StopClr()
8181

8282
const auto waitResult = WaitForMultipleObjects(2, waitHandles, FALSE, m_pConfig->QueryShutdownTimeLimitInMS());
8383

84+
// If waitResults != WAIT_OBJECT_0 + 1, it means main hasn't returned, so okay to call into it.
8485
if (!m_blockManagedCallbacks && waitResult != WAIT_OBJECT_0 + 1)
8586
{
8687
// We cannot call into managed if the dll is detaching from the process.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": true,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:5762/",
7+
"sslPort": 0
8+
}
9+
},
10+
"profiles": {
11+
"ANCM IIS Express": {
12+
"commandName": "Executable",
13+
"executablePath": "$(IISExpressPath)",
14+
"commandLineArgs": "$(IISExpressArguments)",
15+
"environmentVariables": {
16+
"IIS_SITE_PATH": "$(MSBuildThisFileDirectory)",
17+
"ANCMV2_PATH": "$(AspNetCoreModuleV2ShimDll)",
18+
"ASPNETCORE_MODULE_OUTOFPROCESS_HANDLER": "$(AspNetCoreModuleV2OutOfProcessHandlerDll)",
19+
"LAUNCHER_ARGS": "$(TargetPath)",
20+
"ASPNETCORE_ENVIRONMENT": "Development",
21+
"LAUNCHER_PATH": "$(DotNetPath)",
22+
"ASPNETCORE_MODULE_DEBUG": "console"
23+
}
24+
},
25+
"ANCM IIS": {
26+
"commandName": "Executable",
27+
"executablePath": "$(IISPath)",
28+
"commandLineArgs": "$(IISArguments)",
29+
"environmentVariables": {
30+
"IIS_SITE_PATH": "$(MSBuildThisFileDirectory)",
31+
"ANCMV2_PATH": "$(AspNetCoreModuleV2ShimDll)",
32+
"ASPNETCORE_MODULE_OUTOFPROCESS_HANDLER": "$(AspNetCoreModuleV2OutOfProcessHandlerDll)",
33+
"LAUNCHER_ARGS": "$(TargetPath)",
34+
"ASPNETCORE_ENVIRONMENT": "Development",
35+
"LAUNCHER_PATH": "$(DotNetPath)",
36+
"ASPNETCORE_MODULE_DEBUG": "console"
37+
}
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)