Skip to content
Closed
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
6 changes: 3 additions & 3 deletions eng/WpfArcadeSdk/tools/CodeGen/AvTrace/AvTraceMessages.tt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace MS.Internal
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -102,7 +102,7 @@ namespace MS.Internal
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -168,4 +168,4 @@ void OutputTraceCreation(int id, XElement traceDetails)
_<#= traceDetails.Attribute("Name").Value #> = new AvTraceDetails(<#=id#>, new string[] { <#= dataString #> } );
<#+
}
#>
#>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define __COMMON_H

#include "precomp.hxx"
#include <vcclr.h>

using namespace System::Security;

Expand Down Expand Up @@ -64,7 +65,7 @@ private ref class Util sealed

__declspec(noinline) const cli::interior_ptr<const System::Char> static GetPtrToStringChars(System::String^ s)
{
return CriticalPtrToStringChars(s);
return PtrToStringChars(s);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
{
System::String^ uriString = uri->AbsoluteUri;
IDWriteFontCollection* dwriteFontCollection = NULL;
pin_ptr<const WCHAR> uriPathWChar = CriticalPtrToStringChars(uriString);
pin_ptr<const WCHAR> uriPathWChar = PtrToStringChars(uriString);

IntPtr pIDWriteFontCollectionLoaderMirror = Marshal::GetComInterfaceForObject(
_wpfFontCollectionLoader,
Expand Down Expand Up @@ -301,7 +301,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
if (isLocal)
{
//Protect the pointer to the filepath from being moved around by the garbage collector.
pin_ptr<const WCHAR> uriPathWChar = CriticalPtrToStringChars(filePathUri->LocalPath);
pin_ptr<const WCHAR> uriPathWChar = PtrToStringChars(filePathUri->LocalPath);

// DWrite currently has a slow lookup for the last write time, which
// introduced a noticable perf regression when we switched over.
Expand Down Expand Up @@ -387,7 +387,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
{
System::String^ filePath = filePathUri->AbsoluteUri;
//Protect the pointer to the filepath from being moved around by the garbage collector.
pin_ptr<const WCHAR> uriPathWChar = CriticalPtrToStringChars(filePath);
pin_ptr<const WCHAR> uriPathWChar = PtrToStringChars(filePath);

IntPtr pIDWriteFontFileLoaderMirror = Marshal::GetComInterfaceForObject(
fontFileLoader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

#include "FontCollection.h"
#include <wpfvcclr.h>

namespace MS { namespace Internal { namespace Text { namespace TextInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

#include "LocalizedStrings.h"
#include "wpfvcclr.h"

namespace MS { namespace Internal { namespace Text { namespace TextInterface
{
Expand Down Expand Up @@ -144,7 +143,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface
}
else
{
pin_ptr<const wchar_t> localeNameWChar = CriticalPtrToStringChars(localeName);
pin_ptr<const wchar_t> localeNameWChar = PtrToStringChars(localeName);
BOOL exists = FALSE;
UINT32 localeNameIndex = 0;
HRESULT hr = _localizedStrings->Value->FindLocaleName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "precomp.hxx"
#include "util2.h"
#include <wpfvcclr.h>


namespace MS { namespace Internal { namespace FontCache {

Expand All @@ -15,7 +13,7 @@ bool Util2::GetRegistryKeyLastWriteTimeUtc(System::String ^ registryKey, [System
{
HKEY hkey = NULL;

pin_ptr<const wchar_t> registryKeyUnmanaged = CriticalPtrToStringChars(registryKey);
pin_ptr<const wchar_t> registryKeyUnmanaged = PtrToStringChars(registryKey);

if (::RegOpenKeyExW(HKEY_LOCAL_MACHINE, registryKeyUnmanaged, 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include <vcclr.h>

namespace MS { namespace Internal { namespace FontCache {

Expand Down
61 changes: 0 additions & 61 deletions src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/wpfvcclr.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a generated file (see comment at the top of the file). You need to make these changes in the template as well, or they'll get overwritten the next time the template changes.

The right way to do this change is:
a. Change the template file AvTraceMessages.tt
b. Re-run the generator to propagate the changes to the 3 AvTraceMessages.cs files (for Base, Core, and FW).
c. Check in all 4 changed files.
I think step (b) happens automatically at the start of a full build, but you should verify that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamBent Thank you and I fix it in #2843

}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -106,7 +106,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -266,7 +266,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -290,7 +290,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Serializer(Type type)
Invariant.Assert(_attribute != null, "Internal Serializer used for a type with no XmlRootAttribute.");

// Get the default constructor for the type
_ctor = type.GetConstructor(new Type[0]);
_ctor = type.GetConstructor(Array.Empty<Type>());
}

/// <summary>
Expand Down Expand Up @@ -90,7 +90,7 @@ public object Deserialize(XmlReader reader)
{
Invariant.Assert(reader != null);

IXmlSerializable serializable = (IXmlSerializable)_ctor.Invoke(new object[0]);
IXmlSerializable serializable = (IXmlSerializable)_ctor.Invoke(Array.Empty<object>());

// If this is a brand-new stream we need to jump into it
if (reader.ReadState == ReadState.Initial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -1370,7 +1370,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -1474,7 +1474,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -1498,7 +1498,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -1714,7 +1714,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -1738,7 +1738,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -2010,7 +2010,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -2034,7 +2034,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -2096,7 +2096,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -2120,7 +2120,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down Expand Up @@ -2258,7 +2258,7 @@ static public void Trace( TraceEventType type, AvTraceDetails traceDetails, para
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
Expand All @@ -2282,7 +2282,7 @@ static public void TraceActivityItem( AvTraceDetails traceDetails, params Object
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ private System.Windows.Media.Int32Collection GetInt32Collection()
int capacity = reader.ReadInt32();
if (capacity < 0)
{
throw new ArgumentException(SR.Get(SRID.IntegerCollectionLengthLessThanZero, new object[0]));
throw new ArgumentException(SR.Get(SRID.IntegerCollectionLengthLessThanZero, Array.Empty<object>()));
}
System.Windows.Media.Int32Collection ints = new System.Windows.Media.Int32Collection(capacity);
switch (type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Baml2006SchemaContext(Assembly localAssembly):
}

internal Baml2006SchemaContext(Assembly localAssembly, XamlSchemaContext parentSchemaContext)
: base(new Assembly[0])
: base(Array.Empty<Assembly>())
{
_localAssembly = localAssembly;
_parentSchemaContext = parentSchemaContext;
Expand Down
Loading