179{
182 ULONG refcount, refcount2;
189
191 hr = IStaticPortMappingCollection_get__NewEnum(ports, &unk);
192 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
193
194 hr = IUnknown_QueryInterface(unk, &IID_IEnumVARIANT, (
void **)&enum_ports);
195 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
196 IUnknown_Release( unk );
197
199 ok(refcount2 == refcount,
"Got unexpected refcount %lu, refcount2 %lu.\n", refcount, refcount2);
200
201 hr = IEnumVARIANT_Reset(enum_ports);
202 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
203
205 hr = IStaticPortMappingCollection_get_Count(ports, &
count);
206 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
207
208 hr = IStaticPortMappingCollection_get_Item(ports, 12345, (
BSTR)
L"UDP", &
pm);
210 {
212 IStaticPortMapping_Release(
pm);
213 }
214 else
215 {
217 }
218
219 hr = IStaticPortMappingCollection_Add(ports, 12345, (
BSTR)
L"udp", 12345, (
BSTR)
L"1.2.3.4",
220 VARIANT_TRUE, (
BSTR)
L"wine_test", &
pm);
222 hr = IStaticPortMappingCollection_Add(ports, 12345, (
BSTR)
L"UDP", 12345, (
BSTR)
L"1.2.3.4",
223 VARIANT_TRUE, (
BSTR)
L"wine_test", &
pm);
224 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
225
226 hr = IStaticPortMappingCollection_get_Count(ports, &count2);
227 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
229
230 hr = IStaticPortMappingCollection_get_Item(ports, 12345,
NULL, &
pm);
232
233 hr = IStaticPortMappingCollection_get_Item(ports, 12345, (
BSTR)
L"UDP",
NULL);
235
236 hr = IStaticPortMappingCollection_get_Item(ports, 12345, (
BSTR)
L"udp", &
pm);
238
239 hr = IStaticPortMappingCollection_get_Item(ports, -1, (
BSTR)
L"UDP", &
pm);
241
242 hr = IStaticPortMappingCollection_get_Item(ports, 65536, (
BSTR)
L"UDP", &
pm);
244
245 hr = IStaticPortMappingCollection_get_Item(ports, 12346, (
BSTR)
L"UDP", &
pm);
247
248 hr = IEnumVARIANT_Reset(enum_ports);
249 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
250
251 for (
i = 0;
i < count2; ++
i)
252 {
254
255 fetched = 0xdeadbeef;
256 hr = IEnumVARIANT_Next(enum_ports, 1, &
var, &fetched);
257 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
258 ok(fetched == 1,
"Got unexpected fetched %lu.\n", fetched);
260
261 hr = IDispatch_QueryInterface(
V_DISPATCH(&
var), &IID_IStaticPortMapping, (
void **)&
pm);
262 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
263
265 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
266 external_port = 0xdeadbeef;
267 hr = IStaticPortMapping_get_ExternalPort(
pm, &external_port);
268 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
269
272 hr = IStaticPortMappingCollection_get_Item(ports, external_port,
protocol, &
pm2);
273 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
274 ok(
pm2 !=
pm,
"Got same interface.\n");
275
276 IStaticPortMapping_Release(
pm);
277 IStaticPortMapping_Release(
pm2);
278
280
282 }
283 hr = IEnumVARIANT_Next(enum_ports, 1, &
var, &fetched);
285
286 hr = IStaticPortMappingCollection_Remove(ports, 12345, (
BSTR)
L"UDP");
287 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
288
289 IEnumVARIANT_Release(enum_ports);
290}
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
GLuint GLuint GLsizei count
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define ERROR_FILE_NOT_FOUND
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)