Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/binder/bindertracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ namespace BinderTracing
if (mvidMismatch)
{
StackSString format;
format.LoadResource(CCompRC::Error, IDS_EE_FILELOAD_ERROR_GENERIC);
format.LoadResource(IDS_EE_FILELOAD_ERROR_GENERIC);
StackSString details;
details.LoadResource(CCompRC::Error, IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT);
details.LoadResource(IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT);
errorMsg.FormatMessage(FORMAT_MESSAGE_FROM_STRING, format.GetUnicode(), 0, 0, m_assemblyName, details);
}

Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/di/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "corpriv.h"
#include "corexcep.h"
#include "../../dlls/mscorrc/resource.h"
#include <limits.h>

#include <sstring.h>
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/di/rsappdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#endif

#include "corpriv.h"
#include "../../dlls/mscorrc/resource.h"
#include <limits.h>


Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/di/rsassembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#endif

#include "corpriv.h"
#include "../../dlls/mscorrc/resource.h"
#include <limits.h>


Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/di/rsmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#endif

#include "corpriv.h"
#include "../../dlls/mscorrc/resource.h"
#include <limits.h>


Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "debugdebugger.h"
#include "../inc/common.h"
#include "eeconfig.h" // This is here even for retail & free builds...
#include "../../dlls/mscorrc/resource.h"

#include "vars.hpp"
#include <limits.h>
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/ee/debuggermessagebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <utilcode.h> // Utility helpers.
#include <corerror.h>
#include <clrversion.h>
#include "../../dlls/mscorrc/resource.h"

// Output printf-style formatted text to the debugger if it's present or stdout otherwise.
static void DbgPrintf(const LPCSTR szFormat, ...)
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/debug/ee/funceval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "debugdebugger.h"
#include "../inc/common.h"
#include "eeconfig.h" // This is here even for retail & free builds...
#include "../../dlls/mscorrc/resource.h"

