1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
11 class NumericTesting : public UnknownImpl, public INumericTesting
15 /*[in]*/ unsigned char a,
16 /*[in]*/ unsigned char b,
17 /*[out,retval]*/ unsigned char * pRetVal)
19 *pRetVal = static_cast<unsigned char>(a + b);
25 /*[out,retval]*/ short * pRetVal)
27 *pRetVal = static_cast<short>(a + b);
31 /*[in]*/ unsigned short a,
32 /*[in]*/ unsigned short b,
33 /*[out,retval]*/ unsigned short * pRetVal)
35 *pRetVal = static_cast<unsigned short>(a + b);
41 /*[out,retval]*/ int * pRetVal)
47 /*[in]*/ unsigned int a,
48 /*[in]*/ unsigned int b,
49 /*[out,retval]*/ unsigned int * pRetVal)
57 /*[out,retval]*/ __int64 * pRetVal)
63 /*[in]*/ unsigned __int64 a,
64 /*[in]*/ unsigned __int64 b,
65 /*[out,retval]*/ unsigned __int64 * pRetVal)
73 /*[out,retval]*/ float * pRetVal)
81 /*[out,retval]*/ double * pRetVal)
86 DEF_FUNC(Add_Byte_Ref)(
87 /*[in]*/ unsigned char a,
88 /*[in]*/ unsigned char b,
89 /*[in,out]*/ unsigned char * c)
91 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
93 *c = static_cast<unsigned char>(a + b);
96 DEF_FUNC(Add_Short_Ref)(
99 /*[in,out]*/ short * c)
101 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
103 *c = static_cast<short>(a + b);
106 DEF_FUNC(Add_UShort_Ref)(
107 /*[in]*/ unsigned short a,
108 /*[in]*/ unsigned short b,
109 /*[in,out]*/ unsigned short * c)
111 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
113 *c = static_cast<unsigned short>(a + b);
116 DEF_FUNC(Add_Int_Ref)(
119 /*[in,out]*/ int * c)
121 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
126 DEF_FUNC(Add_UInt_Ref)(
127 /*[in]*/ unsigned int a,
128 /*[in]*/ unsigned int b,
129 /*[in,out]*/ unsigned int * c)
131 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
136 DEF_FUNC(Add_Long_Ref)(
139 /*[in,out]*/ __int64 * c)
141 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
146 DEF_FUNC(Add_ULong_Ref)(
147 /*[in]*/ unsigned __int64 a,
148 /*[in]*/ unsigned __int64 b,
149 /*[in,out]*/ unsigned __int64 * c)
151 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
156 DEF_FUNC(Add_Float_Ref)(
159 /*[in,out]*/ float * c)
161 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
166 DEF_FUNC(Add_Double_Ref)(
169 /*[in,out]*/ double * c)
171 if (*c != std::numeric_limits<std::remove_reference<decltype(*c)>::type>::max())
176 DEF_FUNC(Add_Byte_Out)(
177 /*[in]*/ unsigned char a,
178 /*[in]*/ unsigned char b,
179 /*[out]*/ unsigned char * c)
181 *c = static_cast<unsigned char>(a + b);
184 DEF_FUNC(Add_Short_Out)(
189 *c = static_cast<short>(a + b);
192 DEF_FUNC(Add_UShort_Out)(
193 /*[in]*/ unsigned short a,
194 /*[in]*/ unsigned short b,
195 /*[out]*/ unsigned short * c)
197 *c = static_cast<unsigned short>(a + b);
200 DEF_FUNC(Add_Int_Out)(
208 DEF_FUNC(Add_UInt_Out)(
209 /*[in]*/ unsigned int a,
210 /*[in]*/ unsigned int b,
211 /*[out]*/ unsigned int * c)
216 DEF_FUNC(Add_Long_Out)(
219 /*[out]*/ __int64 * c)
224 DEF_FUNC(Add_ULong_Out)(
225 /*[in]*/ unsigned __int64 a,
226 /*[in]*/ unsigned __int64 b,
227 /*[out]*/ unsigned __int64 * c)
232 DEF_FUNC(Add_Float_Out)(
240 DEF_FUNC(Add_Double_Out)(
243 /*[out]*/ double * c)
249 DEF_FUNC(Add_ManyInts11)(
261 /*[out]*/ int * result )
263 *result = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11;
267 DEF_FUNC(Add_ManyInts12)(
280 /*[out]*/ int * result )
282 *result = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12;
286 virtual COM_DECLSPEC_NOTHROW SizeF STDMETHODCALLTYPE MakeSize(
287 /*[in]*/ float width,
288 /*[in]*/ float height)
290 return { width, height };
293 virtual COM_DECLSPEC_NOTHROW Size STDMETHODCALLTYPE MakeSizeSmall(
295 /*[in]*/ BYTE height)
297 return { width, height };
300 virtual COM_DECLSPEC_NOTHROW HFA_4 STDMETHODCALLTYPE MakeHFA(
307 return { x, y, z, w };
311 STDMETHOD(QueryInterface)(
312 /* [in] */ REFIID riid,
313 /* [iid_is][out] */ _COM_Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject)
315 return DoQueryInterface(riid, ppvObject, static_cast<INumericTesting *>(this));
318 DEFINE_REF_COUNTING();