Skip to content
Open
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
8 changes: 7 additions & 1 deletion Stack/Core/Stack/Bindings/BufferManager.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ public BufferManager(string name, int maxPoolSize, int maxBufferSize)
/// <param name="owner">The owner.</param>
/// <returns>The buffer content</returns>
public byte[] TakeBuffer(int size, string owner)
{
{
#if ELBFISCH //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
//a size of 65535 which is given by several owners for any reason fails at runtime
if (size > 65534) {
size = 65534;
}
#endif
if (size > Int32.MaxValue - 5)
{
throw new ArgumentOutOfRangeException("size");
Expand Down
7 changes: 5 additions & 2 deletions Stack/Core/Types/Encoders/BinaryDecoder.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,11 @@ public XmlElement ReadXmlElement(string fieldName)
XmlDocument document = new XmlDocument();
string xmlString = new UTF8Encoding().GetString(bytes, 0, bytes.Length);

using (XmlReader reader = XmlReader.Create(new StringReader(xmlString), new XmlReaderSettings()
{DtdProcessing = System.Xml.DtdProcessing.Prohibit, ValidationType = ValidationType.None}))
using (XmlReader reader = XmlReader.Create(new StringReader(xmlString), new XmlReaderSettings()
#if !ELBFISCH //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
{DtdProcessing = System.Xml.DtdProcessing.Prohibit, ValidationType = ValidationType.None}
#endif
))
{
document.Load(reader);
}
Expand Down
10 changes: 8 additions & 2 deletions Stack/Core/Types/Encoders/XmlDecoder.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ public object ReadExtensionObjectBody(ExpandedNodeId typeId)
xmlString = m_reader.ReadOuterXml();

using (XmlReader reader = XmlReader.Create(new StringReader(xmlString), new XmlReaderSettings()
{ DtdProcessing = System.Xml.DtdProcessing.Prohibit, ValidationType = ValidationType.None }))
#if !ELBFISCH //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
{ DtdProcessing = System.Xml.DtdProcessing.Prohibit, ValidationType = ValidationType.None }
#endif
))
{
document.Load(reader);
}
Expand All @@ -585,7 +588,10 @@ public object ReadExtensionObjectBody(ExpandedNodeId typeId)
xmlString = m_reader.ReadOuterXml();

using (XmlReader reader = XmlReader.Create(new StringReader(xmlString), new XmlReaderSettings()
{ DtdProcessing = System.Xml.DtdProcessing.Prohibit, ValidationType = ValidationType.None }))
#if !ELBFISCH //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
{ DtdProcessing = System.Xml.DtdProcessing.Prohibit, ValidationType = ValidationType.None }
#endif
))
{
document.Load(reader);
}
Expand Down
14 changes: 8 additions & 6 deletions Stack/Core/Types/Utils/HiResClock.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public static DateTime UtcNow
{
get
{
#if !SILVERLIGHT
#if (!SILVERLIGHT && !ELBFISCH) //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
if (s_Default.m_disabled)
{
return DateTime.UtcNow;
}

long counter = 0;

if (NativeMethods.QueryPerformanceCounter(out counter) == 0)
if (NativeMethods.QueryPerformanceCounter(out counter) == 0)
{
return DateTime.UtcNow;
}
Expand Down Expand Up @@ -71,12 +71,12 @@ public static bool Disabled
}
}

/// <summary>
/// <summary>
/// Constructs a class.
/// </summary>
private HiResClock()
{
#if !SILVERLIGHT
#if (!SILVERLIGHT && !ELBFISCH) //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
if (NativeMethods.QueryPerformanceFrequency(out m_frequency) == 0)
{
m_frequency = TimeSpan.TicksPerSecond;
Expand All @@ -101,16 +101,18 @@ private HiResClock()
/// <summary>
/// Defines the native methods used by the class.
/// </summary>
private static class NativeMethods
#if !ELBFISCH
private static class NativeMethods
{
[DllImport("Kernel32.dll")]
public static extern int QueryPerformanceFrequency(out long lpFrequency);

[DllImport("Kernel32.dll")]
public static extern int QueryPerformanceCounter(out long lpFrequency);
}
#endif

#if !SILVERLIGHT
#if !SILVERLIGHT && !ELBFISCH //#define ELBFISCH if you want to compile this code for Mono/.NET 3.5 (for use in Unity3D 5.5)
private long m_frequency;
private long m_baseline;
private long m_offset;
Expand Down
12 changes: 4 additions & 8 deletions Stack/Core/UA Core Library.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7543AFCB-F5AF-44AF-83C9-23164474C1E9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Opc.Ua</RootNamespace>
<AssemblyName>Opc.Ua.Core</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Key\OPC Key Pair.snk</AssemblyOriginatorKeyFile>
Expand Down Expand Up @@ -41,12 +39,10 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG;ELBFISCH</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DocumentationFile>
</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand All @@ -61,7 +57,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
Expand All @@ -83,6 +78,7 @@
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Documentation\Opc.Ua.Bindings.cs" />
Expand Down
12 changes: 12 additions & 0 deletions UA Core Library.userprefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Properties StartupItem="Stack/Core/UA Core Library.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="Stack/Core/Types/Encoders/BinaryDecoder.cs">
<Files>
<File FileName="Stack/Core/Types/Encoders/BinaryDecoder.cs" Line="471" Column="7" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
</Properties>