Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d802116
Merge pull request #88652 from dotnet-maestro-bot/merge/release/7.0-t…
carlossanlop Jul 12, 2023
8d57046
[release/7.0-staging] Update dependencies from dotnet/arcade dotnet/i…
dotnet-maestro[bot] Jul 13, 2023
3aae244
[7.0] Backport "Fix MSBuild integration for the host build with CMake…
carlossanlop Jul 14, 2023
216f6ee
Skip RC2 encrypted PKCS12 files on Android for iteration counting (#8…
vcsjones Jul 17, 2023
028dc4f
[TestOnly] port test fixes (#89065)
tarekgh Jul 18, 2023
a00d6ad
[release/7.0-staging] Zlib: Update zlib to v1.2.13, intel-zlib to v1.…
github-actions[bot] Jul 27, 2023
a75fb66
[release/7.0-staging] [Mono] Look for Native Signal SIMD Context (#89…
github-actions[bot] Jul 27, 2023
a6b4969
Write perfmap and jitdump files to /tmp by default [7.0 port] (#89053)
tommcdon Jul 29, 2023
7e80916
Update dependencies from https://github.com/dotnet/xharness build 202…
dotnet-maestro[bot] Aug 1, 2023
b075459
[release/7.0-staging] Update dependencies from dotnet/hotreload-utils…
dotnet-maestro[bot] Aug 2, 2023
fd26be1
Merge branch 'release/7.0-staging' into merge/release/7.0-to-release/…
carlossanlop Aug 2, 2023
395c507
[release/7.0-staging] Zlib: Add some protections to the allocator use…
github-actions[bot] Aug 3, 2023
a8c0b1f
Merge pull request #89815 from dotnet-maestro-bot/merge/release/7.0-t…
carlossanlop Aug 3, 2023
6f5b364
[wasm][debugger] Set VSTEST_TESTHOST_SHUTDOWN_TIMEOUT to 2s (#89862)
github-actions[bot] Aug 4, 2023
7625c2d
Merge branch 'release/7.0-staging' into merge/release/7.0-to-release/…
carlossanlop Aug 8, 2023
09a0d63
Merge pull request #90190 from dotnet-maestro-bot/merge/release/7.0-t…
carlossanlop Aug 9, 2023
adaa449
Update dependencies from https://github.com/dotnet/xharness build 202…
dotnet-maestro[bot] Aug 9, 2023
c47d0ab
[release/7.0-staging] Update dependencies from dotnet/arcade dotnet/i…
dotnet-maestro[bot] Aug 10, 2023
fca7eda
[release/7.0-staging] Fix COM object leak (#89795)
github-actions[bot] Aug 10, 2023
078e669
SBLK_MASK_LOCK_THREADID allow tid up to 65535 (#88772) (#89335)
cshung Aug 10, 2023
df0930c
JIT: don't dead store OSR exposed locals (#89867)
AndyAyersMS Aug 10, 2023
ceb98e1
Update ds-ipc-pal-namedpipe to fix shutdown race (#89620)
hoyosjs Aug 11, 2023
97b2eca
Rework on 88919 as suggested by @vitek-karas (#89962)
github-actions[bot] Aug 14, 2023
8233a86
[mono][aot] Use g_strcasecmp () to check whenever aot input assemblie…
github-actions[bot] Aug 14, 2023
95bbb74
Update dependencies from https://github.com/dotnet/hotreload-utils bu…
dotnet-maestro[bot] Aug 14, 2023
adf53f7
Merge branch 'release/7.0' into release/7.0-staging
carlossanlop Aug 15, 2023
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
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ https://github.com/madler/zlib
https://zlib.net/zlib_license.html

/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.12, March 27th, 2022
version 1.2.13, October 13th, 2022

Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler

Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-rtm.23315.2">
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-rtm.23409.2">
<Uri>https://github.com/dotnet/icu</Uri>
<Sha>a7de1bebfa53d0f958e588633664ce008b78adf2</Sha>
<Sha>d7b56b550d4e8319a6851ad2f2544450d521e0ed</Sha>
</Dependency>
<Dependency Name="System.Net.MsQuic.Transport" Version="7.0.0-alpha.1.22459.1">
<Uri>https://github.com/dotnet/msquic</Uri>
Expand Down Expand Up @@ -242,9 +242,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>e680411c22e33f45821f4ae64365a2970b2430a6</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="7.0.100-1.23321.1">
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="7.0.100-1.23401.1">
<Uri>https://github.com/dotnet/linker</Uri>
<Sha>13a94b5bdc9d01ecd9eb2bd699bd34d597c3ec19</Sha>
<Sha>53b3303c57b3fe659500fb362a0eef12991c1197</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="7.0.0-prerelease.23407.3">
<Uri>https://github.com/dotnet/xharness</Uri>
Expand Down Expand Up @@ -278,9 +278,9 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>5e0b0da43f660de5798186f4fd3bc900fc90576c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="7.0.0-alpha.0.23316.2">
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="7.0.0-alpha.0.23411.1">
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
<Sha>0595e15def6557a758879ba1b48f95b9e08a6463</Sha>
<Sha>7ec0899e4d94a3d7e80ccce394fc643500c9756c</Sha>
</Dependency>
<Dependency Name="System.Runtime.Numerics.TestData" Version="7.0.0-beta.23179.6">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>7.0.0-prerelease.23407.3</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>7.0.0-prerelease.23407.3</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>7.0.0-prerelease.23407.3</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>7.0.0-alpha.0.23226.5</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>7.0.0-alpha.0.23411.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<XUnitVersion>2.4.2</XUnitVersion>
<XUnitAnalyzersVersion>1.0.0</XUnitAnalyzersVersion>
<XUnitRunnerVisualStudioVersion>2.4.5</XUnitRunnerVisualStudioVersion>
Expand All @@ -174,10 +174,10 @@
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>7.0.0-preview-20221010.1</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
<MicrosoftNETILLinkTasksVersion>7.0.100-1.23321.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkTasksVersion>7.0.100-1.23401.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-rtm.23315.2</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-rtm.23409.2</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicVersion>2.2.2</MicrosoftNativeQuicMsQuicVersion>
<SystemNetMsQuicTransportVersion>7.0.0-alpha.1.22459.1</SystemNetMsQuicTransportVersion>
Expand Down
15 changes: 14 additions & 1 deletion eng/native/ijw/IJW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,21 @@ if (CLR_CMAKE_HOST_WIN32)
set_target_properties(${targetName} PROPERTIES COMPILE_OPTIONS "${compileOptions}")
endfunction()

function(add_ijw_msbuild_project_properties targetName ijwhost_target)
# When we're building with MSBuild, we need to set some project properties
# in case CMake has decided to use the SDK support.
# We're dogfooding things, so we need to set settings in ways that the product doesn't quite support.
# We don't actually need an installed/available target framework version here
# since we are disabling implicit framework references. We just need a valid value, and net7.0 is valid.
set_target_properties(${targetName} PROPERTIES
DOTNET_TARGET_FRAMEWORK net7.0
VS_GLOBAL_DisableImplicitFrameworkReferences true
VS_GLOBAL_GenerateRuntimeConfigurationFiles false
VS_PROJECT_IMPORT "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/SetIJWProperties.props")
endfunction()

# 4365 - signed/unsigned mismatch
# 4679 - Could not import member. This is an issue with IJW and static abstract methods in interfaces.
# 4679 - Could not import member. This is an issue with IJW and static abstract methods in interfaces.
add_compile_options(/wd4365 /wd4679)

# IJW
Expand Down
6 changes: 6 additions & 0 deletions eng/native/ijw/SetIJWProperties.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- The C++/CLI targets don't let us set this in the project file where CMake lets us set project properties, so we set it in an imported project file where it will work. -->
<UseIJWHost>false</UseIJWHost>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ProfAPI_ValidateNGENInstrumentation, W("Pro

#ifdef FEATURE_PERFMAP
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapEnabled, W("PerfMapEnabled"), 0, "This flag is used on Linux to enable writing /tmp/perf-$pid.map. It is disabled by default")
RETAIL_CONFIG_STRING_INFO(EXTERNAL_PerfMapJitDumpPath, W("PerfMapJitDumpPath"), "Specifies a path to write the perf jitdump file. Defaults to GetTempPathA()")
RETAIL_CONFIG_STRING_INFO(EXTERNAL_PerfMapJitDumpPath, W("PerfMapJitDumpPath"), "Specifies a path to write the perf jitdump file. Defaults to /tmp")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapIgnoreSignal, W("PerfMapIgnoreSignal"), 0, "When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs. It is disabled by default")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapShowOptimizationTiers, W("PerfMapShowOptimizationTiers"), 1, "Shows optimization tiers in the perf map for methods, as part of the symbol name. Useful for seeing separate stack frames for different optimization tiers of each method.")
RETAIL_CONFIG_STRING_INFO(EXTERNAL_NativeImagePerfMapFormat, W("NativeImagePerfMapFormat"), "Specifies the format of native image perfmap files generated by crossgen. Valid options are RVA or OFFSET.")
Expand Down
6 changes: 6 additions & 0 deletions src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ void Compiler::lvaInitTypeRef()
{
lvaSetVarAddrExposed(lclNum DEBUGARG(AddressExposedReason::OSR_EXPOSED));
}

// Ensure that ref counts for exposed OSR locals take into account
// that some of the refs might be in the Tier0 parts of the method
// that get trimmed away.
//
varDsc->lvImplicitlyReferenced = 1;
}
}
}
Expand Down
10 changes: 2 additions & 8 deletions src/coreclr/vm/perfinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@
#include "perfinfo.h"
#include "pal.h"

PerfInfo::PerfInfo(int pid)
PerfInfo::PerfInfo(int pid, const char* basePath)
: m_Stream(nullptr)
{
LIMITED_METHOD_CONTRACT;

SString tempPath;
if (!WszGetTempPath(tempPath))
{
return;
}

SString path;
path.Printf("%Sperfinfo-%d.map", tempPath.GetUnicode(), pid);
path.Printf("%s/perfinfo-%d.map", basePath, pid);
OpenFile(path);
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/perfinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class PerfInfo {
public:
PerfInfo(int pid);
PerfInfo(int pid, const char* basePath);
~PerfInfo();
void LogImage(PEAssembly* pPEAssembly, WCHAR* guid);

Expand Down
91 changes: 51 additions & 40 deletions src/coreclr/vm/perfmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@

#define FMT_CODE_ADDR "%p"

#ifndef __ANDROID__
#define TEMP_DIRECTORY_PATH "/tmp"
#else
// On Android, "/tmp/" doesn't exist; temporary files should go to
// /data/local/tmp/
#define TEMP_DIRECTORY_PATH "/data/local/tmp"
#endif

Volatile<bool> PerfMap::s_enabled = false;
PerfMap * PerfMap::s_Current = nullptr;
bool PerfMap::s_ShowOptimizationTiers = false;
Expand All @@ -37,55 +45,64 @@ void PerfMap::Initialize()
{
LIMITED_METHOD_CONTRACT;

const DWORD perfMapEnabled = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapEnabled);
if (perfMapEnabled == DISABLED)
{
return;
}

// Build the path to the map file on disk.
char tempPathBuffer[MAX_LONGPATH+1];
const char* tempPath = InternalConstructPath(tempPathBuffer, sizeof(tempPathBuffer));

// Only enable the map if requested.
if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapEnabled) == ALL || CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapEnabled) == PERFMAP)
if (perfMapEnabled == ALL || perfMapEnabled == PERFMAP)
{
// Get the current process id.
int currentPid = GetCurrentProcessId();

// Create the map.
s_Current = new PerfMap(currentPid);
s_Current = new PerfMap(currentPid, tempPath);

int signalNum = (int) CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapIgnoreSignal);

if (signalNum > 0)
{
PAL_IgnoreProfileSignal(signalNum);
}

if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapShowOptimizationTiers) != 0)
{
s_ShowOptimizationTiers = true;
}

s_enabled = true;
}

