diff options
Diffstat (limited to 'src/dlls/mscorpe')
-rw-r--r-- | src/dlls/mscorpe/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/dlls/mscorpe/Native.rc | 8 | ||||
-rw-r--r-- | src/dlls/mscorpe/ceefilegenwritertokens.cpp | 3 | ||||
-rw-r--r-- | src/dlls/mscorpe/dirs.proj | 15 | ||||
-rw-r--r-- | src/dlls/mscorpe/mscorpe/mscorpe.def | 11 | ||||
-rw-r--r-- | src/dlls/mscorpe/mscorpe/mscorpe.nativeproj | 46 | ||||
-rw-r--r-- | src/dlls/mscorpe/mscorpe/wrapper.cpp | 149 | ||||
-rw-r--r-- | src/dlls/mscorpe/mscorpehost/mscorpehost.def | 12 | ||||
-rw-r--r-- | src/dlls/mscorpe/mscorpehost/mscorpehost.nativeproj | 68 | ||||
-rw-r--r-- | src/dlls/mscorpe/utilcodeinit.cpp | 11 |
10 files changed, 0 insertions, 327 deletions
diff --git a/src/dlls/mscorpe/CMakeLists.txt b/src/dlls/mscorpe/CMakeLists.txt index e8f22f2e9b..fd884b1c46 100644 --- a/src/dlls/mscorpe/CMakeLists.txt +++ b/src/dlls/mscorpe/CMakeLists.txt @@ -7,13 +7,9 @@ set(MSCORPE_SOURCES ceefilegenwriter.cpp pewriter.cpp ceefilegenwritertokens.cpp - utilcodeinit.cpp ) if(WIN32) - list(APPEND MSCORPE_SOURCES - Native.rc - ) else() add_compile_options(-Wno-delete-non-virtual-dtor) endif(WIN32) diff --git a/src/dlls/mscorpe/Native.rc b/src/dlls/mscorpe/Native.rc deleted file mode 100644 index e652bf3f1d..0000000000 --- a/src/dlls/mscorpe/Native.rc +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#define FX_VER_FILEDESCRIPTION_STR "Microsoft .NET Runtime PE File Generator\0" - -#include <fxver.h> -#include <fxver.rc> diff --git a/src/dlls/mscorpe/ceefilegenwritertokens.cpp b/src/dlls/mscorpe/ceefilegenwritertokens.cpp index e2d448552d..3503eaf67b 100644 --- a/src/dlls/mscorpe/ceefilegenwritertokens.cpp +++ b/src/dlls/mscorpe/ceefilegenwritertokens.cpp @@ -10,9 +10,6 @@ //***************************************************************************** #include "stdafx.h" #include "ceegen.h" -#ifndef FEATURE_CORECLR -#define DECLARE_DATA -#endif #include "../../ildasm/dasmenum.hpp" #define MAX_CLASSNAME_LENGTH 1024 diff --git a/src/dlls/mscorpe/dirs.proj b/src/dlls/mscorpe/dirs.proj deleted file mode 100644 index 46bb0ce64d..0000000000 --- a/src/dlls/mscorpe/dirs.proj +++ /dev/null @@ -1,15 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" /> - - <!--The following projects will build during PHASE 1--> - <PropertyGroup> - <BuildInPhaseDefault>false</BuildInPhaseDefault> - <BuildInPhase1>true</BuildInPhase1> - </PropertyGroup> - <ItemGroup Condition="'$(BuildExePhase)' == '1'"> - <ProjectFile Include="mscorpe\mscorpe.nativeproj" /> - <ProjectFile Include="mscorpehost\mscorpehost.nativeproj" /> - </ItemGroup> - - <Import Project="$(_NTDRIVE)$(_NTROOT)\tools\Microsoft.DevDiv.Traversal.targets" /> -</Project> diff --git a/src/dlls/mscorpe/mscorpe/mscorpe.def b/src/dlls/mscorpe/mscorpe/mscorpe.def deleted file mode 100644 index 875abc42a7..0000000000 --- a/src/dlls/mscorpe/mscorpe/mscorpe.def +++ /dev/null @@ -1,11 +0,0 @@ -; Licensed to the .NET Foundation under one or more agreements. -; The .NET Foundation licenses this file to you under the MIT license. -; See the LICENSE file in the project root for more information. -; -; mscorpe.def for mscorpe.dll (a simple wrapper around real implementation mscorpehost.dll - see -; file:wrapper.cpp for more details) -; PE file generator in EE - -EXPORTS - CreateICeeFileGen - DestroyICeeFileGen diff --git a/src/dlls/mscorpe/mscorpe/mscorpe.nativeproj b/src/dlls/mscorpe/mscorpe/mscorpe.nativeproj deleted file mode 100644 index 526cf6088b..0000000000 --- a/src/dlls/mscorpe/mscorpe/mscorpe.nativeproj +++ /dev/null @@ -1,46 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="dogfood"> - - <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" /> - - <PropertyGroup> - <NoCrt>true</NoCrt> - <LinkUseCMT>true</LinkUseCMT> - <UserIncludes> - $(UserIncludes); - . - </UserIncludes> - <CDefines>$(CDefines);__TODO_PORT_TO_WRAPPERS__;UNICODE</CDefines> - <OutputName>mscorpe</OutputName> - <FileToMarkForSigning>$(BinariesDirectory)\$(OutputName).dll</FileToMarkForSigning> - <OutputLibPath>$(IntermediateOutputDirectory)</OutputLibPath> - <DllDef>$(OutputName).def</DllDef> - <TargetType>DYNLINK</TargetType> - <LinkSubsystem>windows</LinkSubsystem> - <PogoOptimized>true</PogoOptimized> - <DllEntryPoint>_DllMainCRTStartup</DllEntryPoint> - <Win32DllLibs>$(ClrLibPath)\utilcodestaticnohost.lib</Win32DllLibs> - <UseMsvcrt>false</UseMsvcrt> - <NoLinkGdi32>true</NoLinkGdi32> - </PropertyGroup> - - <ItemGroup> - <TargetLib Include="$(SdkLibPath)\mscoree.lib" /> - <TargetLib Include="$(SdkLibPath)\oleaut32.lib" /> - <TargetLib Include="$(SdkLibPath)\uuid.lib" /> - <TargetLib Include="$(SdkLibPath)\kernel32.lib" /> - <TargetLib Include="$(SdkLibPath)\advapi32.lib" /> - <TargetLib Include="$(SdkLibPath)\user32.lib" /> - <TargetLib Include="$(SdkLibPath)\shlwapi.lib" /> - <ProjectReference Include="$(ClrSrcDirectory)utilcode\staticnohost\staticnohost.nativeproj"/> - </ItemGroup> - - <ItemGroup> - <RCResourceFile Include="..\Native.rc" /> - </ItemGroup> - - <ItemGroup> - <CppCompile Include="wrapper.cpp" /> - </ItemGroup> - - <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.targets" /> -</Project> diff --git a/src/dlls/mscorpe/mscorpe/wrapper.cpp b/src/dlls/mscorpe/mscorpe/wrapper.cpp deleted file mode 100644 index d2f1701ec4..0000000000 --- a/src/dlls/mscorpe/mscorpe/wrapper.cpp +++ /dev/null @@ -1,149 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// -// File: wrapper.cpp -// - -// -// This file implements a simple wrapper DLL (mscorpe.dll) which calls properly into mscorpehost.dll. -// It exists because of compatibility with 1.x/2.0 apps running on CLR 4.0+. Such older apps could pass -// full path to LoadLibrary() Windows API and get this DLL. -// -// Noone in CLR should ever try to load this DLL directly (using LoadLibrary API). Note that hosting APIs -// and PInvoke redirect mscorpe.dll to mscorpehost.dll automatically. -// - -#include <MscorpeSxSWrapper.h> - -#include <mscoree.h> -#include <metahost.h> - -// Globals -HINSTANCE g_hThisInst; // This library. - -//***************************************************************************** -// Handle lifetime of loaded library. -//***************************************************************************** -extern "C" -BOOL WINAPI -DllMain( - HINSTANCE hInstance, - DWORD dwReason, - LPVOID lpReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - { // Save the module handle. - g_hThisInst = hInstance; - DisableThreadLibraryCalls((HMODULE)hInstance); - } - break; - case DLL_PROCESS_DETACH: - break; - } - - return TRUE; -} // DllMain - -// Implementation for utilcode -HINSTANCE -GetModuleInst() -{ - return g_hThisInst; -} // GetModuleInst - -// Load correct SxS version of mscorpe.dll and initialize it (uses shim). -HRESULT -LoadMscorpe(HMODULE * phModule) -{ - HRESULT hr = S_OK; - ICLRMetaHost * pMetaHost = NULL; - ICLRRuntimeInfo * pCLRRuntimeInfo = NULL; - - // Get full DLL path - WCHAR wszPath[_MAX_PATH]; - DWORD dwLength = GetModuleFileName((HMODULE)g_hThisInst, wszPath, NumItems(wszPath)); - - if ((dwLength == 0) || - ((dwLength == NumItems(wszPath)) && - (GetLastError() == ERROR_INSUFFICIENT_BUFFER))) - { - IfFailGo(CLR_E_SHIM_RUNTIMELOAD); - } - - // Find start of '\mscorpe.dll' - LPWSTR wszSeparator = wcsrchr(wszPath, L'\\'); - if (wszSeparator == NULL) - { - IfFailGo(CLR_E_SHIM_RUNTIMELOAD); - } - // Check the name of this DLL - _ASSERTE(_wcsicmp(wszSeparator, L"\\mscorpe.dll") == 0); - // Remove the DLL name - *wszSeparator = 0; - - // Find start of last directory name (\<version>), - // C:\Windows\Microsoft.NET\Framework\[[v4.0.12345]]\mscorpe.dll - LPWSTR wszLastDirectoryName = wcsrchr(wszPath, L'\\'); - if (wszLastDirectoryName == NULL) - { - IfFailGo(CLR_E_SHIM_RUNTIMELOAD); - } - LPWSTR wszVersion = wszLastDirectoryName + 1; - - IfFailGo(CLRCreateInstance( - CLSID_CLRMetaHost, - IID_ICLRMetaHost, - reinterpret_cast<LPVOID *>(&pMetaHost))); - - IfFailGo(pMetaHost->GetRuntime( - wszVersion, - IID_ICLRRuntimeInfo, - reinterpret_cast<LPVOID *>(&pCLRRuntimeInfo))); - - // Shim will load correct SxS version of mscorpe.dll and will initialize it - IfFailGo(pCLRRuntimeInfo->LoadLibrary( - L"mscorpe.dll", - phModule)); - -ErrExit: - if (pMetaHost != NULL) - { - pMetaHost->Release(); - pMetaHost = NULL; - } - if (pCLRRuntimeInfo != NULL) - { - pCLRRuntimeInfo->Release(); - pCLRRuntimeInfo = NULL; - } - - if (FAILED(hr)) - { - *phModule = NULL; - } - - return hr; -} // LoadMscorpe - -// SxS wrapper of mscorpe.dll entrypoints -typedef MscorpeSxSWrapper<LoadMscorpe> MscorpeSxS; - -// Export of 'original' 1.x/2.0 mscorpe.dll -EXTERN_C -HRESULT __stdcall -CreateICeeFileGen( - ICeeFileGen ** ppCeeFileGen) -{ - return MscorpeSxS::CreateICeeFileGen(ppCeeFileGen); -} - -// Export of 'original' 1.x/2.0 mscorpe.dll -EXTERN_C -HRESULT __stdcall -DestroyICeeFileGen(ICeeFileGen ** ppCeeFileGen) -{ - return MscorpeSxS::DestroyICeeFileGen(ppCeeFileGen); -} diff --git a/src/dlls/mscorpe/mscorpehost/mscorpehost.def b/src/dlls/mscorpe/mscorpehost/mscorpehost.def deleted file mode 100644 index 0cf870b17b..0000000000 --- a/src/dlls/mscorpe/mscorpehost/mscorpehost.def +++ /dev/null @@ -1,12 +0,0 @@ -; Licensed to the .NET Foundation under one or more agreements. -; The .NET Foundation licenses this file to you under the MIT license. -; See the LICENSE file in the project root for more information. -; -; PeWriter.def for PeWriter.dll -; PE file generator in EE - -EXPORTS - CreateICeeFileGen - DestroyICeeFileGen - InitializeSxS - diff --git a/src/dlls/mscorpe/mscorpehost/mscorpehost.nativeproj b/src/dlls/mscorpe/mscorpehost/mscorpehost.nativeproj deleted file mode 100644 index 45af39f38b..0000000000 --- a/src/dlls/mscorpe/mscorpehost/mscorpehost.nativeproj +++ /dev/null @@ -1,68 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="dogfood"> - <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.props" /> - - <PropertyGroup> - <LibCLib>$(ClrCrtLib)</LibCLib> - <OutputName>mscorpehost</OutputName> - <FileToMarkForSigning>$(BinariesDirectory)\$(OutputName).dll</FileToMarkForSigning> - <OutputLibPath>$(IntermediateOutputDirectory)</OutputLibPath> - <DllDef>$(OutputName).def</DllDef> - <TargetType>DYNLINK</TargetType> - <PCHHeader>stdafx.h</PCHHeader> - <EnableCxxPCHHeaders>true</EnableCxxPCHHeaders> - <PCHCompile>..\stdafx.cpp</PCHCompile> - <UserIncludes> - $(UserIncludes); - .; - ../../vm - </UserIncludes> - <CDefines>$(CDefines);__TODO_PORT_TO_WRAPPERS__;UNICODE</CDefines> - <LinkSubsystem>windows</LinkSubsystem> - <PogoOptimized>true</PogoOptimized> - <DllEntryPoint>_DllMainCRTStartup</DllEntryPoint> - <ExtDelayImpLib>false</ExtDelayImpLib> - </PropertyGroup> - - <PropertyGroup> - <LinkDelayLoad Condition="'$(LinkDelayLoad)'!=''">$(LinkDelayLoad);</LinkDelayLoad> - <LinkDelayLoad>$(LinkDelayLoad)ole32.dll</LinkDelayLoad> - </PropertyGroup> - - <ItemGroup> - <CppCompile Include="..\utilcodeinit.cpp" /> - </ItemGroup> - - <ItemGroup> - <LinkPreCrtLibs Include="$(ClrLibPath)\utilcode.lib"> - <ProjectReference>$(ClrSrcDirectory)utilcode\dyncrt\dyncrt.nativeproj</ProjectReference> - </LinkPreCrtLibs> - - <TargetLib Include="$(SdkLibPath)\mscoree.lib" /> - <TargetLib Include="$(ClrLibPath)\ceefgen.lib"> - <ProjectReference>$(ClrSrcDirectory)md\ceefilegen\ceefgen.nativeproj</ProjectReference> - </TargetLib> - <TargetLib Include="$(ClrLibPath)\delayimp.lib"> - <ProjectReference>$(ClrSrcDirectory)delayimp\delayimp.nativeproj</ProjectReference> - </TargetLib> - <TargetLib Include="$(SdkLibPath)\ole32.lib" /> - <TargetLib Include="$(SdkLibPath)\oleaut32.lib" /> - <TargetLib Include="$(SdkLibPath)\uuid.lib" /> - <TargetLib Include="$(SdkLibPath)\kernel32.lib" /> - <TargetLib Include="$(SdkLibPath)\advapi32.lib" /> - <TargetLib Include="$(SdkLibPath)\user32.lib" /> - <TargetLib Include="$(SdkLibPath)\shlwapi.lib" /> - </ItemGroup> - - <ItemGroup> - <RCResourceFile Include="..\Native.rc" /> - </ItemGroup> - - <ItemGroup> - <CppCompile Include="..\ICeeFileGen.cpp" /> - <CppCompile Include="..\CeeFileGenWriter.cpp" /> - <CppCompile Include="..\PEWriter.cpp" /> - <CppCompile Include="..\CeeFileGenWriterTokens.cpp" /> - </ItemGroup> - - <Import Project="$(_NTDRIVE)$(_NTROOT)\ndp\clr\clr.targets" /> -</Project> diff --git a/src/dlls/mscorpe/utilcodeinit.cpp b/src/dlls/mscorpe/utilcodeinit.cpp deleted file mode 100644 index 0e9fab9860..0000000000 --- a/src/dlls/mscorpe/utilcodeinit.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#include "stdafx.h" -#include <utilcode.h> - -EXTERN_C void __stdcall InitializeSxS(CoreClrCallbacks const & callbacks) -{ - InitUtilcode(callbacks); -} |