...
 
Commits (11)
    https://gitcode.net/jobily/runtime/-/commit/483490d4a1e86a56dab013008c378ef78e407110 [release/7.0] Disable objc_msgSend stubs in clang for compatibility with Xcod... 2023-08-29T11:08:11+02:00 Alexander Köplinger alex.koeplinger@outlook.com Backport of #89932 and #90217 to release/7.0 https://gitcode.net/jobily/runtime/-/commit/8d0d6d44f56420ce81140335b2ac77ce20021e98 Update branding to 7.0.12 (#91405) 2023-08-31T16:39:18-07:00 vseanreesermsft 78103370+vseanreesermsft@users.noreply.github.com https://gitcode.net/jobily/runtime/-/commit/45161fb0b325fdf02d7e9a2a794b0780b50dc173 Update 7.0 to use Ubuntu 22.04 queues for Perf runs (#90767) 2023-08-31T16:45:00-07:00 Drew Scoggins anscoggi@microsoft.com * Put crossgen perf into "Ubuntu.1804.Amd64.Tiger.Perf". (#90091) * Because crossgen need LTTng and 22.04 is not compatible. * Windows using same queue. * Remove artifacts of bad merge * Add 22.04 queue --------- Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:jiri@cincura.net" title="jiri@cincura.net"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:jiri@cincura.net" title="jiri@cincura.net">Jiri Cincura ↹</a> &lt;<a href="mailto:jiri@cincura.net" title="jiri@cincura.net">jiri@cincura.net</a>&gt;</span> https://gitcode.net/jobily/runtime/-/commit/414e1a74bbe7e106c956eb095243f20b84fc5849 Fix offset calculation for nested struct, when pinvoke is enabled (#91422) 2023-09-01T15:57:32-04:00 Fan Yang 52458914+fanyang-mono@users.noreply.github.com https://gitcode.net/jobily/runtime/-/commit/26e0f8225a2919944e9e50e87e3b0e296cf20a41 Update dependencies from https://github.com/dotnet/emsdk build 20230831.2 (#9... 2023-09-01T15:27:31-06:00 dotnet-maestro[bot] 42748379+dotnet-maestro[bot]@users.noreply.github.com Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.11 -&gt; To Version 7.0.12 Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:dotnet-maestro%5Bbot%5D@users.noreply.github.com" title="dotnet-maestro[bot]@users.noreply.github.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg4" style="text-decoration: none">N</a><a href="mailto:dotnet-maestro%5Bbot%5D@users.noreply.github.com" title="dotnet-maestro[bot]@users.noreply.github.com">dotnet-maestro[bot]</a> &lt;<a href="mailto:dotnet-maestro%5Bbot%5D@users.noreply.github.com" title="dotnet-maestro[bot]@users.noreply.github.com">dotnet-maestro[bot]@users.noreply.github.com</a>&gt;</span> https://gitcode.net/jobily/runtime/-/commit/24efc65a84e42ce84a7c8fd136290abb748b373c Update dependencies from https://github.com/dotnet/emsdk build 20230831.2 (#9... 2023-09-01T15:28:00-06:00 dotnet-maestro[bot] 42748379+dotnet-maestro[bot]@users.noreply.github.com Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.11 -&gt; To Version 7.0.12 Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:dotnet-maestro%5Bbot%5D@users.noreply.github.com" title="dotnet-maestro[bot]@users.noreply.github.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg1" style="text-decoration: none">N</a><a href="mailto:dotnet-maestro%5Bbot%5D@users.noreply.github.com" title="dotnet-maestro[bot]@users.noreply.github.com">dotnet-maestro[bot]</a> &lt;<a href="mailto:dotnet-maestro%5Bbot%5D@users.noreply.github.com" title="dotnet-maestro[bot]@users.noreply.github.com">dotnet-maestro[bot]@users.noreply.github.com</a>&gt;</span> https://gitcode.net/jobily/runtime/-/commit/c0deb4f299790ad5638572b7f43843e30f750f94 [7.0] Fix session-local named mutex compat issue (#90343) 2023-09-01T15:30:42-06:00 Koundinya Veluri kouvel@users.noreply.github.com * Revert "Merged PR 26484: Restrict named mutex files permissions" This reverts commit <a href="/jobily/runtime/-/commit/7e10421a817e7346a5e4c45709e621bce1b5d71b" data-original="7e10421a817e7346a5e4c45709e621bce1b5d71b" data-link="false" data-link-reference="false" data-project="324144" data-commit="7e10421a817e7346a5e4c45709e621bce1b5d71b" data-reference-type="commit" data-container="body" data-placement="top" title="Merged PR 26484: Restrict named mutex files permissions" class="gfm gfm-commit has-tooltip">7e10421a</a>. * Restore a change to improve backward compatibility https://gitcode.net/jobily/runtime/-/commit/65bc3f95d9450bb5e668c084dc01192dd56d6e3d Merge pull request #91435 from dotnet-maestro-bot/merge/release/7.0-to-releas... 2023-09-11T12:22:30-07:00 Carlos Sánchez López 1175054+carlossanlop@users.noreply.github.com [automated] Merge branch 'release/7.0' =&gt; 'release/7.0-staging' https://gitcode.net/jobily/runtime/-/commit/b739da3b81528ee455254e3c26d8b5c900b8cb1a [release/7.0-staging] [hot_reload] ignore modified MONO_TABLE_TYPEDEF rows in... 2023-09-11T13:28:30-06:00 github-actions[bot] 41898282+github-actions[bot]@users.noreply.github.com * Add test that deletes a custom attribute from a class * just ignore modified MONO_TABLE_TYPEDEF rows in updates We may want to validate that Parent, Interfaces and Attributes columns haven't changed, but it's tricky and might be overly restrictive * simplify pass1 code. It's just two branches with comments. Remove the `if` entirely --------- Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:alklig@microsoft.com" title="alklig@microsoft.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:alklig@microsoft.com" title="alklig@microsoft.com">Aleksey Kliger</a> &lt;<a href="mailto:alklig@microsoft.com" title="alklig@microsoft.com">alklig@microsoft.com</a>&gt;</span> https://gitcode.net/jobily/runtime/-/commit/8d2dff45b1adfed499342873452b4d463207964a [release/7.0-staging] [maccatalyst] Make sure MacProxy is included in System.... 2023-09-11T16:35:03-06:00 Steve Pfister steveisok@users.noreply.github.com * [release/7.0-staging] [maccatalyst] Make sure MacProxy is included in System.Net.Http Backport of <a href="https://github.com/dotnet/runtime/pull/91473" rel="nofollow noreferrer noopener" target="_blank">https://github.com/dotnet/runtime/pull/91473</a> to release/7.0 * Additional conditions --------- Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:steve.pfister@microsoft.com" title="steve.pfister@microsoft.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:steve.pfister@microsoft.com" title="steve.pfister@microsoft.com">Steve Pfister</a> &lt;<a href="mailto:steve.pfister@microsoft.com" title="steve.pfister@microsoft.com">steve.pfister@microsoft.com</a>&gt;</span> https://gitcode.net/jobily/runtime/-/commit/c389ab736695e728bcf1a98684c769dbe118dbc6 [release/7.0] Reset OOB packages from September Release in the October Releas... 2023-09-11T19:48:04-06:00 Carlos Sánchez López 1175054+carlossanlop@users.noreply.github.com * Microsoft.Windows.Compatibility * System.DirectoryServices.AccountManagement * System.Threading.RateLimiting