if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapEnabled) == ALL || CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapEnabled) == JITDUMP)
// only enable JitDumps if requested
if (perfMapEnabled == ALL || perfMapEnabled == JITDUMP)
{
const char* jitdumpPath;
char jitdumpPathBuffer[4096];
PAL_PerfJitDump_Start(tempPath);
}

CLRConfigNoCache value = CLRConfigNoCache::Get("PerfMapJitDumpPath");
if (value.IsSet())
{
jitdumpPath = value.AsString();
}
else
{
GetTempPathA(sizeof(jitdumpPathBuffer) - 1, jitdumpPathBuffer);
jitdumpPath = jitdumpPathBuffer;
}
if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapShowOptimizationTiers) != 0)
{
s_ShowOptimizationTiers = true;
}

s_enabled = true;
}

PAL_PerfJitDump_Start(jitdumpPath);
// InternalConstructPath is guaranteed to return a non-null path
// the function uses the input buffer only whe PerfMapJitDumpPath environment variable is set
const char * PerfMap::InternalConstructPath(char *tmpBuf, int lenBuf)
{
DWORD len = GetEnvironmentVariableA("DOTNET_PerfMapJitDumpPath", tmpBuf, lenBuf);
if (len == 0)
{
len = GetEnvironmentVariableA("COMPlus_PerfMapJitDumpPath", tmpBuf, lenBuf);
}

if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PerfMapShowOptimizationTiers) != 0)
{
s_ShowOptimizationTiers = true;
}