#include "vars.hpp"
#include "threads.h"
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ endif (CLR_CMAKE_HOST_UNIX AND NOT CLR_CMAKE_TARGET_ARCH_WASM)
# order dependent and changing the order can result in undefined symbols in the shared
# library.
set(CORECLR_LIBRARIES
mscorrc
utilcode
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
${LIB_CORDBEE}
Expand Down Expand Up @@ -137,7 +138,6 @@ if(CLR_CMAKE_TARGET_WIN32)
else()
list(APPEND CORECLR_LIBRARIES
coreclrpal
mscorrc
)
endif(CLR_CMAKE_TARGET_WIN32)

Expand Down
15 changes: 1 addition & 14 deletions src/coreclr/dlls/mscorrc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
include_directories("../../pal/prebuilt/corerror")

add_definitions(-DFX_VER_INTERNALNAME_STR=mscorrc.dll)

if(CLR_CMAKE_HOST_WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NOENTRY")

# remove /guard:cf, /guard:ehcont, and /CETCOMPAT from resource-only libraries
set_property(DIRECTORY PROPERTY CLR_CONTROL_FLOW_GUARD OFF)

if (CLR_CMAKE_HOST_ARCH_AMD64)
set_property(DIRECTORY PROPERTY CLR_EH_CONTINUATION OFF)
string(REPLACE "/CETCOMPAT" "" CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
endif (CLR_CMAKE_HOST_ARCH_AMD64)

add_library_clr(mscorrc SHARED
add_library_clr(mscorrc OBJECT
include.rc
)
install_clr(TARGETS mscorrc DESTINATIONS . sharedFramework COMPONENT runtime)

else()
build_resources(${CMAKE_CURRENT_SOURCE_DIR}/include.rc mscorrc TARGET_CPP_FILE)
Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/dlls/mscorrc/mscorrc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@

#include <winresrc.h>

#ifndef FX_VER_FILEDESCRIPTION_STR
#define FX_VER_FILEDESCRIPTION_STR ".NET Runtime resources"
#endif

#include <fxver.h>
#include <fxver.rc>

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/inc/sstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ class EMPTY_BASES_DECL SString : private SBuffer
void AppendVPrintf(const CHAR *format, va_list args);

public:
BOOL LoadResource(CCompRC::ResourceCategory eCategory, int resourceID);
HRESULT LoadResourceAndReturnHR(CCompRC::ResourceCategory eCategory, int resourceID);
BOOL LoadResource(int resourceID);
HRESULT LoadResourceAndReturnHR(int resourceID);
BOOL FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId,
const SString &arg1 = Empty(), const SString &arg2 = Empty(),
const SString &arg3 = Empty(), const SString &arg4 = Empty(),
Expand Down
118 changes: 2 additions & 116 deletions src/coreclr/inc/utilcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ HMODULE CLRLoadLibraryEx(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);

BOOL CLRFreeLibrary(HMODULE hModule);

// Load a string using the resources for the current module.
STDAPI UtilLoadStringRC(UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax, int bQuiet=FALSE);

//*****************************************************************************
// Use this class by privately deriving from noncopyable to disallow copying of
// your class.
Expand All @@ -369,126 +366,15 @@ class noncopyable
};

//*****************************************************************************
// Must associate each handle to an instance of a resource dll with the int
// that it represents
//*****************************************************************************
typedef HINSTANCE HRESOURCEDLL;


class CCulturedHInstance
{
HRESOURCEDLL m_hInst;
BOOL m_fMissing;

public:
CCulturedHInstance()
{
LIMITED_METHOD_CONTRACT;
m_hInst = NULL;
m_fMissing = FALSE;
}

HRESOURCEDLL GetLibraryHandle()
{
return m_hInst;
}

BOOL IsSet()
{
return m_hInst != NULL;
}

BOOL IsMissing()
{
return m_fMissing;
}

void SetMissing()
{
_ASSERTE(m_hInst == NULL);
m_fMissing = TRUE;
}

void Set(HRESOURCEDLL hInst)
{
_ASSERTE(m_hInst == NULL);
_ASSERTE(m_fMissing == FALSE);
m_hInst = hInst;
}
};

//*****************************************************************************
// CCompRC manages string Resource access for CLR. This includes loading
// the MsCorRC.dll for resources. No localization is supported.
// CCompRC manages string Resource access for CLR.
//*****************************************************************************
class CCompRC
{
public:

enum ResourceCategory
{
// must be present
Required,

// present in Desktop CLR and Core CLR + debug pack, an error
// If missing, get a generic error message instead
Error,

// present in Desktop CLR and Core CLR + debug pack, normal operation (e.g tracing)
// if missing, get a generic "resource not found" message instead
Debugging,

// present in Desktop CLR, optional for CoreCLR
DesktopCLR,

// might not be present, non essential
Optional
};

CCompRC()
{
// This constructor will be fired up on startup. Make sure it doesn't
// do anything besides zero-out out values.
m_csMap = NULL;
m_pResourceFile = NULL;
}// CCompRC

HRESULT Init(LPCWSTR pResourceFile);
void Destroy();

HRESULT LoadString(ResourceCategory eCategory, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax , int *pcwchUsed=NULL);

// Get the default resource location (mscorrc.dll)
static CCompRC* GetDefaultResourceDll();

private:
// String resources packaged as PE files only exist on Windows
#ifdef HOST_WINDOWS
HRESULT GetLibrary(HRESOURCEDLL* phInst);
#ifndef DACCESS_COMPILE
HRESULT LoadLibraryHelper(HRESOURCEDLL *pHInst,
SString& rcPath);
HRESULT LoadLibraryThrows(HRESOURCEDLL * pHInst);
HRESULT LoadLibrary(HRESOURCEDLL * pHInst);
HRESULT LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName);
#endif // DACCESS_COMPILE
#endif // HOST_WINDOWS

// We do not have global constructors any more
static LONG m_dwDefaultInitialized;
static CCompRC m_DefaultResourceDll;
static LPCWSTR m_pDefaultResource;

// Use a singleton since we don't support localization any more.
CCulturedHInstance m_Primary;

CRITSEC_COOKIE m_csMap;

LPCWSTR m_pResourceFile;
static HRESULT LoadString(UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax , int *pcwchUsed=NULL);
};

HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax);

// The HRESULT_FROM_WIN32 macro evaluates its arguments three times.
// <TODO>TODO: All HRESULT_FROM_WIN32(GetLastError()) should be replaced by calls to
// this helper function avoid code bloat</TODO>
Expand Down
14 changes: 1 addition & 13 deletions src/coreclr/tools/r2rtest/BuildFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public class BuildFolder
"mscordbi",
};

private static string[] s_runtimeWindowsOnlyLibraries =
{
"mscorrc",
};

private List<string> _compilationInputFiles;

private List<string> _mainExecutables;
Expand Down Expand Up @@ -172,14 +167,7 @@ public static BuildFolder FromDirectory(string inputDirectory, IEnumerable<Compi
{
passThroughFiles.Add(Path.Combine(options.CoreRootDirectory.FullName, (libraryPrefix + lib).AppendOSDllSuffix()));
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
foreach (string lib in s_runtimeWindowsOnlyLibraries)
{
passThroughFiles.Add(Path.Combine(options.CoreRootDirectory.FullName, lib.AppendOSDllSuffix()));
}
}
else
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Several native lib*.so / dylib are needed by the runtime
foreach (string nativeLib in Directory.EnumerateFiles(options.CoreRootDirectory.FullName, "lib*".AppendOSDllSuffix()))
Expand Down
Loading
Loading