* Update existing COM test assets (native/managed) to share CLSIDs with other projects.
* Update Interop.settings.targets
None of these test changes apply to Ubuntu ARM
<Compile Include="StringTests.cs" />
<Compile Include="../../ServerContracts/Primitives.cs" />
<Compile Include="../../ServerContracts/PrimitivesNativeServer.cs" />
+ <Compile Include="../../ServerContracts/ServerGuids.cs" />
<Compile Include="../../../common/Assertion.cs" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="ImportedTypes.cs" />
+ <Compile Include="../ServerContracts/ServerGuids.cs" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
#include <cstdint>
#include "Servers.h"
-class DECLSPEC_UUID("B99ABE6A-DFF6-440F-BFB6-55179B8FE18E") ArrayTesting : public UnknownImpl, public IArrayTesting
+class ArrayTesting : public UnknownImpl, public IArrayTesting
{
private:
template<typename L, typename D>
#include "Servers.h"
-class DECLSPEC_UUID("71CF5C45-106C-4B32-B418-43A463C6041F") ErrorMarshalTesting : public UnknownImpl, public IErrorMarshalTesting
+class ErrorMarshalTesting : public UnknownImpl, public IErrorMarshalTesting
{
public: // IErrorMarshalTesting
DEF_RAWFUNC(Throw_HResult)(
#pragma once
#include <type_traits>
+#include <limits>
#include "Servers.h"
-class DECLSPEC_UUID("53169A33-E85D-4E3C-B668-24E438D0929B") NumericTesting : public UnknownImpl, public INumericTesting
+class NumericTesting : public UnknownImpl, public INumericTesting
{
public:
DEF_RAWFUNC(Add_Byte)(
#pragma once
-#include "ComHelpers.h"
+#include <xplatform.h>
//#import "Server.Contract.tlb" no_namespace
#include <Server.Contracts.tlh>
-#define DEF_RAWFUNC(n) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE raw_ ## n
-#define DEF_FUNC(n) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE ## n
+// Forward declare servers so COM clients can reference the CLSIDs
+class DECLSPEC_UUID("53169A33-E85D-4E3C-B668-24E438D0929B") NumericTesting;
+class DECLSPEC_UUID("B99ABE6A-DFF6-440F-BFB6-55179B8FE18E") ArrayTesting;
+class DECLSPEC_UUID("C73C83E8-51A2-47F8-9B5C-4284458E47A6") StringTesting;
+class DECLSPEC_UUID("71CF5C45-106C-4B32-B418-43A463C6041F") ErrorMarshalTesting;
-#include "NumericTesting.h"
-#include "ArrayTesting.h"
-#include "StringTesting.h"
-#include "ErrorMarshalTesting.h"
+#define CLSID_NumericTesting __uuidof(NumericTesting)
+#define CLSID_ArrayTesting __uuidof(ArrayTesting)
+#define CLSID_StringTesting __uuidof(StringTesting)
+#define CLSID_ErrorMarshalTesting __uuidof(ErrorMarshalTesting)
+
+#define IID_INumericTesting __uuidof(INumericTesting)
+#define IID_IArrayTesting __uuidof(IArrayTesting)
+#define IID_IStringTesting __uuidof(IStringTesting)
+#define IID_IErrorMarshalTesting __uuidof(IErrorMarshalTesting)
+
+#ifndef COM_CLIENT
+ #include "ComHelpers.h"
+
+ #define DEF_RAWFUNC(n) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE raw_ ## n
+ #define DEF_FUNC(n) virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE ## n
+
+ #include "NumericTesting.h"
+ #include "ArrayTesting.h"
+ #include "StringTesting.h"
+ #include "ErrorMarshalTesting.h"
+#endif
#include "Servers.h"
-class DECLSPEC_UUID("C73C83E8-51A2-47F8-9B5C-4284458E47A6") StringTesting : public UnknownImpl, public IStringTesting
+class StringTesting : public UnknownImpl, public IStringTesting
{
private:
template <typename STRING>
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
-// Windows Header Files
-#include <windows.h>
+#include <xplatform.h>
#include <atomic>
#include <memory>
/// Managed activation for CoClass
/// </summary>
[ComImport]
- [Guid("53169A33-E85D-4E3C-B668-24E438D0929B")]
+ [Guid(Server.Contract.Guids.NumericTesting)]
internal class NumericTestingClass
{
}
/// Managed activation for CoClass
/// </summary>
[ComImport]
- [Guid("B99ABE6A-DFF6-440F-BFB6-55179B8FE18E")]
+ [Guid(Server.Contract.Guids.ArrayTesting)]
internal class ArrayTestingClass
{
}
/// Managed activation for CoClass
/// </summary>
[ComImport]
- [Guid("C73C83E8-51A2-47F8-9B5C-4284458E47A6")]
+ [Guid(Server.Contract.Guids.StringTesting)]
internal class StringTestingClass
{
}
/// Managed activation for CoClass
/// </summary>
[ComImport]
- [Guid("71CF5C45-106C-4B32-B418-43A463C6041F")]
+ [Guid(Server.Contract.Guids.ErrorMarshalTesting)]
internal class ErrorMarshalTestingClass
{
}
--- /dev/null
+// 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.
+
+namespace Server.Contract
+{
+ /// <summary>
+ /// Guids for all COM Servers
+ /// </summary>
+ internal sealed class Guids
+ {
+ public const string NumericTesting = "53169A33-E85D-4E3C-B668-24E438D0929B";
+ public const string ArrayTesting = "B99ABE6A-DFF6-440F-BFB6-55179B8FE18E";
+ public const string StringTesting = "C73C83E8-51A2-47F8-9B5C-4284458E47A6";
+ public const string ErrorMarshalTesting = "71CF5C45-106C-4B32-B418-43A463C6041F";
+ }
+}
\ No newline at end of file
-<Project>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Properties for all Interop managed test assets -->
<PropertyGroup>
</PropertyGroup>
typedef WCHAR *LPWSTR, *PWSTR;
typedef const WCHAR *LPCWSTR, *PCWSTR;
-#ifdef UNICODE
-typedef WCHAR TCHAR;
-#else // ANSI
-typedef char TCHAR;
-#endif // UNICODE
-
typedef char* LPSTR;
typedef const char* LPCSTR;
-typedef TCHAR* LPTSTR;
-typedef const TCHAR* LPCTSTR;
typedef void* FARPROC;
typedef void* HMODULE;
typedef void* ULONG_PTR;
#define _CRT_SECURE_NO_WARNINGS 1
#endif
+// Ensure that both UNICODE and _UNICODE are set.
+#ifndef _UNICODE
+#define _UNICODE
+#endif
+#ifndef UNICODE
+#define UNICODE
+#endif
+
// common headers
#include <stdio.h>
#include <memory.h>
// include
#ifdef _WIN32
#include <windows.h>
+ #include <combaseapi.h>
#ifndef snprintf
#define snprintf _snprintf
#endif
#endif //!_WIN32
-// Ensure that both UNICODE and _UNICODE are set.
-#ifndef _UNICODE
- #define _UNICODE
-#endif
-#ifndef UNICODE
- #define UNICODE
-#endif
-
-void *CoreClrAlloc(size_t cb)
+inline void *CoreClrAlloc(size_t cb)
{
#ifdef _WIN32
return ::CoTaskMemAlloc(cb);
#endif
}
-void CoreClrFree(void *p)
+inline void CoreClrFree(void *p)
{
#ifdef _WIN32
return ::CoTaskMemFree(p);