s_enabled = true;
if (len == 0 || // GetEnvironmentVariableA returns 0 if the variable is not found,
len >= lenBuf) // or the length of the string not including the null terminator on success.
{
return TEMP_DIRECTORY_PATH;
}

return tmpBuf;
}

// Destroy the map for the process - called from EEShutdownHelper.
Expand All @@ -102,27 +119,21 @@ void PerfMap::Destroy()
}

// Construct a new map for the process.
PerfMap::PerfMap(int pid)
PerfMap::PerfMap(int pid, const char* path)
{
LIMITED_METHOD_CONTRACT;

// Initialize with no failures.
m_ErrorEncountered = false;

// Build the path to the map file on disk.
WCHAR tempPath[MAX_LONGPATH+1];
if(!GetTempPathW(MAX_LONGPATH, tempPath))
{
return;
}

SString path;
path.Printf("%Sperf-%d.map", &tempPath, pid);
SString pathFile;
pathFile.Printf("%s/perf-%d.map", path, pid);

// Open the map file for writing.
OpenFile(path);
OpenFile(pathFile);

m_PerfInfo = new PerfInfo(pid);
m_PerfInfo = new PerfInfo(pid, path);
}

// Construct a new map without a specified file name.
Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/vm/perfmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class PerfMap
bool m_ErrorEncountered;

