forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change implements: * Runtime changes necessary to load assemblies directly from the bundle: * Design notes about [Load from Bundle](https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#peimage-loader) * Most of these changes are directly from dotnet/coreclr#26504 and dotnet/coreclr#26904 * Hostpolicy change to not add bundled assemblies to TPA list: * Design notes about [Dependency Resolution](https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#dependency-resolution) * TBD (separately) items: Fix for hammer servicing dotnet#36031 Fixes dotnet#32822
- Loading branch information
1 parent
bacef40
commit 0541e4b
Showing
37 changed files
with
558 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// 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. | ||
|
||
/***************************************************************************** | ||
** ** | ||
** bundle.h - Information about applications bundled as a single-file ** | ||
** ** | ||
*****************************************************************************/ | ||
|
||
#ifndef _BUNDLE_H_ | ||
#define _BUNDLE_H_ | ||
|
||
#include <sstring.h> | ||
|
||
class Bundle; | ||
|
||
struct BundleFileLocation | ||
{ | ||
INT64 Size; | ||
INT64 Offset; | ||
|
||
BundleFileLocation() | ||
{ | ||
LIMITED_METHOD_CONTRACT; | ||
|
||
Size = 0; | ||
Offset = 0; | ||
} | ||
|
||
static BundleFileLocation Invalid() { LIMITED_METHOD_CONTRACT; return BundleFileLocation(); } | ||
|
||
const SString &Path() const; | ||
|
||
bool IsValid() const { LIMITED_METHOD_CONTRACT; return Offset != 0; } | ||
}; | ||
|
||
typedef bool(__stdcall BundleProbe)(LPCWSTR, INT64*, INT64*); | ||
|
||
class Bundle | ||
{ | ||
public: | ||
Bundle(LPCWSTR bundlePath, BundleProbe *probe); | ||
BundleFileLocation Probe(LPCWSTR path, bool pathIsBundleRelative = false) const; | ||
|
||
const SString &Path() const { LIMITED_METHOD_CONTRACT; return m_path; } | ||
const SString &BasePath() const { LIMITED_METHOD_CONTRACT; return m_basePath; } | ||
|
||
static Bundle* AppBundle; // The BundleInfo for the current app, initialized by coreclr_initialize. | ||
static bool AppIsBundle() { LIMITED_METHOD_CONTRACT; return AppBundle != nullptr; } | ||
static BundleFileLocation ProbeAppBundle(LPCWSTR path, bool pathIsBundleRelative = false); | ||
|
||
private: | ||
|
||
SString m_path; // The path to single-file executable | ||
BundleProbe *m_probe; | ||
|
||
SString m_basePath; // The prefix to denote a path within the bundle | ||
}; | ||
|
||
#endif // _BUNDLE_H_ | ||
// EOF ======================================================================= |
Oops, something went wrong.