......@@ -9,7 +9,7 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-79b01e4" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-79b01e47/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-9506882" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-95068821/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<!--
......
......@@ -48,13 +48,13 @@
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>5618b2d243ccdeb5c7e50a298b33b13036b4351b</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100" Version="7.0.11">
<Dependency Name="Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100" Version="7.0.12">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>79b01e47d43eeba5442af569770480696102972f</Sha>
<Sha>9506882149df72322dba902cd42778ae4c4a6fbf</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100" Version="7.0.11">
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100" Version="7.0.12">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>79b01e47d43eeba5442af569770480696102972f</Sha>
<Sha>9506882149df72322dba902cd42778ae4c4a6fbf</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
......
<Project>
<PropertyGroup>
<!-- The .NET product branding version -->
<ProductVersion>7.0.11</ProductVersion>
<ProductVersion>7.0.12</ProductVersion>
<!-- File version numbers -->
<MajorVersion>7</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>11</PatchVersion>
<PatchVersion>12</PatchVersion>
<SdkBandVersion>7.0.100</SdkBandVersion>
<PackageVersionNet6>6.0.$([MSBuild]::Add($(PatchVersion), 11))</PackageVersionNet6>
<PreReleaseVersionLabel>servicing</PreReleaseVersionLabel>
......@@ -22,8 +22,8 @@
<UsingToolIbcOptimization>false</UsingToolIbcOptimization>
<UsingToolXliff>false</UsingToolXliff>
<LastReleasedStableAssemblyVersion>$(AssemblyVersion)</LastReleasedStableAssemblyVersion>
<MicrosoftNETWorkloadEmscriptennet6Manifest70100Version>7.0.11</MicrosoftNETWorkloadEmscriptennet6Manifest70100Version>
<MicrosoftNETWorkloadEmscriptennet7Manifest70100Version>7.0.11</MicrosoftNETWorkloadEmscriptennet7Manifest70100Version>
<MicrosoftNETWorkloadEmscriptennet6Manifest70100Version>7.0.12</MicrosoftNETWorkloadEmscriptennet6Manifest70100Version>
<MicrosoftNETWorkloadEmscriptennet7Manifest70100Version>7.0.12</MicrosoftNETWorkloadEmscriptennet7Manifest70100Version>
</PropertyGroup>
<ItemGroup>
<!-- The bands we want to produce workload manifests for -->
......
......@@ -384,6 +384,17 @@ if (CLR_CMAKE_HOST_UNIX)
# using twos-complement representation (this is normally undefined according to the C++ spec).
add_compile_options(-fwrapv)
if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS)
# Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand.
# We disable this by passing -fno-objc-msgsend-selector-stubs to clang.
# We can probably remove this flag once we require developers to use Xcode 14.
# Ref: https://github.com/xamarin/xamarin-macios/issues/16223
check_c_compiler_flag(-fno-objc-msgsend-selector-stubs COMPILER_SUPPORTS_FNO_OBJC_MSGSEND_SELECTOR_STUBS)
if(COMPILER_SUPPORTS_FNO_OBJC_MSGSEND_SELECTOR_STUBS)
set(CLR_CMAKE_COMMON_OBJC_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS} -fno-objc-msgsend-selector-stubs")
endif()
endif()
if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_MACCATALYST)
# We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2)
add_compile_options(-fstack-protector)
......
......@@ -88,11 +88,9 @@ public:
class SharedMemoryHelpers
{
private:
static const mode_t PermissionsMask_CurrentUser_ReadWrite;
static const mode_t PermissionsMask_CurrentUser_ReadWriteExecute;
static const mode_t PermissionsMask_AllUsers_ReadWrite;
static const mode_t PermissionsMask_AllUsers_ReadWriteExecute;
public:
static const UINT32 InvalidProcessId;
static const SIZE_T InvalidThreadId;
......@@ -108,12 +106,12 @@ public:
static void BuildSharedFilesPath(PathCharString& destination, const char *suffix, int suffixByteCount);
static bool AppendUInt32String(PathCharString& destination, UINT32 value);
static bool EnsureDirectoryExists(const char *path, bool isGlobalLockAcquired, bool hasCurrentUserAccessOnly, bool setStickyFlag, bool createIfNotExist = true, bool isSystemDirectory = false);
static bool EnsureDirectoryExists(const char *path, bool isGlobalLockAcquired, bool createIfNotExist = true, bool isSystemDirectory = false);
private:
static int Open(LPCSTR path, int flags, mode_t mode = static_cast<mode_t>(0));
public:
static int OpenDirectory(LPCSTR path);
static int CreateOrOpenFile(LPCSTR path, bool createIfNotExist = true, bool isSessionScope = true, bool *createdRef = nullptr);
static int CreateOrOpenFile(LPCSTR path, bool createIfNotExist = true, bool *createdRef = nullptr);
static void CloseFile(int fileDescriptor);
static SIZE_T GetFileSize(int fileDescriptor);
......
......@@ -62,7 +62,6 @@ DWORD SharedMemoryException::GetErrorCode() const
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SharedMemoryHelpers
const mode_t SharedMemoryHelpers::PermissionsMask_CurrentUser_ReadWrite = S_IRUSR | S_IWUSR;
const mode_t SharedMemoryHelpers::PermissionsMask_CurrentUser_ReadWriteExecute = S_IRUSR | S_IWUSR | S_IXUSR;
const mode_t SharedMemoryHelpers::PermissionsMask_AllUsers_ReadWrite =
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
......@@ -97,8 +96,6 @@ SIZE_T SharedMemoryHelpers::AlignUp(SIZE_T value, SIZE_T alignment)
bool SharedMemoryHelpers::EnsureDirectoryExists(
const char *path,
bool isGlobalLockAcquired,
bool hasCurrentUserAccessOnly,
bool setStickyFlag,
bool createIfNotExist,
bool isSystemDirectory)
{
......@@ -106,13 +103,6 @@ bool SharedMemoryHelpers::EnsureDirectoryExists(
_ASSERTE(!(isSystemDirectory && createIfNotExist)); // should not create or change permissions on system directories
_ASSERTE(SharedMemoryManager::IsCreationDeletionProcessLockAcquired());
_ASSERTE(!isGlobalLockAcquired || SharedMemoryManager::IsCreationDeletionFileLockAcquired());
_ASSERTE(!(setStickyFlag && hasCurrentUserAccessOnly)); // Sticky bit doesn't make sense with current user access only
mode_t mode = hasCurrentUserAccessOnly ? PermissionsMask_CurrentUser_ReadWriteExecute : PermissionsMask_AllUsers_ReadWriteExecute;
if (setStickyFlag)
{
mode |= S_ISVTX;
}
// Check if the path already exists
struct stat statInfo;
......@@ -133,11 +123,11 @@ bool SharedMemoryHelpers::EnsureDirectoryExists(
if (isGlobalLockAcquired)
{
if (mkdir(path, mode) != 0)
if (mkdir(path, PermissionsMask_AllUsers_ReadWriteExecute) != 0)
{
throw SharedMemoryException(static_cast<DWORD>(SharedMemoryError::IO));
}
if (chmod(path, mode) != 0)
if (chmod(path, PermissionsMask_AllUsers_ReadWriteExecute) != 0)
{
rmdir(path);
throw SharedMemoryException(static_cast<DWORD>(SharedMemoryError::IO));
......@@ -152,7 +142,7 @@ bool SharedMemoryHelpers::EnsureDirectoryExists(
{
throw SharedMemoryException(static_cast<DWORD>(SharedMemoryError::IO));
}
if (chmod(tempPath, mode) != 0)
if (chmod(tempPath, PermissionsMask_AllUsers_ReadWriteExecute) != 0)
{
rmdir(tempPath);
throw SharedMemoryException(static_cast<DWORD>(SharedMemoryError::IO));
......@@ -192,11 +182,11 @@ bool SharedMemoryHelpers::EnsureDirectoryExists(
// For non-system directories (such as gSharedFilesPath/SHARED_MEMORY_RUNTIME_TEMP_DIRECTORY_NAME),
// require sufficient permissions for all users and try to update them if requested to create the directory, so that
// shared memory files may be shared by all processes on the system.
if ((statInfo.st_mode & mode) == mode)
if ((statInfo.st_mode & PermissionsMask_AllUsers_ReadWriteExecute) == PermissionsMask_AllUsers_ReadWriteExecute)
{
return true;
}
if (!createIfNotExist || chmod(path, mode) != 0)
if (!createIfNotExist || chmod(path, PermissionsMask_AllUsers_ReadWriteExecute) != 0)
{
// We were not asked to create the path or we weren't able to set the new permissions.
// As a last resort, check that at least the current user has full access.
......@@ -253,7 +243,7 @@ int SharedMemoryHelpers::OpenDirectory(LPCSTR path)
return fileDescriptor;
}
int SharedMemoryHelpers::CreateOrOpenFile(LPCSTR path, bool createIfNotExist, bool isSessionScope, bool *createdRef)
int SharedMemoryHelpers::CreateOrOpenFile(LPCSTR path, bool createIfNotExist, bool *createdRef)
{
_ASSERTE(path != nullptr);
_ASSERTE(path[0] != '\0');
......@@ -283,13 +273,12 @@ int SharedMemoryHelpers::CreateOrOpenFile(LPCSTR path, bool createIfNotExist, bo
// File does not exist, create the file
openFlags |= O_CREAT | O_EXCL;
mode_t mode = isSessionScope ? PermissionsMask_CurrentUser_ReadWrite : PermissionsMask_AllUsers_ReadWrite;
fileDescriptor = Open(path, openFlags, mode);
fileDescriptor = Open(path, openFlags, PermissionsMask_AllUsers_ReadWrite);
_ASSERTE(fileDescriptor != -1);
// The permissions mask passed to open() is filtered by the process' permissions umask, so open() may not set all of
// the requested permissions. Use chmod() to set the proper permissions.
if (chmod(path, mode) != 0)
if (chmod(path, PermissionsMask_AllUsers_ReadWrite) != 0)
{
CloseFile(fileDescriptor);
unlink(path);
......@@ -675,7 +664,7 @@ SharedMemoryProcessDataHeader *SharedMemoryProcessDataHeader::CreateOrOpen(
SharedMemoryHelpers::VerifyStringOperation(SharedMemoryManager::CopySharedMemoryBasePath(filePath));
SharedMemoryHelpers::VerifyStringOperation(filePath.Append('/'));
SharedMemoryHelpers::VerifyStringOperation(id.AppendSessionDirectoryName(filePath));
if (!SharedMemoryHelpers::EnsureDirectoryExists(filePath, true /* isGlobalLockAcquired */, id.IsSessionScope(), false /* setStickyFlag */, createIfNotExist))
if (!SharedMemoryHelpers::EnsureDirectoryExists(filePath, true /* isGlobalLockAcquired */, createIfNotExist))
{
_ASSERTE(!createIfNotExist);
return nullptr;
......@@ -688,7 +677,7 @@ SharedMemoryProcessDataHeader *SharedMemoryProcessDataHeader::CreateOrOpen(
SharedMemoryHelpers::VerifyStringOperation(filePath.Append(id.GetName(), id.GetNameCharCount()));
bool createdFile;
int fileDescriptor = SharedMemoryHelpers::CreateOrOpenFile(filePath, createIfNotExist, id.IsSessionScope(), &createdFile);
int fileDescriptor = SharedMemoryHelpers::CreateOrOpenFile(filePath, createIfNotExist, &createdFile);
if (fileDescriptor == -1)
{
_ASSERTE(!createIfNotExist);
......@@ -1163,8 +1152,6 @@ void SharedMemoryManager::AcquireCreationDeletionFileLock()
if (!SharedMemoryHelpers::EnsureDirectoryExists(
*gSharedFilesPath,
false /* isGlobalLockAcquired */,
false /* hasCurrentUserAccessOnly */,
true /* setStickyFlag */,
false /* createIfNotExist */,
true /* isSystemDirectory */))
{
......@@ -1172,14 +1159,10 @@ void SharedMemoryManager::AcquireCreationDeletionFileLock()
}
SharedMemoryHelpers::EnsureDirectoryExists(
*s_runtimeTempDirectoryPath,
false /* isGlobalLockAcquired */,
false /* hasCurrentUserAccessOnly */,
false /* setStickyFlag */);
false /* isGlobalLockAcquired */);
SharedMemoryHelpers::EnsureDirectoryExists(
*s_sharedMemoryDirectoryPath,
false /* isGlobalLockAcquired */,
false /* hasCurrentUserAccessOnly */,
true /* setStickyFlag */);
false /* isGlobalLockAcquired */);
s_creationDeletionLockFileDescriptor = SharedMemoryHelpers::OpenDirectory(*s_sharedMemoryDirectoryPath);
if (s_creationDeletionLockFileDescriptor == -1)
{
......
......@@ -1117,7 +1117,7 @@ SharedMemoryProcessDataHeader *NamedMutexProcessData::CreateOrOpen(
SharedMemoryHelpers::BuildSharedFilesPath(lockFilePath, SHARED_MEMORY_LOCK_FILES_DIRECTORY_NAME);
if (created)
{
SharedMemoryHelpers::EnsureDirectoryExists(lockFilePath, true /* isGlobalLockAcquired */, false /* hasCurrentUserAccessOnly */, true /* setStickyFlag */);
SharedMemoryHelpers::EnsureDirectoryExists(lockFilePath, true /* isGlobalLockAcquired */);
}
// Create the session directory
......@@ -1126,7 +1126,7 @@ SharedMemoryProcessDataHeader *NamedMutexProcessData::CreateOrOpen(
SharedMemoryHelpers::VerifyStringOperation(id->AppendSessionDirectoryName(lockFilePath));
if (created)
{
SharedMemoryHelpers::EnsureDirectoryExists(lockFilePath, true /* isGlobalLockAcquired */, id->IsSessionScope(), false /* setStickyFlag */);
SharedMemoryHelpers::EnsureDirectoryExists(lockFilePath, true /* isGlobalLockAcquired */);
autoCleanup.m_lockFilePath = &lockFilePath;
autoCleanup.m_sessionDirectoryPathCharCount = lockFilePath.GetCount();
}
......@@ -1134,7 +1134,7 @@ SharedMemoryProcessDataHeader *NamedMutexProcessData::CreateOrOpen(
// Create or open the lock file
SharedMemoryHelpers::VerifyStringOperation(lockFilePath.Append('/'));
SharedMemoryHelpers::VerifyStringOperation(lockFilePath.Append(id->GetName(), id->GetNameCharCount()));
int lockFileDescriptor = SharedMemoryHelpers::CreateOrOpenFile(lockFilePath, created, id->IsSessionScope());
int lockFileDescriptor = SharedMemoryHelpers::CreateOrOpenFile(lockFilePath, created);
if (lockFileDescriptor == -1)
{
_ASSERTE(!created);
......
......@@ -5,7 +5,7 @@
<!-- Reference the outputs for the dependency nodes calculation. -->
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>4</ServicingVersion>
<!-- This is a meta package and doesn't contain any libs. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
......
......@@ -11,7 +11,7 @@
<Nullable>annotations</Nullable>
<IsPackable>true</IsPackable>
<!-- If you enable GeneratePackageOnBuild for this package and bump ServicingVersion, make sure to also bump ServicingVersion in Microsoft.Windows.Compatibility.csproj once for the next release. -->
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
......
......@@ -309,11 +309,11 @@
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Unix.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst'">
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.OSX.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\MacProxy.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
......@@ -413,7 +413,7 @@
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
</ItemGroup>
......
......@@ -12,7 +12,7 @@
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemNetSecurity_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TARGET_WINDOWS</DefineConstants>
<UseAndroidCrypto Condition="'$(TargetPlatformIdentifier)' == 'Android'">true</UseAndroidCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">true</UseAppleCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst'">true</UseAppleCrypto>
<UseManagedNtlm Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'tvOS'">true</UseManagedNtlm>
<DefineConstants Condition="'$(UseAndroidCrypto)' == 'true' or '$(UseAppleCrypto)' == 'true'">$(DefineConstants);SYSNETSECURITY_NO_OPENSSL</DefineConstants>
<GenAPIExcludeApiList>ReferenceAssemblyExclusions.txt</GenAPIExcludeApiList>
......
......@@ -5,7 +5,7 @@
namespace System.Reflection.Metadata.ApplyUpdate.Test
{
[AttributeUsage (AttributeTargets.Method, AllowMultiple=true)]
[AttributeUsage (AttributeTargets.Method | AttributeTargets.Class, AllowMultiple=true)]
public class MyDeleteAttribute : Attribute
{
public MyDeleteAttribute (string stringValue) { StringValue = stringValue; }
......@@ -19,6 +19,7 @@ public class MyDeleteAttribute : Attribute
public int IntValue {get; set; }
}
[MyDeleteAttribute ("xyz")]
public class ClassWithCustomAttributeDelete
{
[MyDeleteAttribute ("abcd")]
......
......@@ -5,7 +5,7 @@
namespace System.Reflection.Metadata.ApplyUpdate.Test
{
[AttributeUsage (AttributeTargets.Method, AllowMultiple=true)]
[AttributeUsage (AttributeTargets.Method | AttributeTargets.Class, AllowMultiple=true)]
public class MyDeleteAttribute : Attribute
{
public MyDeleteAttribute (string stringValue) { StringValue = stringValue; }
......
......@@ -200,18 +200,33 @@ public void CustomAttributeDelete()
{
var assm = typeof(System.Reflection.Metadata.ApplyUpdate.Test.ClassWithCustomAttributeDelete).Assembly;
Type attrType = typeof(System.Reflection.Metadata.ApplyUpdate.Test.MyDeleteAttribute);
Type preUpdateTy = assm.GetType("System.Reflection.Metadata.ApplyUpdate.Test.ClassWithCustomAttributeDelete");
Assert.NotNull(preUpdateTy);
// before the update the type has a MyDeleteAttribute on it
Attribute[] cattrs = Attribute.GetCustomAttributes(preUpdateTy, attrType);
Assert.NotNull(cattrs);
Assert.Equal(1, cattrs.Length);
ApplyUpdateUtil.ApplyUpdate(assm);
ApplyUpdateUtil.ClearAllReflectionCaches();
// Just check the updated value on one method
Type attrType = typeof(System.Reflection.Metadata.ApplyUpdate.Test.MyDeleteAttribute);
Type ty = assm.GetType("System.Reflection.Metadata.ApplyUpdate.Test.ClassWithCustomAttributeDelete");
Assert.NotNull(ty);
// After the update, the type has no MyDeleteAttribute on it anymore
cattrs = Attribute.GetCustomAttributes(ty, attrType);
Assert.NotNull(cattrs);
Assert.Equal(0, cattrs.Length);
// Just check the updated value on one method
MethodInfo mi1 = ty.GetMethod(nameof(System.Reflection.Metadata.ApplyUpdate.Test.ClassWithCustomAttributeDelete.Method1), BindingFlags.Public | BindingFlags.Static);
Assert.NotNull(mi1);
Attribute[] cattrs = Attribute.GetCustomAttributes(mi1, attrType);
cattrs = Attribute.GetCustomAttributes(mi1, attrType);
Assert.NotNull(cattrs);
Assert.Equal(0, cattrs.Length);
......
......@@ -11,7 +11,7 @@
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Unix' or '$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">$(DefineConstants);Unix</DefineConstants>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">true</UseAppleCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst'">true</UseAppleCrypto>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetPlatformIdentifier)' == 'Android'">
<UseAndroidCrypto>true</UseAndroidCrypto>
......
......@@ -13,7 +13,7 @@
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemSecurityCryptography_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<UseAndroidCrypto Condition="'$(TargetPlatformIdentifier)' == 'Android'">true</UseAndroidCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">true</UseAppleCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst'">true</UseAppleCrypto>
<UseOpenSsl Condition="'$(TargetPlatformIdentifier)' == 'Unix'">true</UseOpenSsl>
<UseOpenSslAead Condition="'$(UseOpenSsl)' == 'true' or '$(TargetPlatformIdentifier)' == 'OSX'">true</UseOpenSslAead>
<NeedOpenSslInitializer Condition="'$(UseOpenSslAead)' == 'true'">true</NeedOpenSslInitializer>
......
......@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<!-- Enable package baseline validation this when we release the 7.0.0 version. -->
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
......
......@@ -899,6 +899,14 @@ if(HOST_IOS OR HOST_ANDROID OR HOST_MACCAT)
else()
set(DISABLE_DLLMAP 1)
endif()
if(TARGET_DARWIN)
check_c_compiler_flag(-fno-objc-msgsend-selector-stubs COMPILER_SUPPORTS_FNO_OBJC_MSGSEND_SELECTOR_STUBS)
if(COMPILER_SUPPORTS_FNO_OBJC_MSGSEND_SELECTOR_STUBS)
set(CLR_CMAKE_COMMON_OBJC_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS} -fno-objc-msgsend-selector-stubs")
endif()
endif()
### End of OS specific checks
include_directories("${CLR_SRC_NATIVE_DIR}")
......
......@@ -1624,7 +1624,13 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, DeltaInfo *de
i++; /* skip the next record */
continue;
}
/* fallthru */
// don't expect to see any other func codes with this table
g_assert (func_code == ENC_FUNC_DEFAULT);
// If it's an addition, it's an added type definition, continue.
// If it's a modification, Roslyn sometimes sends this when a custom
// attribute is deleted from a type definition.
break;
}
default:
if (!is_addition) {
......@@ -2244,16 +2250,42 @@ apply_enclog_pass2 (Pass2Context *ctx, MonoImage *image_base, BaselineInfo *base
* especially since from the next generation's point of view
* that's what adding a field/method will be. */
break;
case ENC_FUNC_ADD_EVENT:
g_assert_not_reached (); /* FIXME: implement me */
default:
g_assert_not_reached (); /* unknown func_code */
}
break;
} else {
switch (func_code) {
case ENC_FUNC_DEFAULT:
// Roslyn sends this sometimes when it deletes a custom
// attribute. In this case no rows of the table def have
// should have changed from the previous generation.
// Note: we may want to check that Parent and Interfaces
// haven't changed. But note that's tricky to do: we can't
// just compare tokens: the parent could be a TypeRef token,
// and roslyn does send a new typeref row (that ends up
// referencing the same type definition). But we also don't
// want to convert to a `MonoClass*` too eagerly - if the
// class hasn't been used yet we don't want to kick off
// class initialization (which could mention the current
// class thanks to generic arguments - see class-init.c)
// Same with Interfaces. Fields and Methods in an EnC
// updated row are zero. So that only really leaves
// Attributes as the only column we can compare, which
// wouldn't tell us much (and perhaps in the future Roslyn
// could allow changing visibility, so we wouldn't want to
// compare for equality, anyway) So... we're done.
break;
case ENC_FUNC_ADD_METHOD:
case ENC_FUNC_ADD_FIELD:
/* modifying an existing class by adding a method or field, etc. */
break;
default:
/* not expecting anything else */
g_assert_not_reached ();
}
}
/* modifying an existing class by adding a method or field, etc. */
g_assert (!is_addition);
g_assert (func_code != ENC_FUNC_DEFAULT);
break;
}
case MONO_TABLE_NESTEDCLASS: {
......
......@@ -78,6 +78,9 @@ if(HAVE_SYS_ICU AND NOT HOST_WASI)
addprefix(icu_shim_sources "${ICU_SHIM_PATH}" "${icu_shim_sources_base}")
set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_DEFINITIONS OSX_ICU_LIBRARY_PATH="${OSX_ICU_LIBRARY_PATH}")
set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I\"${ICU_INCLUDEDIR}\" -I\"${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native/\" -I\"${CLR_SRC_NATIVE_DIR}/libs/Common/\" ${ICU_FLAGS}")
if(TARGET_DARWIN)
set_property(SOURCE "${ICU_SHIM_PATH}/pal_locale.m" APPEND_STRING PROPERTY COMPILE_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS}")
endif()
if(TARGET_WIN32)
set_source_files_properties(${icu_shim_sources} PROPERTIES LANGUAGE CXX)
endif()
......
......@@ -355,7 +355,7 @@ collect_field_info_nested (MonoClass *klass, GArray *fields_array, int offset, g
g_assert(info);
for (guint32 i = 0; i < info->num_fields; ++i) {
if (MONO_TYPE_ISSTRUCT (info->fields [i].field->type)) {
collect_field_info_nested (mono_class_from_mono_type_internal (info->fields [i].field->type), fields_array, info->fields [i].offset, pinvoke, unicode);
collect_field_info_nested (mono_class_from_mono_type_internal (info->fields [i].field->type), fields_array, (offset + info->fields [i].offset), pinvoke, unicode);
} else {
guint32 align;
StructFieldInfo f;
......@@ -365,7 +365,7 @@ collect_field_info_nested (MonoClass *klass, GArray *fields_array, int offset, g
info->fields [i].mspec,
&align, TRUE, unicode);
f.offset = offset + info->fields [i].offset;
if (i == info->num_fields - 1 && f.size + f.offset < info->native_size) {
if ((i == info->num_fields - 1) && ((f.size + f.offset) < info->native_size)) {
/* This can happen with .pack directives eg. 'fixed' arrays */
if (MONO_TYPE_IS_PRIMITIVE (f.type)) {
/* Replicate the last field to fill out the remaining place, since the code in add_valuetype () needs type information */
......
......@@ -62,6 +62,7 @@ set(NATIVEGLOBALIZATION_SOURCES
if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_locale.m)
set_source_files_properties(pal_locale.m PROPERTIES COMPILE_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS}")
endif()
# time zone names are filtered out of icu data for the browser and associated functionality is disabled
......
......@@ -39,13 +39,14 @@ set(NATIVE_SOURCES
if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
list (APPEND NATIVE_SOURCES pal_autoreleasepool.m)
set_source_files_properties(pal_autoreleasepool.m PROPERTIES COMPILE_FLAGS -fno-objc-arc)
set_source_files_properties(pal_autoreleasepool.m PROPERTIES COMPILE_FLAGS "-fno-objc-arc ${CLR_CMAKE_COMMON_OBJC_FLAGS}")
else()
list (APPEND NATIVE_SOURCES pal_autoreleasepool.c)
endif()
if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
list (APPEND NATIVE_SOURCES pal_environment.m)
set_source_files_properties(pal_environment.m PROPERTIES COMPILE_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS}")
else()
list (APPEND NATIVE_SOURCES pal_environment.c)
endif()
......@@ -53,12 +54,14 @@ endif()
if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
set(NATIVE_SOURCES ${NATIVE_SOURCES}
pal_datetime.m)
set_source_files_properties(pal_datetime.m PROPERTIES COMPILE_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS}")
endif()
if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
set(NATIVE_SOURCES ${NATIVE_SOURCES}
pal_log.m
pal_searchpath.m)
set_source_files_properties(pal_log.m pal_searchpath.m PROPERTIES COMPILE_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS}")
else ()
list (APPEND NATIVE_SOURCES
pal_searchpath.c
......@@ -69,6 +72,7 @@ endif ()
if (CLR_CMAKE_TARGET_MACCATALYST)
set(NATIVE_SOURCES ${NATIVE_SOURCES}
pal_iossupportversion.m)
set_source_files_properties(pal_iossupportversion.m PROPERTIES COMPILE_FLAGS "${CLR_CMAKE_COMMON_OBJC_FLAGS}")
else ()
list (APPEND NATIVE_SOURCES
pal_iossupportversion.c)
......
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Text;
public unsafe partial struct GameControllerButtonBind
{
public GameControllerButtonBind
(
GameControllerBindType? bindType = null,
GameControllerButtonBindValue? value = null
) : this()
{
if (bindType is not null)
{
BindType = bindType.Value;
}
if (value is not null)
{
Value = value.Value;
}
}
public GameControllerBindType BindType;
public GameControllerButtonBindValue Value;
}
public enum GameControllerBindType : int
{
ControllerBindtypeNone = 0x0,
ControllerBindtypeButton = 0x1,
ControllerBindtypeAxis = 0x2,
ControllerBindtypeHat = 0x3,
None = 0x0,
Button = 0x1,
Axis = 0x2,
Hat = 0x3,
}
[StructLayout(LayoutKind.Explicit)]
public unsafe partial struct GameControllerButtonBindValue
{
[FieldOffset(0)]
public int Button;
[FieldOffset(0)]
public int Axis;
[FieldOffset(0)]
public GameControllerButtonBindValueHat Hat;
}
public unsafe partial struct GameControllerButtonBindValueHat
{
public int Hat;
public int HatMask;
}
......@@ -1297,3 +1297,8 @@ extern "C" DLL_EXPORT Int32CLongStruct STDMETHODCALLTYPE AddCLongs(Int32CLongStr
{
return { lhs.i + rhs.i, lhs.l + rhs.l };
}
extern "C" DLL_EXPORT SDL_GameControllerBindType STDMETHODCALLTYPE getBindType(SDL_GameControllerButtonBind button)
{
return button.bindType;
}
......@@ -974,3 +974,26 @@ struct Int32CLongStruct
int32_t i;
long l;
};
typedef enum
{
SDL_CONTROLLER_BINDTYPE_NONE = 0,
SDL_CONTROLLER_BINDTYPE_BUTTON,
SDL_CONTROLLER_BINDTYPE_AXIS,
SDL_CONTROLLER_BINDTYPE_HAT
} SDL_GameControllerBindType;
typedef struct SDL_GameControllerButtonBind
{
SDL_GameControllerBindType bindType;
union
{
int button;
int axis;
struct {
int hat;
int hat_mask;
} hat;
} value;
} SDL_GameControllerButtonBind;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
using Xunit;
public class Managed
{
[DllImport("MarshalStructAsParam")]
static extern GameControllerBindType getBindType (GameControllerButtonBind button);
public static int Main()
{
GameControllerButtonBind button = new GameControllerButtonBind(GameControllerBindType.ControllerBindtypeAxis, null);
if (getBindType(button) == GameControllerBindType.ControllerBindtypeAxis)
{
Console.WriteLine("\nTEST PASSED!");
return 100;
}
else
{
Console.WriteLine("\nTEST FAILED!");
return 1;
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="NestedStruct.cs" />
<Compile Include="GameControllerButtonBind.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(TestSourceDir)Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj" />
<CMakeProjectReference Include="CMakeLists.txt" />
</ItemGroup>
</Project>
......@@ -4062,6 +4062,9 @@
<ExcludeList Include="$(XunitTestBinBase)/Interop/MonoAPI/**">
<Issue>mobile and wasm don't support tests with native libraries. wasm also needs static linking</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/StructMarshalling/PInvoke/NestedStruct/**">
<Issue>https://github.com/dotnet/runtime/issues/64127</Issue>
</ExcludeList>
</ItemGroup>
<Target Name="GetFilteredExcludeList" Returns="@(FilteredExcludeList)">
......