Use location of aspnetcore.dll rather than the activating process. (#500)

This commit is contained in:
Justin Kotalik 2018-01-03 11:49:43 -08:00 committed by GitHub
parent 119dee607b
commit 5d8670243c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 20 deletions

View File

@ -198,7 +198,7 @@ APPLICATION_INFO::FindRequestHandlerAssembly()
{ {
HRESULT hr = S_OK; HRESULT hr = S_OK;
BOOL fLocked = FALSE; BOOL fLocked = FALSE;
STACK_STRU(struFileName, 256); STACK_STRU(struFileName, 300); // >MAX_PATH
if (g_fAspnetcoreRHLoadedError) if (g_fAspnetcoreRHLoadedError)
{ {
@ -296,7 +296,7 @@ APPLICATION_INFO::FindNativeAssemblyFromGlobalLocation(STRU* struFilename)
// let's still load with full path to avoid security issue // let's still load with full path to avoid security issue
while (!fDone) while (!fDone)
{ {
DWORD dwReturnedSize = GetModuleFileName(NULL, struFilename->QueryStr(), dwSize); DWORD dwReturnedSize = GetModuleFileNameW(g_hModule, struFilename->QueryStr(), dwSize);
if (dwReturnedSize == 0) if (dwReturnedSize == 0)
{ {
hr = HRESULT_FROM_WIN32(GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());

View File

@ -141,15 +141,16 @@ HRESULT_FROM_GETLASTERROR()
: E_FAIL; : E_FAIL;
} }
extern PVOID g_pModuleId; extern PVOID g_pModuleId;
extern BOOL g_fAspnetcoreRHAssemblyLoaded; extern BOOL g_fAspnetcoreRHAssemblyLoaded;
extern BOOL g_fAspnetcoreRHLoadedError; extern BOOL g_fAspnetcoreRHLoadedError;
extern BOOL g_fEnableReferenceCountTracing; extern BOOL g_fEnableReferenceCountTracing;
extern DWORD g_dwActiveServerProcesses; extern DWORD g_dwActiveServerProcesses;
extern HMODULE g_hAspnetCoreRH; extern HINSTANCE g_hModule;
extern SRWLOCK g_srwLock; extern HMODULE g_hAspnetCoreRH;
extern PCWSTR g_pwzAspnetcoreRequestHandlerName; extern SRWLOCK g_srwLock;
extern PCWSTR g_pwzAspnetcoreRequestHandlerName;
extern PFN_ASPNETCORE_CREATE_APPLICATION g_pfnAspNetCoreCreateApplication; extern PFN_ASPNETCORE_CREATE_APPLICATION g_pfnAspNetCoreCreateApplication;
extern PFN_ASPNETCORE_CREATE_REQUEST_HANDLER g_pfnAspNetCoreCreateRequestHandler; extern PFN_ASPNETCORE_CREATE_REQUEST_HANDLER g_pfnAspNetCoreCreateRequestHandler;
#pragma warning( error : 4091) #pragma warning( error : 4091)

View File

@ -20,13 +20,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
{ {
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task HelloWorld_IISExpress_Clr_X64_Portable() public Task HelloWorld_IISExpress_Clr_X64_Portable()
{ {
return HelloWorld(RuntimeFlavor.Clr, ApplicationType.Portable); return HelloWorld(RuntimeFlavor.Clr, ApplicationType.Portable);
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task HelloWorld_IISExpress_CoreClr_X64_Portable() public Task HelloWorld_IISExpress_CoreClr_X64_Portable()
{ {
return HelloWorld(RuntimeFlavor.CoreClr, ApplicationType.Portable); return HelloWorld(RuntimeFlavor.CoreClr, ApplicationType.Portable);

View File

@ -25,13 +25,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
{ {
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task Https_HelloWorld_CLR_X64() public Task Https_HelloWorld_CLR_X64()
{ {
return HttpsHelloWorld(RuntimeFlavor.Clr, ApplicationType.Portable, port: 44396); return HttpsHelloWorld(RuntimeFlavor.Clr, ApplicationType.Portable, port: 44396);
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task Https_HelloWorld_CoreCLR_X64_Portable() public Task Https_HelloWorld_CoreCLR_X64_Portable()
{ {
return HttpsHelloWorld(RuntimeFlavor.CoreClr, ApplicationType.Portable, port: 44394); return HttpsHelloWorld(RuntimeFlavor.CoreClr, ApplicationType.Portable, port: 44394);
@ -93,13 +93,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
} }
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task Https_HelloWorld_NoClientCert_CoreCLR_X64_Portable() public Task Https_HelloWorld_NoClientCert_CoreCLR_X64_Portable()
{ {
return HttpsHelloWorldCerts(RuntimeFlavor.CoreClr, ApplicationType.Portable , port: 44397, sendClientCert: false); return HttpsHelloWorldCerts(RuntimeFlavor.CoreClr, ApplicationType.Portable , port: 44397, sendClientCert: false);
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task Https_HelloWorld_NoClientCert_Clr_X64() public Task Https_HelloWorld_NoClientCert_Clr_X64()
{ {
return HttpsHelloWorldCerts(RuntimeFlavor.Clr, ApplicationType.Portable, port: 44398, sendClientCert: false); return HttpsHelloWorldCerts(RuntimeFlavor.Clr, ApplicationType.Portable, port: 44398, sendClientCert: false);
@ -138,7 +138,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Https.config") : null, ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Https.config") : null,
SiteName = "HttpsTestSite", // This is configured in the Https.config SiteName = "HttpsTestSite", // This is configured in the Https.config
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
ApplicationType = applicationType ApplicationType = applicationType,
Configuration =
#if DEBUG
"Debug"
#else
"Release"
#endif
}; };
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory)) using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))

View File

@ -25,13 +25,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
{ {
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task NtlmAuthentication_Clr_X64() public Task NtlmAuthentication_Clr_X64()
{ {
return NtlmAuthentication(RuntimeFlavor.Clr, ApplicationType.Portable, port: 5051); return NtlmAuthentication(RuntimeFlavor.Clr, ApplicationType.Portable, port: 5051);
} }
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/498")] [Fact]
public Task NtlmAuthentication_CoreClr_X64_Portable() public Task NtlmAuthentication_CoreClr_X64_Portable()
{ {
return NtlmAuthentication(RuntimeFlavor.CoreClr, ApplicationType.Portable, port: 5052); return NtlmAuthentication(RuntimeFlavor.CoreClr, ApplicationType.Portable, port: 5052);