diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-11-21 08:23:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-21 08:23:30 -0800 |
commit | c94d8e68222d931d4bb1c4eb9a52b4b056e85f12 (patch) | |
tree | 8698c9c4e26b58feee82d8e743ca9e5d89f1f2c6 /src/strongname | |
parent | 5e1cee78e6e7a2464deee07acfe5fe9c33925828 (diff) | |
download | coreclr-c94d8e68222d931d4bb1c4eb9a52b4b056e85f12.tar.gz coreclr-c94d8e68222d931d4bb1c4eb9a52b4b056e85f12.tar.bz2 coreclr-c94d8e68222d931d4bb1c4eb9a52b4b056e85f12.zip |
Delete dead/unused code (#21138)
Diffstat (limited to 'src/strongname')
-rw-r--r-- | src/strongname/api/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/strongname/api/strongnamecoreclr.cpp | 95 | ||||
-rw-r--r-- | src/strongname/inc/sncoreclr.h | 11 |
3 files changed, 0 insertions, 107 deletions
diff --git a/src/strongname/api/CMakeLists.txt b/src/strongname/api/CMakeLists.txt index 079d9a5559..4efcdb953c 100644 --- a/src/strongname/api/CMakeLists.txt +++ b/src/strongname/api/CMakeLists.txt @@ -12,7 +12,6 @@ add_definitions(-DSTRONGNAME_IN_VM -DSNAPI_INTERNAL) set(STRONGNAME_SOURCES strongname.cpp - strongnamecoreclr.cpp strongnameinternal.cpp ) diff --git a/src/strongname/api/strongnamecoreclr.cpp b/src/strongname/api/strongnamecoreclr.cpp deleted file mode 100644 index 2b9b4b82cf..0000000000 --- a/src/strongname/api/strongnamecoreclr.cpp +++ /dev/null @@ -1,95 +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. - -// -// Several strong name tools are in a special scenario because they build in the CoreCLR build process, but -// are expected to run against the desktop VM. Because of this, we need to setup the callback structure that -// Utilcode asks for to point to callbacks that shim to the desktop. These methods provide that shimming functionality. -// - -#include "common.h" - -CoreClrCallbacks *GetCoreClrCallbacks(); - -// -// Get a pointer to an API out of the shim -// -// Arguments: -// szApiName - name of the API to get a pointer to -// -// - -template<typename FunctionPointer> -FunctionPointer ApiShim(LPCSTR szApiName) -{ - static FunctionPointer pfnApi = NULL; - - if (pfnApi == NULL) - { - CoreClrCallbacks *pCallbacks = GetCoreClrCallbacks(); - pfnApi = reinterpret_cast<FunctionPointer>(GetProcAddress(pCallbacks->m_hmodCoreCLR, szApiName)); - _ASSERTE(pfnApi != NULL); - } - - return pfnApi; -} - -// -// Shim APIs, passing off into the desktop VM -// - -IExecutionEngine* SnIEE() -{ - typedef IExecutionEngine* (* IEEFn_t)(); - return ApiShim<IEEFn_t>("IEE")(); -} - -HRESULT SnGetCorSystemDirectory(SString& pbuffer) -{ - typedef HRESULT (*GetCorSystemDirectoryFn_t)(SString&); - return ApiShim<GetCorSystemDirectoryFn_t>("GetCORSystemDirectory")(pbuffer); -} - -// -// Initialize a set of CoreCLR callbacks for utilcode to call into the VM with -// -// Return Value: -// CoreClrCallbacks for UtilCode -// -// Notes: -// Will not return NULL -// - -CoreClrCallbacks *GetCoreClrCallbacks() -{ - static CoreClrCallbacks coreClrCallbacks = { 0 }; - if (coreClrCallbacks.m_hmodCoreCLR == NULL) - { - // Run against the desktop CLR - coreClrCallbacks.m_hmodCoreCLR = WszLoadLibrary(W("mscoree.dll")); - coreClrCallbacks.m_pfnIEE = SnIEE; - coreClrCallbacks.m_pfnGetCORSystemDirectory = SnGetCorSystemDirectory; - coreClrCallbacks.m_pfnGetCLRFunction = NULL; - } - - return &coreClrCallbacks; -} - -// Initialize Utilcode -// -// Notes: -// Should only be called once -// - -void InitUtilcode() -{ -#ifdef _DEBUG - static bool fAlreadyInitialized = false; - _ASSERTE(!fAlreadyInitialized); - fAlreadyInitialized = true; -#endif - - InitUtilcode(*GetCoreClrCallbacks()); -} - diff --git a/src/strongname/inc/sncoreclr.h b/src/strongname/inc/sncoreclr.h deleted file mode 100644 index 1b84a32372..0000000000 --- a/src/strongname/inc/sncoreclr.h +++ /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. - -#ifndef _SNCORECLR_H -#define _SNCORECLR_H - - -void InitUtilcode(); - -#endif // _SNCORECLR_H |