// Construct a new map for the specified pid.
PerfMap(int pid);
PerfMap(int pid, const char* path);

// Default to /tmp or use DOTNET_PerfMapJitDumpPath if set
static const char* InternalConstructPath(char *tmpBuf, int lenBuf);

protected:
// Indicates whether optimization tiers should be shown for methods in perf maps
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/vm/syncblk.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ typedef DPTR(EnCSyncBlockInfo) PTR_EnCSyncBlockInfo;
#define BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX 0x08000000

// if BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX is clear, the rest of the header dword is laid out as follows:
// - lower ten bits (bits 0 thru 9) is thread id used for the thin locks
// - lower sixteen bits (bits 0 thru 15) is thread id used for the thin locks
// value is zero if no thread is holding the lock
// - following six bits (bits 10 thru 15) is recursion level used for the thin locks
// - following six bits (bits 16 thru 21) is recursion level used for the thin locks
// value is zero if lock is not taken or only taken once by the same thread
#define SBLK_MASK_LOCK_THREADID 0x000003FF // special value of 0 + 1023 thread ids
#define SBLK_MASK_LOCK_RECLEVEL 0x0000FC00 // 64 recursion levels
#define SBLK_LOCK_RECLEVEL_INC 0x00000400 // each level is this much higher than the previous one
#define SBLK_RECLEVEL_SHIFT 10 // shift right this much to get recursion level
#define SBLK_MASK_LOCK_THREADID 0x0000FFFF // special value of 0 + 65535 thread ids
#define SBLK_MASK_LOCK_RECLEVEL 0x003F0000 // 64 recursion levels
#define SBLK_LOCK_RECLEVEL_INC 0x00010000 // each level is this much higher than the previous one
#define SBLK_RECLEVEL_SHIFT 16 // shift right this much to get recursion level

// add more bits here... (adjusting the following mask to make room)

Expand Down
2 changes: 1 addition & 1 deletion src/installer/pkg/THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ https://github.com/madler/zlib
https://zlib.net/zlib_license.html

/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.12, March 27th, 2022
version 1.2.13, October 13th, 2022

Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<!-- Reference the outputs for the dependency nodes calculation. -->
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>3</ServicingVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>4</ServicingVersion>
<!-- This is a meta package and doesn't contain any libs. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.</PackageDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<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>false</GeneratePackageOnBuild>
<ServicingVersion>0</ServicingVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
<PackageDescription>Provides uniform access and manipulation of user, computer, and group security principals across the multiple principal stores: Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM).</PackageDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ internal static class UnsafeNativeMethods
{
public static int ADsOpenObject(string path, string userName, string password, int flags, [In, Out] ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out object ppObject)
{
IntPtr ppObjPtr = IntPtr.Zero;
try
{
int hr = Interop.Activeds.ADsOpenObject(path, userName, password, flags, ref iid, out IntPtr ppObjPtr);
int hr = Interop.Activeds.ADsOpenObject(path, userName, password, flags, ref iid, out ppObjPtr);
ppObject = Marshal.GetObjectForIUnknown(ppObjPtr);
return hr;
}
catch (EntryPointNotFoundException)
{
throw new InvalidOperationException(SR.AdsiNotInstalled);
}
finally
{
if (ppObjPtr != IntPtr.Zero)
{
Marshal.Release(ppObjPtr);
}
}
}

//
Expand Down
Loading