2 * Unit test suite for rpc functions
4 * Copyright 2002 Greg Turner
5 * Copyright 2008-2009 Robert Shearman
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #define WIN32_NO_STATUS
28 #include "wine/test.h"
43 typedef unsigned int unsigned32
;
46 unsigned32 tower_length
;
47 /* [size_is] */ byte tower_octet_string
[ 1 ];
50 RPC_STATUS WINAPI
TowerExplode(const twr_t
*tower
, RPC_SYNTAX_IDENTIFIER
*object
, RPC_SYNTAX_IDENTIFIER
*syntax
, char **protseq
, char **endpoint
, char **address
);
51 RPC_STATUS WINAPI
TowerConstruct(const RPC_SYNTAX_IDENTIFIER
*object
, const RPC_SYNTAX_IDENTIFIER
*syntax
, const char *protseq
, const char *endpoint
, const char *address
, twr_t
**tower
);
53 static UUID Uuid_Table
[10] = {
54 { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, /* 0 (null) */
55 { 0xdeadbeef, 0xdead, 0xbeef, {0x10, 0x21, 0x35, 0x56, 0x89, 0xa0, 0xf4, 0x8a} }, /* 1 */
56 { 0xabadfeed, 0x49ff, 0xbead, {0x8a, 0xf4, 0xa0, 0x89, 0x56, 0x35, 0x21, 0x10} }, /* 2 */
57 { 0x93da375c, 0x1324, 0x1355, {0x87, 0xff, 0x49, 0x44, 0x34, 0x44, 0x22, 0x19} }, /* 3 */
58 { 0xdeadbeef, 0xdead, 0xbeef, {0x10, 0x21, 0x35, 0x56, 0x89, 0xa0, 0xf4, 0x8b} }, /* 4 (~1) */
59 { 0x9badfeed, 0x49ff, 0xbead, {0x8a, 0xf4, 0xa0, 0x89, 0x56, 0x35, 0x21, 0x10} }, /* 5 (~2) */
60 { 0x00000000, 0x0001, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, /* 6 (~0) */
61 { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} }, /* 7 (~0) */
62 { 0x12312312, 0x1231, 0x1231, {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xff} }, /* 8 */
63 { 0x11111111, 0x1111, 0x1111, {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11} } /* 9 */
66 /* index of "10" means "NULL" */
67 static BOOL Uuid_Comparison_Grid
[11][11] = {
68 { TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
},
69 { FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
},
70 { FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
},
71 { FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
},
72 { FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
},
73 { FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
},
74 { FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
, FALSE
},
75 { FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
, FALSE
},
76 { FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
, FALSE
},
77 { FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
, FALSE
},
78 { TRUE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, FALSE
, TRUE
}
81 static void test_UuidEqual(void)
83 UUID Uuid1
, Uuid2
, *PUuid1
, *PUuid2
;
88 for (i1
= 0; i1
< 11; i1
++)
90 for (i2
= 0; i2
< 11; i2
++)
94 Uuid1
= Uuid_Table
[i1
];
102 Uuid2
= Uuid_Table
[i2
];
107 ok(UuidEqual(PUuid1
, PUuid2
, &status
) == Uuid_Comparison_Grid
[i1
][i2
], "UUID Equality\n" );
112 static void test_UuidFromString(void)
116 WCHAR wstrx
[100], wx
;
124 /* Uuid to String to Uuid (char) */
125 for (i1
= 0; i1
< 10; i1
++) {
126 Uuid1
= Uuid_Table
[i1
];
127 ok( (UuidToStringA(&Uuid1
, (unsigned char**)&str
) == RPC_S_OK
), "Simple UUID->String copy\n" );
128 ok( (UuidFromStringA((unsigned char*)str
, &Uuid2
) == RPC_S_OK
), "Simple String->UUID copy from generated UUID String\n" );
129 ok( UuidEqual(&Uuid1
, &Uuid2
, &rslt
), "Uuid -> String -> Uuid transform\n" );
130 /* invalid uuid tests -- size of valid UUID string=36 */
131 for (i2
= 0; i2
< 36; i2
++) {
133 str
[i2
] = 'g'; /* whatever, but "g" is a good boundary condition */
134 ok( (UuidFromStringA((unsigned char*)str
, &Uuid1
) == RPC_S_INVALID_STRING_UUID
), "Invalid UUID String\n" );
135 str
[i2
] = x
; /* change it back so remaining tests are interesting. */
137 RpcStringFreeA((unsigned char **)&str
);
140 /* Uuid to String to Uuid (wchar) */
141 for (i1
= 0; i1
< 10; i1
++) {
142 Uuid1
= Uuid_Table
[i1
];
143 rslt
=UuidToStringW(&Uuid1
, &wstr
);
144 ok( (rslt
== RPC_S_OK
), "Simple UUID->WString copy\n" );
145 ok( (UuidFromStringW(wstr
, &Uuid2
) == RPC_S_OK
), "Simple WString->UUID copy from generated UUID String\n" );
146 ok( UuidEqual(&Uuid1
, &Uuid2
, &rslt
), "Uuid -> WString -> Uuid transform\n" );
147 /* invalid uuid tests -- size of valid UUID string=36 */
148 for (i2
= 0; i2
< 36; i2
++) {
150 wstr
[i2
] = 'g'; /* whatever, but "g" is a good boundary condition */
151 ok( (UuidFromStringW(wstr
, &Uuid1
) == RPC_S_INVALID_STRING_UUID
), "Invalid UUID WString\n" );
152 wstr
[i2
] = wx
; /* change it back so remaining tests are interesting. */
154 RpcStringFreeW(&wstr
);
158 static void test_DceErrorInqTextA(void)
160 char bufferInvalid
[1024];
165 dwCount
= FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS
, NULL
,
166 RPC_S_NOT_RPC_ERROR
, 0, bufferInvalid
, ARRAY_SIZE(bufferInvalid
), NULL
);
167 ok(dwCount
, "Cannot set up for DceErrorInqText\n");
170 status
= DceErrorInqTextA(0, (unsigned char*)buffer
);
171 ok(status
== RPC_S_OK
, "got %lx\n", status
);
173 /* A real RPC_S error */
174 status
= DceErrorInqTextA(RPC_S_INVALID_STRING_UUID
, (unsigned char*)buffer
);
175 ok(status
== RPC_S_OK
, "got %lx\n", status
);
177 /* A message for which FormatMessage should fail which should return RPC_S_OK and the
178 * fixed "not valid" message */
179 status
= DceErrorInqTextA(35, (unsigned char*)buffer
);
180 ok(status
== RPC_S_OK
, "got %lx\n", status
);
181 ok(!strcmp(buffer
, bufferInvalid
), "got %s vs %s\n", wine_dbgstr_a(buffer
), wine_dbgstr_a(bufferInvalid
));
184 static RPC_DISPATCH_FUNCTION IFoo_table
[] =
189 static RPC_DISPATCH_TABLE IFoo_v0_0_DispatchTable
=
195 static const RPC_SERVER_INTERFACE IFoo___RpcServerInterface
=
197 sizeof(RPC_SERVER_INTERFACE
),
198 {{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x34}},{0,0}},
199 {{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
200 &IFoo_v0_0_DispatchTable
,
208 static RPC_IF_HANDLE IFoo_v0_0_s_ifspec
= (RPC_IF_HANDLE
)& IFoo___RpcServerInterface
;
210 static void test_rpc_ncacn_ip_tcp(void)
213 unsigned char *binding
, *principal
;
214 handle_t IFoo_IfHandle
;
215 ULONG level
, authnsvc
, authzsvc
;
216 RPC_AUTH_IDENTITY_HANDLE identity
;
217 static unsigned char foo
[] = "foo";
218 static unsigned char ncacn_ip_tcp
[] = "ncacn_ip_tcp";
219 static unsigned char address
[] = "127.0.0.1";
220 static unsigned char endpoint
[] = "4114";
221 static unsigned char spn
[] = "principal";
223 status
= RpcNetworkIsProtseqValidA(foo
);
224 ok(status
== RPC_S_INVALID_RPC_PROTSEQ
, "return wrong\n");
226 status
= RpcNetworkIsProtseqValidA(ncacn_ip_tcp
);
227 ok(status
== RPC_S_OK
, "return wrong\n");
229 status
= RpcMgmtStopServerListening(NULL
);
230 ok(status
== RPC_S_NOT_LISTENING
,
231 "wrong RpcMgmtStopServerListening error (%lu)\n", status
);
233 status
= RpcMgmtWaitServerListen();
234 ok(status
== RPC_S_NOT_LISTENING
,
235 "wrong RpcMgmtWaitServerListen error status (%lu)\n", status
);
237 status
= RpcServerListen(1, 20, FALSE
);
238 ok(status
== RPC_S_NO_PROTSEQS_REGISTERED
,
239 "wrong RpcServerListen error (%lu)\n", status
);
241 status
= RpcServerUseProtseqEpA(ncacn_ip_tcp
, 20, endpoint
, NULL
);
242 ok(status
== RPC_S_OK
, "RpcServerUseProtseqEp failed (%lu)\n", status
);
244 status
= RpcServerRegisterIf(IFoo_v0_0_s_ifspec
, NULL
, NULL
);
245 ok(status
== RPC_S_OK
, "RpcServerRegisterIf failed (%lu)\n", status
);
247 status
= RpcServerListen(1, 20, TRUE
);
248 ok(status
== RPC_S_OK
, "RpcServerListen failed (%lu)\n", status
);
250 status
= RpcServerListen(1, 20, TRUE
);
251 ok(status
== RPC_S_ALREADY_LISTENING
,
252 "wrong RpcServerListen error (%lu)\n", status
);
254 status
= RpcStringBindingComposeA(NULL
, ncacn_ip_tcp
, address
,
255 endpoint
, NULL
, &binding
);
256 ok(status
== RPC_S_OK
, "RpcStringBindingCompose failed (%lu)\n", status
);
258 status
= RpcBindingFromStringBindingA(binding
, &IFoo_IfHandle
);
259 ok(status
== RPC_S_OK
, "RpcBindingFromStringBinding failed (%lu)\n",
262 status
= RpcBindingSetAuthInfoA(IFoo_IfHandle
, NULL
, RPC_C_AUTHN_LEVEL_NONE
,
263 RPC_C_AUTHN_WINNT
, NULL
, RPC_C_AUTHZ_NAME
);
264 ok(status
== RPC_S_OK
, "RpcBindingSetAuthInfo failed (%lu)\n", status
);
266 status
= RpcBindingInqAuthInfoA(IFoo_IfHandle
, NULL
, NULL
, NULL
, NULL
, NULL
);
267 ok(status
== RPC_S_BINDING_HAS_NO_AUTH
, "RpcBindingInqAuthInfo failed (%lu)\n",
270 status
= RpcBindingSetAuthInfoA(IFoo_IfHandle
, spn
, RPC_C_AUTHN_LEVEL_PKT_PRIVACY
,
271 RPC_C_AUTHN_WINNT
, NULL
, RPC_C_AUTHZ_NAME
);
272 ok(status
== RPC_S_OK
, "RpcBindingSetAuthInfo failed (%lu)\n", status
);
274 level
= authnsvc
= authzsvc
= 0;
275 principal
= (unsigned char *)0xdeadbeef;
276 identity
= (RPC_AUTH_IDENTITY_HANDLE
*)0xdeadbeef;
277 status
= RpcBindingInqAuthInfoA(IFoo_IfHandle
, &principal
, &level
, &authnsvc
,
278 &identity
, &authzsvc
);
280 ok(status
== RPC_S_OK
, "RpcBindingInqAuthInfo failed (%lu)\n", status
);
281 ok(identity
== NULL
, "expected NULL identity, got %p\n", identity
);
282 ok(principal
!= (unsigned char *)0xdeadbeef, "expected valid principal, got %p\n", principal
);
283 ok(level
== RPC_C_AUTHN_LEVEL_PKT_PRIVACY
, "expected RPC_C_AUTHN_LEVEL_PKT_PRIVACY, got %ld\n", level
);
284 ok(authnsvc
== RPC_C_AUTHN_WINNT
, "expected RPC_C_AUTHN_WINNT, got %ld\n", authnsvc
);
285 todo_wine
ok(authzsvc
== RPC_C_AUTHZ_NAME
, "expected RPC_C_AUTHZ_NAME, got %ld\n", authzsvc
);
286 if (status
== RPC_S_OK
) RpcStringFreeA(&principal
);
288 status
= RpcMgmtStopServerListening(NULL
);
289 ok(status
== RPC_S_OK
, "RpcMgmtStopServerListening failed (%lu)\n",
292 status
= RpcMgmtStopServerListening(NULL
);
293 ok(status
== RPC_S_OK
, "RpcMgmtStopServerListening failed (%lu)\n",
296 status
= RpcServerUnregisterIf(NULL
, NULL
, FALSE
);
297 ok(status
== RPC_S_OK
, "RpcServerUnregisterIf failed (%lu)\n", status
);
299 status
= RpcMgmtWaitServerListen();
300 ok(status
== RPC_S_OK
, "RpcMgmtWaitServerListen failed (%lu)\n", status
);
302 status
= RpcStringFreeA(&binding
);
303 ok(status
== RPC_S_OK
, "RpcStringFree failed (%lu)\n", status
);
305 status
= RpcBindingFree(&IFoo_IfHandle
);
306 ok(status
== RPC_S_OK
, "RpcBindingFree failed (%lu)\n", status
);
309 /* this is what's generated with MS/RPC - it includes an extra 2
310 * bytes in the protocol floor */
311 static const unsigned char tower_data_tcp_ip1
[] =
313 0x05,0x00,0x13,0x00,0x0d,0x00,0xdb,0xf1,
314 0xa4,0x47,0xca,0x67,0x10,0xb3,0x1f,0x00,
315 0xdd,0x01,0x06,0x62,0xda,0x00,0x00,0x02,
316 0x00,0x00,0x00,0x13,0x00,0x0d,0x04,0x5d,
317 0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,
318 0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,
319 0x02,0x00,0x00,0x00,0x01,0x00,0x0b,0x02,
320 0x00,0x00,0x00,0x01,0x00,0x07,0x02,0x00,
321 0x00,0x87,0x01,0x00,0x09,0x04,0x00,0x0a,
324 /* this is the optimal data that i think should be generated */
325 static const unsigned char tower_data_tcp_ip2
[] =
327 0x05,0x00,0x13,0x00,0x0d,0x00,0xdb,0xf1,
328 0xa4,0x47,0xca,0x67,0x10,0xb3,0x1f,0x00,
329 0xdd,0x01,0x06,0x62,0xda,0x00,0x00,0x02,
330 0x00,0x00,0x00,0x13,0x00,0x0d,0x04,0x5d,
331 0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,
332 0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,
333 0x02,0x00,0x00,0x00,0x01,0x00,0x0b,0x00,
334 0x00,0x01,0x00,0x07,0x02,0x00,0x00,0x87,
335 0x01,0x00,0x09,0x04,0x00,0x0a,0x00,0x00,
339 static void test_towers(void)
343 static const RPC_SYNTAX_IDENTIFIER mapi_if_id
= { { 0xa4f1db00, 0xca47, 0x1067, { 0xb3, 0x1f, 0x00, 0xdd, 0x01, 0x06, 0x62, 0xda } }, { 0, 0 } };
344 static const RPC_SYNTAX_IDENTIFIER ndr_syntax
= { { 0x8a885d04, 0x1ceb, 0x11c9, { 0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60 } }, { 2, 0 } };
345 RPC_SYNTAX_IDENTIFIER object
, syntax
;
346 char *protseq
, *endpoint
, *address
;
349 ret
= TowerConstruct(&mapi_if_id
, &ndr_syntax
, "ncacn_ip_tcp", "135", "10.0.0.1", &tower
);
350 ok(ret
== RPC_S_OK
||
351 broken(ret
== RPC_S_INVALID_RPC_PROTSEQ
), /* Vista */
352 "TowerConstruct failed with error %ld\n", ret
);
353 if (ret
== RPC_S_INVALID_RPC_PROTSEQ
)
355 /* Windows Vista fails with this error and crashes if we continue */
356 win_skip("TowerConstruct failed, we are most likely on Windows Vista\n");
360 /* first check we have the right amount of data */
361 ok(tower
->tower_length
== sizeof(tower_data_tcp_ip1
) ||
362 tower
->tower_length
== sizeof(tower_data_tcp_ip2
),
363 "Wrong size of tower %d\n", tower
->tower_length
);
365 /* then do a byte-by-byte comparison */
366 same
= ((tower
->tower_length
== sizeof(tower_data_tcp_ip1
)) &&
367 !memcmp(&tower
->tower_octet_string
, tower_data_tcp_ip1
, sizeof(tower_data_tcp_ip1
))) ||
368 ((tower
->tower_length
== sizeof(tower_data_tcp_ip2
)) &&
369 !memcmp(&tower
->tower_octet_string
, tower_data_tcp_ip2
, sizeof(tower_data_tcp_ip2
)));
371 ok(same
, "Tower data differs\n");
375 for (i
= 0; i
< tower
->tower_length
; i
++)
377 if (i
% 8 == 0) printf(" ");
378 printf("0x%02x,", tower
->tower_octet_string
[i
]);
379 if (i
% 8 == 7) printf("\n");
384 ret
= TowerExplode(tower
, &object
, &syntax
, &protseq
, &endpoint
, &address
);
385 ok(ret
== RPC_S_OK
, "TowerExplode failed with error %ld\n", ret
);
386 ok(!memcmp(&object
, &mapi_if_id
, sizeof(mapi_if_id
)), "object id didn't match\n");
387 ok(!memcmp(&syntax
, &ndr_syntax
, sizeof(syntax
)), "syntax id didn't match\n");
388 ok(!strcmp(protseq
, "ncacn_ip_tcp"), "protseq was \"%s\" instead of \"ncacn_ip_tcp\"\n", protseq
);
389 ok(!strcmp(endpoint
, "135"), "endpoint was \"%s\" instead of \"135\"\n", endpoint
);
390 ok(!strcmp(address
, "10.0.0.1"), "address was \"%s\" instead of \"10.0.0.1\"\n", address
);
396 ret
= TowerExplode(tower
, NULL
, NULL
, NULL
, NULL
, NULL
);
397 ok(ret
== RPC_S_OK
, "TowerExplode failed with error %ld\n", ret
);
401 /* test the behaviour for ip_tcp with name instead of dotted IP notation */
402 ret
= TowerConstruct(&mapi_if_id
, &ndr_syntax
, "ncacn_ip_tcp", "135", "localhost", &tower
);
403 ok(ret
== RPC_S_OK
, "TowerConstruct failed with error %ld\n", ret
);
404 ret
= TowerExplode(tower
, NULL
, NULL
, NULL
, NULL
, &address
);
405 ok(ret
== RPC_S_OK
, "TowerExplode failed with error %ld\n", ret
);
406 ok(!strcmp(address
, "0.0.0.0") ||
407 broken(!strcmp(address
, "255.255.255.255")),
408 "address was \"%s\" instead of \"0.0.0.0\"\n", address
);
413 /* test the behaviour for np with no address */
414 ret
= TowerConstruct(&mapi_if_id
, &ndr_syntax
, "ncacn_np", "\\pipe\\test", NULL
, &tower
);
415 ok(ret
== RPC_S_OK
, "TowerConstruct failed with error %ld\n", ret
);
416 ret
= TowerExplode(tower
, NULL
, NULL
, NULL
, NULL
, &address
);
417 ok(ret
== RPC_S_OK
||
418 broken(ret
!= RPC_S_OK
), /* win2k, indeterminate */
419 "TowerExplode failed with error %ld\n", ret
);
420 /* Windows XP SP3 sets address to NULL */
421 ok(!address
|| !strcmp(address
, ""), "address was \"%s\" instead of \"\" or NULL (XP SP3)\n", address
);
427 static void test_I_RpcMapWin32Status(void)
430 RPC_STATUS rpc_status
;
431 BOOL w2k3_up
= FALSE
;
433 /* Windows 2003 and above return STATUS_UNSUCCESSFUL if given an unknown status */
434 win32status
= I_RpcMapWin32Status(9999);
435 if (win32status
== STATUS_UNSUCCESSFUL
)
438 /* On Windows XP-SP1 and below some statuses are not mapped and return
441 for (rpc_status
= 0; rpc_status
< 10000; rpc_status
++)
443 LONG expected_win32status
;
444 BOOL missing
= FALSE
;
446 win32status
= I_RpcMapWin32Status(rpc_status
);
449 case ERROR_SUCCESS
: expected_win32status
= ERROR_SUCCESS
; break;
450 case ERROR_ACCESS_DENIED
: expected_win32status
= STATUS_ACCESS_DENIED
; break;
451 case ERROR_INVALID_HANDLE
: expected_win32status
= RPC_NT_SS_CONTEXT_MISMATCH
; break;
452 case ERROR_OUTOFMEMORY
: expected_win32status
= STATUS_NO_MEMORY
; break;
453 case ERROR_INVALID_PARAMETER
: expected_win32status
= STATUS_INVALID_PARAMETER
; break;
454 case ERROR_INSUFFICIENT_BUFFER
: expected_win32status
= STATUS_BUFFER_TOO_SMALL
; break;
455 case ERROR_MAX_THRDS_REACHED
: expected_win32status
= STATUS_NO_MEMORY
; break;
456 case ERROR_NOACCESS
: expected_win32status
= STATUS_ACCESS_VIOLATION
; break;
457 case ERROR_NOT_ENOUGH_SERVER_MEMORY
: expected_win32status
= STATUS_INSUFF_SERVER_RESOURCES
; break;
458 case ERROR_WRONG_PASSWORD
: expected_win32status
= STATUS_WRONG_PASSWORD
; missing
= TRUE
; break;
459 case ERROR_INVALID_LOGON_HOURS
: expected_win32status
= STATUS_INVALID_LOGON_HOURS
; missing
= TRUE
; break;
460 case ERROR_PASSWORD_EXPIRED
: expected_win32status
= STATUS_PASSWORD_EXPIRED
; missing
= TRUE
; break;
461 case ERROR_ACCOUNT_DISABLED
: expected_win32status
= STATUS_ACCOUNT_DISABLED
; missing
= TRUE
; break;
462 case ERROR_INVALID_SECURITY_DESCR
: expected_win32status
= STATUS_INVALID_SECURITY_DESCR
; break;
463 case RPC_S_INVALID_STRING_BINDING
: expected_win32status
= RPC_NT_INVALID_STRING_BINDING
; break;
464 case RPC_S_WRONG_KIND_OF_BINDING
: expected_win32status
= RPC_NT_WRONG_KIND_OF_BINDING
; break;
465 case RPC_S_INVALID_BINDING
: expected_win32status
= RPC_NT_INVALID_BINDING
; break;
466 case RPC_S_PROTSEQ_NOT_SUPPORTED
: expected_win32status
= RPC_NT_PROTSEQ_NOT_SUPPORTED
; break;
467 case RPC_S_INVALID_RPC_PROTSEQ
: expected_win32status
= RPC_NT_INVALID_RPC_PROTSEQ
; break;
468 case RPC_S_INVALID_STRING_UUID
: expected_win32status
= RPC_NT_INVALID_STRING_UUID
; break;
469 case RPC_S_INVALID_ENDPOINT_FORMAT
: expected_win32status
= RPC_NT_INVALID_ENDPOINT_FORMAT
; break;
470 case RPC_S_INVALID_NET_ADDR
: expected_win32status
= RPC_NT_INVALID_NET_ADDR
; break;
471 case RPC_S_NO_ENDPOINT_FOUND
: expected_win32status
= RPC_NT_NO_ENDPOINT_FOUND
; break;
472 case RPC_S_INVALID_TIMEOUT
: expected_win32status
= RPC_NT_INVALID_TIMEOUT
; break;
473 case RPC_S_OBJECT_NOT_FOUND
: expected_win32status
= RPC_NT_OBJECT_NOT_FOUND
; break;
474 case RPC_S_ALREADY_REGISTERED
: expected_win32status
= RPC_NT_ALREADY_REGISTERED
; break;
475 case RPC_S_TYPE_ALREADY_REGISTERED
: expected_win32status
= RPC_NT_TYPE_ALREADY_REGISTERED
; break;
476 case RPC_S_ALREADY_LISTENING
: expected_win32status
= RPC_NT_ALREADY_LISTENING
; break;
477 case RPC_S_NO_PROTSEQS_REGISTERED
: expected_win32status
= RPC_NT_NO_PROTSEQS_REGISTERED
; break;
478 case RPC_S_NOT_LISTENING
: expected_win32status
= RPC_NT_NOT_LISTENING
; break;
479 case RPC_S_UNKNOWN_MGR_TYPE
: expected_win32status
= RPC_NT_UNKNOWN_MGR_TYPE
; break;
480 case RPC_S_UNKNOWN_IF
: expected_win32status
= RPC_NT_UNKNOWN_IF
; break;
481 case RPC_S_NO_BINDINGS
: expected_win32status
= RPC_NT_NO_BINDINGS
; break;
482 case RPC_S_NO_PROTSEQS
: expected_win32status
= RPC_NT_NO_PROTSEQS
; break;
483 case RPC_S_CANT_CREATE_ENDPOINT
: expected_win32status
= RPC_NT_CANT_CREATE_ENDPOINT
; break;
484 case RPC_S_OUT_OF_RESOURCES
: expected_win32status
= RPC_NT_OUT_OF_RESOURCES
; break;
485 case RPC_S_SERVER_UNAVAILABLE
: expected_win32status
= RPC_NT_SERVER_UNAVAILABLE
; break;
486 case RPC_S_SERVER_TOO_BUSY
: expected_win32status
= RPC_NT_SERVER_TOO_BUSY
; break;
487 case RPC_S_INVALID_NETWORK_OPTIONS
: expected_win32status
= RPC_NT_INVALID_NETWORK_OPTIONS
; break;
488 case RPC_S_NO_CALL_ACTIVE
: expected_win32status
= RPC_NT_NO_CALL_ACTIVE
; break;
489 case RPC_S_CALL_FAILED
: expected_win32status
= RPC_NT_CALL_FAILED
; break;
490 case RPC_S_CALL_FAILED_DNE
: expected_win32status
= RPC_NT_CALL_FAILED_DNE
; break;
491 case RPC_S_PROTOCOL_ERROR
: expected_win32status
= RPC_NT_PROTOCOL_ERROR
; break;
492 case RPC_S_UNSUPPORTED_TRANS_SYN
: expected_win32status
= RPC_NT_UNSUPPORTED_TRANS_SYN
; break;
493 case RPC_S_UNSUPPORTED_TYPE
: expected_win32status
= RPC_NT_UNSUPPORTED_TYPE
; break;
494 case RPC_S_INVALID_TAG
: expected_win32status
= RPC_NT_INVALID_TAG
; break;
495 case RPC_S_INVALID_BOUND
: expected_win32status
= RPC_NT_INVALID_BOUND
; break;
496 case RPC_S_NO_ENTRY_NAME
: expected_win32status
= RPC_NT_NO_ENTRY_NAME
; break;
497 case RPC_S_INVALID_NAME_SYNTAX
: expected_win32status
= RPC_NT_INVALID_NAME_SYNTAX
; break;
498 case RPC_S_UNSUPPORTED_NAME_SYNTAX
: expected_win32status
= RPC_NT_UNSUPPORTED_NAME_SYNTAX
; break;
499 case RPC_S_UUID_NO_ADDRESS
: expected_win32status
= RPC_NT_UUID_NO_ADDRESS
; break;
500 case RPC_S_DUPLICATE_ENDPOINT
: expected_win32status
= RPC_NT_DUPLICATE_ENDPOINT
; break;
501 case RPC_S_UNKNOWN_AUTHN_TYPE
: expected_win32status
= RPC_NT_UNKNOWN_AUTHN_TYPE
; break;
502 case RPC_S_MAX_CALLS_TOO_SMALL
: expected_win32status
= RPC_NT_MAX_CALLS_TOO_SMALL
; break;
503 case RPC_S_STRING_TOO_LONG
: expected_win32status
= RPC_NT_STRING_TOO_LONG
; break;
504 case RPC_S_PROTSEQ_NOT_FOUND
: expected_win32status
= RPC_NT_PROTSEQ_NOT_FOUND
; break;
505 case RPC_S_PROCNUM_OUT_OF_RANGE
: expected_win32status
= RPC_NT_PROCNUM_OUT_OF_RANGE
; break;
506 case RPC_S_BINDING_HAS_NO_AUTH
: expected_win32status
= RPC_NT_BINDING_HAS_NO_AUTH
; break;
507 case RPC_S_UNKNOWN_AUTHN_SERVICE
: expected_win32status
= RPC_NT_UNKNOWN_AUTHN_SERVICE
; break;
508 case RPC_S_UNKNOWN_AUTHN_LEVEL
: expected_win32status
= RPC_NT_UNKNOWN_AUTHN_LEVEL
; break;
509 case RPC_S_INVALID_AUTH_IDENTITY
: expected_win32status
= RPC_NT_INVALID_AUTH_IDENTITY
; break;
510 case RPC_S_UNKNOWN_AUTHZ_SERVICE
: expected_win32status
= RPC_NT_UNKNOWN_AUTHZ_SERVICE
; break;
511 case EPT_S_INVALID_ENTRY
: expected_win32status
= EPT_NT_INVALID_ENTRY
; break;
512 case EPT_S_CANT_PERFORM_OP
: expected_win32status
= EPT_NT_CANT_PERFORM_OP
; break;
513 case EPT_S_NOT_REGISTERED
: expected_win32status
= EPT_NT_NOT_REGISTERED
; break;
514 case EPT_S_CANT_CREATE
: expected_win32status
= EPT_NT_CANT_CREATE
; break;
515 case RPC_S_NOTHING_TO_EXPORT
: expected_win32status
= RPC_NT_NOTHING_TO_EXPORT
; break;
516 case RPC_S_INCOMPLETE_NAME
: expected_win32status
= RPC_NT_INCOMPLETE_NAME
; break;
517 case RPC_S_INVALID_VERS_OPTION
: expected_win32status
= RPC_NT_INVALID_VERS_OPTION
; break;
518 case RPC_S_NO_MORE_MEMBERS
: expected_win32status
= RPC_NT_NO_MORE_MEMBERS
; break;
519 case RPC_S_NOT_ALL_OBJS_UNEXPORTED
: expected_win32status
= RPC_NT_NOT_ALL_OBJS_UNEXPORTED
; break;
520 case RPC_S_INTERFACE_NOT_FOUND
: expected_win32status
= RPC_NT_INTERFACE_NOT_FOUND
; break;
521 case RPC_S_ENTRY_ALREADY_EXISTS
: expected_win32status
= RPC_NT_ENTRY_ALREADY_EXISTS
; break;
522 case RPC_S_ENTRY_NOT_FOUND
: expected_win32status
= RPC_NT_ENTRY_NOT_FOUND
; break;
523 case RPC_S_NAME_SERVICE_UNAVAILABLE
: expected_win32status
= RPC_NT_NAME_SERVICE_UNAVAILABLE
; break;
524 case RPC_S_INVALID_NAF_ID
: expected_win32status
= RPC_NT_INVALID_NAF_ID
; break;
525 case RPC_S_CANNOT_SUPPORT
: expected_win32status
= RPC_NT_CANNOT_SUPPORT
; break;
526 case RPC_S_NO_CONTEXT_AVAILABLE
: expected_win32status
= RPC_NT_NO_CONTEXT_AVAILABLE
; break;
527 case RPC_S_INTERNAL_ERROR
: expected_win32status
= RPC_NT_INTERNAL_ERROR
; break;
528 case RPC_S_ZERO_DIVIDE
: expected_win32status
= RPC_NT_ZERO_DIVIDE
; break;
529 case RPC_S_ADDRESS_ERROR
: expected_win32status
= RPC_NT_ADDRESS_ERROR
; break;
530 case RPC_S_FP_DIV_ZERO
: expected_win32status
= RPC_NT_FP_DIV_ZERO
; break;
531 case RPC_S_FP_UNDERFLOW
: expected_win32status
= RPC_NT_FP_UNDERFLOW
; break;
532 case RPC_S_FP_OVERFLOW
: expected_win32status
= RPC_NT_FP_OVERFLOW
; break;
533 case RPC_S_CALL_IN_PROGRESS
: expected_win32status
= RPC_NT_CALL_IN_PROGRESS
; break;
534 case RPC_S_NO_MORE_BINDINGS
: expected_win32status
= RPC_NT_NO_MORE_BINDINGS
; break;
535 case RPC_S_CALL_CANCELLED
: expected_win32status
= RPC_NT_CALL_CANCELLED
; missing
= TRUE
; break;
536 case RPC_S_INVALID_OBJECT
: expected_win32status
= RPC_NT_INVALID_OBJECT
; break;
537 case RPC_S_INVALID_ASYNC_HANDLE
: expected_win32status
= RPC_NT_INVALID_ASYNC_HANDLE
; missing
= TRUE
; break;
538 case RPC_S_INVALID_ASYNC_CALL
: expected_win32status
= RPC_NT_INVALID_ASYNC_CALL
; missing
= TRUE
; break;
539 case RPC_S_GROUP_MEMBER_NOT_FOUND
: expected_win32status
= RPC_NT_GROUP_MEMBER_NOT_FOUND
; break;
540 case RPC_X_NO_MORE_ENTRIES
: expected_win32status
= RPC_NT_NO_MORE_ENTRIES
; break;
541 case RPC_X_SS_CHAR_TRANS_OPEN_FAIL
: expected_win32status
= RPC_NT_SS_CHAR_TRANS_OPEN_FAIL
; break;
542 case RPC_X_SS_CHAR_TRANS_SHORT_FILE
: expected_win32status
= RPC_NT_SS_CHAR_TRANS_SHORT_FILE
; break;
543 case RPC_X_SS_IN_NULL_CONTEXT
: expected_win32status
= RPC_NT_SS_IN_NULL_CONTEXT
; break;
544 case RPC_X_SS_CONTEXT_DAMAGED
: expected_win32status
= RPC_NT_SS_CONTEXT_DAMAGED
; break;
545 case RPC_X_SS_HANDLES_MISMATCH
: expected_win32status
= RPC_NT_SS_HANDLES_MISMATCH
; break;
546 case RPC_X_SS_CANNOT_GET_CALL_HANDLE
: expected_win32status
= RPC_NT_SS_CANNOT_GET_CALL_HANDLE
; break;
547 case RPC_X_NULL_REF_POINTER
: expected_win32status
= RPC_NT_NULL_REF_POINTER
; break;
548 case RPC_X_ENUM_VALUE_OUT_OF_RANGE
: expected_win32status
= RPC_NT_ENUM_VALUE_OUT_OF_RANGE
; break;
549 case RPC_X_BYTE_COUNT_TOO_SMALL
: expected_win32status
= RPC_NT_BYTE_COUNT_TOO_SMALL
; break;
550 case RPC_X_BAD_STUB_DATA
: expected_win32status
= RPC_NT_BAD_STUB_DATA
; break;
551 case RPC_X_PIPE_CLOSED
: expected_win32status
= RPC_NT_PIPE_CLOSED
; missing
= TRUE
; break;
552 case RPC_X_PIPE_DISCIPLINE_ERROR
: expected_win32status
= RPC_NT_PIPE_DISCIPLINE_ERROR
; missing
= TRUE
; break;
553 case RPC_X_PIPE_EMPTY
: expected_win32status
= RPC_NT_PIPE_EMPTY
; missing
= TRUE
; break;
554 case ERROR_PASSWORD_MUST_CHANGE
: expected_win32status
= STATUS_PASSWORD_MUST_CHANGE
; missing
= TRUE
; break;
555 case ERROR_ACCOUNT_LOCKED_OUT
: expected_win32status
= STATUS_ACCOUNT_LOCKED_OUT
; missing
= TRUE
; break;
558 expected_win32status
= STATUS_UNSUCCESSFUL
;
560 expected_win32status
= rpc_status
;
563 ok(win32status
== expected_win32status
||
564 broken(missing
&& win32status
== rpc_status
),
565 "I_RpcMapWin32Status(%ld) should have returned 0x%lx instead of 0x%lx%s\n",
566 rpc_status
, expected_win32status
, win32status
,
567 broken(missing
) ? " (or have returned with the given status)" : "");
571 static void test_RpcStringBindingParseA(void)
573 static unsigned char valid_binding
[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[endpoint=\\pipe\\test]";
574 static unsigned char valid_binding2
[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[\\pipe\\test]";
575 static unsigned char invalid_uuid_binding
[] = "{00000000-0000-0000-c000-000000000046}@ncacn_np:.[endpoint=\\pipe\\test]";
576 static unsigned char invalid_ep_binding
[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[endpoint=test]";
577 static unsigned char invalid_binding
[] = "00000000-0000-0000-c000-000000000046@ncacn_np";
580 unsigned char *protseq
;
581 unsigned char *network_addr
;
582 unsigned char *endpoint
;
583 unsigned char *options
;
585 /* test all parameters */
586 status
= RpcStringBindingParseA(valid_binding
, &uuid
, &protseq
, &network_addr
, &endpoint
, &options
);
587 ok(status
== RPC_S_OK
, "RpcStringBindingParseA failed with error %ld\n", status
);
588 ok(!strcmp((char *)uuid
, "00000000-0000-0000-c000-000000000046"), "uuid should have been 00000000-0000-0000-C000-000000000046 instead of %s\n", uuid
);
589 ok(!strcmp((char *)protseq
, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq
);
590 ok(!strcmp((char *)network_addr
, "."), "network_addr should have been . instead of %s\n", network_addr
);
591 ok(!strcmp((char *)endpoint
, "pipetest"), "endpoint should have been pipetest instead of %s\n", endpoint
);
593 ok(!strcmp((char *)options
, ""), "options should have been \"\" of \"%s\"\n", options
);
595 todo_wine
ok(FALSE
, "options is NULL\n");
596 RpcStringFreeA(&uuid
);
597 RpcStringFreeA(&protseq
);
598 RpcStringFreeA(&network_addr
);
599 RpcStringFreeA(&endpoint
);
600 RpcStringFreeA(&options
);
602 /* test all parameters with different type of string binding */
603 status
= RpcStringBindingParseA(valid_binding2
, &uuid
, &protseq
, &network_addr
, &endpoint
, &options
);
604 ok(status
== RPC_S_OK
, "RpcStringBindingParseA failed with error %ld\n", status
);
605 ok(!strcmp((char *)uuid
, "00000000-0000-0000-c000-000000000046"), "uuid should have been 00000000-0000-0000-C000-000000000046 instead of %s\n", uuid
);
606 ok(!strcmp((char *)protseq
, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq
);
607 ok(!strcmp((char *)network_addr
, "."), "network_addr should have been . instead of %s\n", network_addr
);
608 ok(!strcmp((char *)endpoint
, "pipetest"), "endpoint should have been pipetest instead of %s\n", endpoint
);
610 ok(!strcmp((char *)options
, ""), "options should have been \"\" of \"%s\"\n", options
);
612 todo_wine
ok(FALSE
, "options is NULL\n");
613 RpcStringFreeA(&uuid
);
614 RpcStringFreeA(&protseq
);
615 RpcStringFreeA(&network_addr
);
616 RpcStringFreeA(&endpoint
);
617 RpcStringFreeA(&options
);
619 /* test with as many parameters NULL as possible */
620 status
= RpcStringBindingParseA(valid_binding
, NULL
, &protseq
, NULL
, NULL
, NULL
);
621 ok(status
== RPC_S_OK
, "RpcStringBindingParseA failed with error %ld\n", status
);
622 ok(!strcmp((char *)protseq
, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq
);
623 RpcStringFreeA(&protseq
);
625 /* test with invalid uuid */
626 status
= RpcStringBindingParseA(invalid_uuid_binding
, NULL
, &protseq
, NULL
, NULL
, NULL
);
627 ok(status
== RPC_S_INVALID_STRING_UUID
, "RpcStringBindingParseA should have returned RPC_S_INVALID_STRING_UUID instead of %ld\n", status
);
628 ok(protseq
== NULL
, "protseq was %p instead of NULL\n", protseq
);
630 /* test with invalid endpoint */
631 status
= RpcStringBindingParseA(invalid_ep_binding
, NULL
, &protseq
, NULL
, NULL
, NULL
);
632 ok(status
== RPC_S_OK
, "RpcStringBindingParseA failed with error %ld\n", status
);
633 RpcStringFreeA(&protseq
);
635 /* test with invalid binding */
636 status
= RpcStringBindingParseA(invalid_binding
, &uuid
, &protseq
, &network_addr
, &endpoint
, &options
);
638 ok(status
== RPC_S_INVALID_STRING_BINDING
, "RpcStringBindingParseA should have returned RPC_S_INVALID_STRING_BINDING instead of %ld\n", status
);
640 ok(uuid
== NULL
, "uuid was %p instead of NULL\n", uuid
);
642 RpcStringFreeA(&uuid
);
643 ok(protseq
== NULL
, "protseq was %p instead of NULL\n", protseq
);
645 ok(network_addr
== NULL
, "network_addr was %p instead of NULL\n", network_addr
);
647 RpcStringFreeA(&network_addr
);
648 ok(endpoint
== NULL
, "endpoint was %p instead of NULL\n", endpoint
);
649 ok(options
== NULL
, "options was %p instead of NULL\n", options
);
652 static void test_RpcExceptionFilter(void)
657 for (exception
= 0; exception
< STATUS_REG_NAT_CONSUMPTION
; exception
++)
659 /* skip over uninteresting bits of the number space */
660 if (exception
== 2000) exception
= 0x40000000;
661 if (exception
== 0x40000005) exception
= 0x80000000;
662 if (exception
== 0x80000005) exception
= 0xc0000000;
664 retval
= RpcExceptionFilter(exception
);
665 retval2
= I_RpcExceptionFilter(exception
);
668 case STATUS_DATATYPE_MISALIGNMENT
:
669 case STATUS_BREAKPOINT
:
670 case STATUS_ACCESS_VIOLATION
:
671 case STATUS_ILLEGAL_INSTRUCTION
:
672 case STATUS_PRIVILEGED_INSTRUCTION
:
673 case STATUS_INSTRUCTION_MISALIGNMENT
:
674 case STATUS_STACK_OVERFLOW
:
675 case STATUS_POSSIBLE_DEADLOCK
:
676 ok(retval
== EXCEPTION_CONTINUE_SEARCH
, "RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
677 exception
, EXCEPTION_CONTINUE_SEARCH
, retval
);
678 ok(retval2
== EXCEPTION_CONTINUE_SEARCH
, "I_RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
679 exception
, EXCEPTION_CONTINUE_SEARCH
, retval
);
681 case STATUS_GUARD_PAGE_VIOLATION
:
682 case STATUS_IN_PAGE_ERROR
:
683 case STATUS_HANDLE_NOT_CLOSABLE
:
686 ok(!retval
, "Unexpected return value %d.\n", retval
);
687 ok(!retval2
, "Unexpected return value %d.\n", retval2
);
691 ok(retval
== EXCEPTION_EXECUTE_HANDLER
, "RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
692 exception
, EXCEPTION_EXECUTE_HANDLER
, retval
);
693 ok(retval2
== EXCEPTION_EXECUTE_HANDLER
, "I_RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
694 exception
, EXCEPTION_EXECUTE_HANDLER
, retval
);
699 static void test_RpcStringBindingFromBinding(void)
701 static unsigned char ncacn_np
[] = "ncacn_np";
702 static unsigned char address
[] = ".";
703 static unsigned char endpoint
[] = "\\pipe\\wine_rpc_test";
708 status
= RpcStringBindingComposeA(NULL
, ncacn_np
, address
,
709 endpoint
, NULL
, &binding
);
710 ok(status
== RPC_S_OK
, "RpcStringBindingCompose failed (%lu)\n", status
);
712 status
= RpcBindingFromStringBindingA(binding
, &handle
);
713 ok(status
== RPC_S_OK
, "RpcBindingFromStringBinding failed (%lu)\n", status
);
714 RpcStringFreeA(&binding
);
716 status
= RpcBindingToStringBindingA(handle
, &binding
);
717 ok(status
== RPC_S_OK
, "RpcStringBindingFromBinding failed with error %lu\n", status
);
719 ok(!strcmp((const char *)binding
, "ncacn_np:.[\\\\pipe\\\\wine_rpc_test]"),
720 "binding string didn't match what was expected: \"%s\"\n", binding
);
721 RpcStringFreeA(&binding
);
723 status
= RpcBindingFree(&handle
);
724 ok(status
== RPC_S_OK
, "RpcBindingFree failed with error %lu\n", status
);
727 static void test_UuidCreate(void)
733 version
= (guid
.Data3
& 0xf000) >> 12;
734 ok(version
== 4 || broken(version
== 1), "unexpected version %d\n",
738 static UUID v4and
= { 0, 0, 0x4000, { 0x80,0,0,0,0,0,0,0 } };
739 static UUID v4or
= { 0xffffffff, 0xffff, 0x4fff,
740 { 0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff } };
747 /* Generate a bunch of UUIDs and mask them. By the end, we expect
748 * every randomly generated bit to have been zero at least once,
749 * resulting in no bits set in the and mask except those which are not
750 * randomly generated: the version number and the topmost bits of the
751 * Data4 field (treated as big-endian.) Similarly, we expect only
752 * the bits which are not randomly set to be cleared in the or mask.
754 for (i
= 0; i
< 1000; i
++)
759 for (src
= (LPBYTE
)&guid
, dst
= (LPBYTE
)∧
760 src
- (LPBYTE
)&guid
< sizeof(guid
); src
++, dst
++)
762 for (src
= (LPBYTE
)&guid
, dst
= (LPBYTE
)∨
763 src
- (LPBYTE
)&guid
< sizeof(guid
); src
++, dst
++)
766 ok(UuidEqual(&and, &v4and
, &rslt
),
767 "unexpected bits set in V4 UUID: %s\n", wine_dbgstr_guid(&and));
768 ok(UuidEqual(&or, &v4or
, &rslt
),
769 "unexpected bits set in V4 UUID: %s\n", wine_dbgstr_guid(&or));
773 /* Older versions of Windows generate V1 UUIDs. For these, there are
774 * many stable bits, including at least the MAC address if one is
775 * present. Just check that Data4[0]'s most significant bits are
778 ok((guid
.Data4
[0] & 0xc0) == 0x80,
779 "unexpected value in Data4[0]: %02x\n", guid
.Data4
[0] & 0xc0);
783 static void test_UuidCreateSequential(void)
787 RPC_STATUS (WINAPI
*pUuidCreateSequential
)(UUID
*) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "UuidCreateSequential");
788 RPC_STATUS (WINAPI
*pI_UuidCreate
)(UUID
*) = (void*)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "I_UuidCreate");
791 if (!pUuidCreateSequential
)
793 win_skip("UuidCreateSequential not exported\n");
797 ok(pI_UuidCreate
!= pUuidCreateSequential
, "got %p, %p\n", pI_UuidCreate
, pUuidCreateSequential
);
799 ret
= pUuidCreateSequential(&guid1
);
800 ok(!ret
|| ret
== RPC_S_UUID_LOCAL_ONLY
,
801 "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08lx\n", ret
);
802 version
= (guid1
.Data3
& 0xf000) >> 12;
803 ok(version
== 1, "unexpected version %d\n", version
);
810 /* If the call succeeded, there's a valid (non-multicast) MAC
811 * address in the uuid:
813 ok(!(guid1
.Data4
[2] & 0x01) || broken(guid1
.Data4
[2] & 0x01), /* Win 8.1 */
814 "GUID does not appear to contain a MAC address: %s\n",
815 wine_dbgstr_guid(&guid1
));
819 /* Otherwise, there's a randomly generated multicast MAC address
820 * address in the uuid:
822 ok((guid1
.Data4
[2] & 0x01),
823 "GUID does not appear to contain a multicast MAC address: %s\n",
824 wine_dbgstr_guid(&guid1
));
826 /* Generate another GUID, and make sure its MAC address matches the
829 ret
= pUuidCreateSequential(&guid2
);
830 ok(!ret
|| ret
== RPC_S_UUID_LOCAL_ONLY
,
831 "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08lx\n", ret
);
832 version
= (guid2
.Data3
& 0xf000) >> 12;
833 ok(version
== 1, "unexpected version %d\n", version
);
834 ok(!memcmp(guid1
.Data4
, guid2
.Data4
, sizeof(guid2
.Data4
)),
835 "unexpected value in MAC address: %s\n",
836 wine_dbgstr_guid(&guid2
));
838 /* I_UuidCreate does exactly the same */
839 pI_UuidCreate(&guid2
);
840 version
= (guid2
.Data3
& 0xf000) >> 12;
841 ok(version
== 1, "unexpected version %d\n", version
);
842 ok(!memcmp(guid1
.Data4
, guid2
.Data4
, sizeof(guid2
.Data4
)),
843 "unexpected value in MAC address: %s\n",
844 wine_dbgstr_guid(&guid2
));
848 static void test_RpcBindingFree(void)
850 RPC_BINDING_HANDLE binding
= NULL
;
853 status
= RpcBindingFree(&binding
);
854 ok(status
== RPC_S_INVALID_BINDING
,
855 "RpcBindingFree should have returned RPC_S_INVALID_BINDING instead of %ld\n",
859 static void test_RpcIfInqId(void)
861 static const GUID guid
= {0x12345678, 0xdead, 0xbeef, {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}};
862 static RPC_STATUS (WINAPI
*pRpcIfInqId
)(RPC_IF_HANDLE
, RPC_IF_ID
*);
863 RPC_SERVER_INTERFACE server_interface
;
864 RPC_CLIENT_INTERFACE client_interface
;
865 RPC_IF_HANDLE test_handles
[2];
870 pRpcIfInqId
= (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "RpcIfInqId");
872 memset(&server_interface
, 0, sizeof(server_interface
));
873 memset(&client_interface
, 0, sizeof(client_interface
));
874 server_interface
.InterfaceId
.SyntaxGUID
= guid
;
875 server_interface
.InterfaceId
.SyntaxVersion
.MajorVersion
= 1;
876 server_interface
.InterfaceId
.SyntaxVersion
.MinorVersion
= 2;
877 client_interface
.InterfaceId
.SyntaxGUID
= guid
;
878 client_interface
.InterfaceId
.SyntaxVersion
.MajorVersion
= 1;
879 client_interface
.InterfaceId
.SyntaxVersion
.MinorVersion
= 2;
881 /* Crash on Windows */
884 status
= pRpcIfInqId(NULL
, &if_id
);
885 ok(status
== RPC_S_INVALID_ARG
, "Expected %#x, got %#lx.\n", RPC_S_INVALID_ARG
, status
);
887 status
= pRpcIfInqId((RPC_IF_HANDLE
)&server_interface
, NULL
);
888 ok(status
== RPC_S_INVALID_ARG
, "Expected %#x, got %#lx.\n", RPC_S_INVALID_ARG
, status
);
891 test_handles
[0] = (RPC_IF_HANDLE
)&server_interface
;
892 test_handles
[1] = (RPC_IF_HANDLE
)&client_interface
;
894 for (test_idx
= 0; test_idx
< ARRAY_SIZE(test_handles
); ++test_idx
)
896 memset(&if_id
, 0, sizeof(if_id
));
897 status
= pRpcIfInqId(test_handles
[test_idx
], &if_id
);
898 ok(status
== RPC_S_OK
, "Test %u: Expected %#x, got %#lx.\n", test_idx
, RPC_S_OK
, status
);
899 ok(!memcmp(&if_id
.Uuid
, &guid
, sizeof(guid
)), "Test %u: Expected UUID %s, got %s.\n", test_idx
,
900 wine_dbgstr_guid(&guid
), wine_dbgstr_guid(&if_id
.Uuid
));
901 ok(if_id
.VersMajor
== 1, "Test %u: Expected major version 1, got %hu.\n", test_idx
,
903 ok(if_id
.VersMinor
== 2, "Test %u: Expected minor version 2, got %hu.\n", test_idx
,
908 static void test_RpcServerInqDefaultPrincName(void)
911 RPC_CSTR principal
, saved_principal
;
915 GetUserNameExA( NameSamCompatible
, NULL
, &len
);
916 username
= malloc( len
);
917 GetUserNameExA( NameSamCompatible
, username
, &len
);
919 ret
= RpcServerInqDefaultPrincNameA( 0, NULL
);
920 ok( ret
== RPC_S_UNKNOWN_AUTHN_SERVICE
, "got %lu\n", ret
);
922 ret
= RpcServerInqDefaultPrincNameA( RPC_C_AUTHN_DEFAULT
, NULL
);
923 ok( ret
== RPC_S_UNKNOWN_AUTHN_SERVICE
, "got %lu\n", ret
);
925 principal
= (RPC_CSTR
)0xdeadbeef;
926 ret
= RpcServerInqDefaultPrincNameA( RPC_C_AUTHN_DEFAULT
, &principal
);
927 ok( ret
== RPC_S_UNKNOWN_AUTHN_SERVICE
, "got %lu\n", ret
);
928 ok( principal
== (RPC_CSTR
)0xdeadbeef, "got unexpected principal\n" );
930 saved_principal
= (RPC_CSTR
)0xdeadbeef;
931 ret
= RpcServerInqDefaultPrincNameA( RPC_C_AUTHN_WINNT
, &saved_principal
);
932 ok( ret
== RPC_S_OK
, "got %lu\n", ret
);
933 ok( saved_principal
!= (RPC_CSTR
)0xdeadbeef, "expected valid principal\n" );
934 ok( !strcmp( (const char *)saved_principal
, username
), "got \'%s\'\n", saved_principal
);
935 trace("%s\n", saved_principal
);
937 ret
= RpcServerRegisterAuthInfoA( (RPC_CSTR
)"wine\\test", RPC_C_AUTHN_WINNT
, NULL
, NULL
);
938 ok( ret
== RPC_S_OK
, "got %lu\n", ret
);
940 principal
= (RPC_CSTR
)0xdeadbeef;
941 ret
= RpcServerInqDefaultPrincNameA( RPC_C_AUTHN_WINNT
, &principal
);
942 ok( ret
== RPC_S_OK
, "got %lu\n", ret
);
943 ok( principal
!= (RPC_CSTR
)0xdeadbeef, "expected valid principal\n" );
944 ok( !strcmp( (const char *)principal
, username
), "got \'%s\'\n", principal
);
945 RpcStringFreeA( &principal
);
947 ret
= RpcServerRegisterAuthInfoA( saved_principal
, RPC_C_AUTHN_WINNT
, NULL
, NULL
);
948 ok( ret
== RPC_S_OK
, "got %lu\n", ret
);
950 RpcStringFreeA( &saved_principal
);
954 static void test_RpcServerRegisterAuthInfo(void)
958 status
= RpcServerRegisterAuthInfoW(NULL
, 600, NULL
, NULL
);
959 ok(status
== RPC_S_UNKNOWN_AUTHN_SERVICE
, "status = %lx\n", status
);
962 static void test_RpcServerUseProtseq(void)
965 RPC_BINDING_VECTOR
*bindings
;
967 ULONG binding_count_before
;
968 ULONG binding_count_after1
;
969 ULONG binding_count_after2
;
970 ULONG endpoints_registered
= 0;
971 static unsigned char iptcp
[] = "ncacn_ip_tcp";
972 static unsigned char np
[] = "ncacn_np";
973 static unsigned char ncalrpc
[] = "ncalrpc";
974 BOOL iptcp_registered
= FALSE
, np_registered
= FALSE
, ncalrpc_registered
= FALSE
;
976 status
= RpcServerInqBindings(&bindings
);
977 if (status
== RPC_S_NO_BINDINGS
)
978 binding_count_before
= 0;
981 binding_count_before
= bindings
->Count
;
982 ok(status
== RPC_S_OK
, "RpcServerInqBindings failed with status %ld\n", status
);
983 for (i
= 0; i
< bindings
->Count
; i
++)
986 status
= RpcBindingToStringBindingA(bindings
->BindingH
[i
], &str_bind
);
987 ok(status
== RPC_S_OK
, "RpcBindingToStringBinding failed with status %ld\n", status
);
988 if (lstrlenA((const char *)str_bind
) > 12 && !memcmp(str_bind
, "ncacn_ip_tcp", 12))
989 iptcp_registered
= TRUE
;
990 if (lstrlenA((const char *)str_bind
) > 8 && !memcmp(str_bind
, "ncacn_np", 8))
991 np_registered
= TRUE
;
992 if (lstrlenA((const char *)str_bind
) > 7 && !memcmp(str_bind
, "ncalrpc", 7))
993 ncalrpc_registered
= TRUE
;
994 RpcStringFreeA(&str_bind
);
996 RpcBindingVectorFree(&bindings
);
999 /* show that RpcServerUseProtseqEp(..., NULL, ...) is the same as
1000 * RpcServerUseProtseq(...) */
1001 status
= RpcServerUseProtseqEpA(ncalrpc
, 0, NULL
, NULL
);
1002 ok(status
== RPC_S_OK
|| broken(status
== RPC_S_INVALID_ENDPOINT_FORMAT
),
1003 "RpcServerUseProtseqEp with NULL endpoint failed with status %ld\n",
1006 /* register protocol sequences without explicit endpoints */
1007 status
= RpcServerUseProtseqA(np
, 0, NULL
);
1008 if (status
== RPC_S_PROTSEQ_NOT_SUPPORTED
)
1009 win_skip("ncacn_np not supported\n");
1011 ok(status
== RPC_S_OK
, "RpcServerUseProtseq(ncacn_np) failed with status %ld\n", status
);
1012 if (status
== RPC_S_OK
&& !np_registered
) endpoints_registered
++;
1014 status
= RpcServerUseProtseqA(iptcp
, 0, NULL
);
1015 ok(status
== RPC_S_OK
, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %ld\n", status
);
1016 if (status
== RPC_S_OK
&& !iptcp_registered
) endpoints_registered
++;
1018 status
= RpcServerUseProtseqA(ncalrpc
, 0, NULL
);
1019 ok(status
== RPC_S_OK
, "RpcServerUseProtseqEp(ncalrpc) failed with status %ld\n", status
);
1020 if (status
== RPC_S_OK
&& !ncalrpc_registered
) endpoints_registered
++;
1022 status
= RpcServerInqBindings(&bindings
);
1023 ok(status
== RPC_S_OK
, "RpcServerInqBindings failed with status %ld\n", status
);
1024 binding_count_after1
= bindings
->Count
;
1025 ok(binding_count_after1
== binding_count_before
+ endpoints_registered
,
1026 "wrong binding count - before: %lu, after %lu, endpoints registered %lu\n",
1027 binding_count_before
, binding_count_after1
, endpoints_registered
);
1028 for (i
= 0; i
< bindings
->Count
; i
++)
1031 status
= RpcBindingToStringBindingA(bindings
->BindingH
[i
], &str_bind
);
1032 ok(status
== RPC_S_OK
, "RpcBindingToStringBinding failed with status %ld\n", status
);
1033 trace("string binding: %s\n", str_bind
);
1034 RpcStringFreeA(&str_bind
);
1036 RpcBindingVectorFree(&bindings
);
1038 /* re-register - endpoints should be reused */
1039 status
= RpcServerUseProtseqA(np
, 0, NULL
);
1040 if (status
== RPC_S_PROTSEQ_NOT_SUPPORTED
)
1041 win_skip("ncacn_np not supported\n");
1043 ok(status
== RPC_S_OK
, "RpcServerUseProtseq(ncacn_np) failed with status %ld\n", status
);
1045 status
= RpcServerUseProtseqA(iptcp
, 0, NULL
);
1046 ok(status
== RPC_S_OK
, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %ld\n", status
);
1048 status
= RpcServerUseProtseqA(ncalrpc
, 0, NULL
);
1049 ok(status
== RPC_S_OK
, "RpcServerUseProtseqEp(ncalrpc) failed with status %ld\n", status
);
1051 status
= RpcServerInqBindings(&bindings
);
1052 ok(status
== RPC_S_OK
, "RpcServerInqBindings failed with status %ld\n", status
);
1053 binding_count_after2
= bindings
->Count
;
1054 ok(binding_count_after2
== binding_count_after1
,
1055 "bindings should have been re-used - after1: %lu after2: %lu\n",
1056 binding_count_after1
, binding_count_after2
);
1057 RpcBindingVectorFree(&bindings
);
1060 static void test_endpoint_mapper(RPC_CSTR protseq
, RPC_CSTR address
)
1062 static unsigned char annotation
[] = "Test annotation string.";
1064 RPC_BINDING_VECTOR
*binding_vector
;
1066 unsigned char *binding
;
1068 status
= RpcServerRegisterIf(IFoo_v0_0_s_ifspec
, NULL
, NULL
);
1069 ok(status
== RPC_S_OK
, "%s: RpcServerRegisterIf failed (%lu)\n", protseq
, status
);
1071 status
= RpcServerInqBindings(&binding_vector
);
1072 ok(status
== RPC_S_OK
, "%s: RpcServerInqBindings failed with error %lu\n", protseq
, status
);
1074 /* register endpoints created in test_RpcServerUseProtseq */
1075 status
= RpcEpRegisterA(IFoo_v0_0_s_ifspec
, binding_vector
, NULL
, annotation
);
1076 ok(status
== RPC_S_OK
, "%s: RpcEpRegisterA failed with error %lu\n", protseq
, status
);
1077 /* reregister the same endpoint with no annotation */
1078 status
= RpcEpRegisterA(IFoo_v0_0_s_ifspec
, binding_vector
, NULL
, NULL
);
1079 ok(status
== RPC_S_OK
, "%s: RpcEpRegisterA failed with error %lu\n", protseq
, status
);
1081 status
= RpcStringBindingComposeA(NULL
, protseq
, address
,
1082 NULL
, NULL
, &binding
);
1083 ok(status
== RPC_S_OK
, "%s: RpcStringBindingCompose failed (%lu)\n", protseq
, status
);
1085 status
= RpcBindingFromStringBindingA(binding
, &handle
);
1086 ok(status
== RPC_S_OK
, "%s: RpcBindingFromStringBinding failed (%lu)\n", protseq
, status
);
1088 RpcStringFreeA(&binding
);
1090 status
= RpcBindingReset(handle
);
1091 ok(status
== RPC_S_OK
, "%s: RpcBindingReset failed with error %lu\n", protseq
, status
);
1093 status
= RpcEpResolveBinding(handle
, IFoo_v0_0_s_ifspec
);
1094 ok(status
== RPC_S_OK
|| broken(status
== RPC_S_SERVER_UNAVAILABLE
), /* win9x */
1095 "%s: RpcEpResolveBinding failed with error %lu\n", protseq
, status
);
1097 status
= RpcBindingReset(handle
);
1098 ok(status
== RPC_S_OK
, "%s: RpcBindingReset failed with error %lu\n", protseq
, status
);
1100 status
= RpcBindingFree(&handle
);
1101 ok(status
== RPC_S_OK
, "%s: RpcBindingFree failed with error %lu\n", protseq
, status
);
1103 status
= RpcServerUnregisterIf(NULL
, NULL
, FALSE
);
1104 ok(status
== RPC_S_OK
, "%s: RpcServerUnregisterIf failed (%lu)\n", protseq
, status
);
1106 status
= RpcEpUnregister(IFoo_v0_0_s_ifspec
, binding_vector
, NULL
);
1107 ok(status
== RPC_S_OK
, "%s: RpcEpUnregisterA failed with error %lu\n", protseq
, status
);
1109 status
= RpcBindingVectorFree(&binding_vector
);
1110 ok(status
== RPC_S_OK
, "%s: RpcBindingVectorFree failed with error %lu\n", protseq
, status
);
1113 static BOOL
is_process_elevated(void)
1116 if (OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY
, &token
))
1118 TOKEN_ELEVATION_TYPE type
;
1122 ret
= GetTokenInformation( token
, TokenElevationType
, &type
, sizeof(type
), &size
);
1123 CloseHandle( token
);
1124 return (ret
&& type
== TokenElevationTypeFull
);
1129 static BOOL
is_firewall_enabled(void)
1132 INetFwMgr
*mgr
= NULL
;
1133 INetFwPolicy
*policy
= NULL
;
1134 INetFwProfile
*profile
= NULL
;
1135 VARIANT_BOOL enabled
= VARIANT_FALSE
;
1137 init
= CoInitializeEx( 0, COINIT_APARTMENTTHREADED
);
1139 hr
= CoCreateInstance( &CLSID_NetFwMgr
, NULL
, CLSCTX_INPROC_SERVER
, &IID_INetFwMgr
,
1141 ok( hr
== S_OK
, "got %08lx\n", hr
);
1142 if (hr
!= S_OK
) goto done
;
1144 hr
= INetFwMgr_get_LocalPolicy( mgr
, &policy
);
1145 ok( hr
== S_OK
, "got %08lx\n", hr
);
1146 if (hr
!= S_OK
) goto done
;
1148 hr
= INetFwPolicy_get_CurrentProfile( policy
, &profile
);
1149 if (hr
!= S_OK
) goto done
;
1151 hr
= INetFwProfile_get_FirewallEnabled( profile
, &enabled
);
1152 ok( hr
== S_OK
, "got %08lx\n", hr
);
1155 if (policy
) INetFwPolicy_Release( policy
);
1156 if (profile
) INetFwProfile_Release( profile
);
1157 if (mgr
) INetFwMgr_Release( mgr
);
1158 if (SUCCEEDED( init
)) CoUninitialize();
1159 return (enabled
== VARIANT_TRUE
);
1168 static HRESULT
set_firewall( enum firewall_op op
)
1171 INetFwMgr
*mgr
= NULL
;
1172 INetFwPolicy
*policy
= NULL
;
1173 INetFwProfile
*profile
= NULL
;
1174 INetFwAuthorizedApplication
*app
= NULL
;
1175 INetFwAuthorizedApplications
*apps
= NULL
;
1176 BSTR name
, image
= SysAllocStringLen( NULL
, MAX_PATH
);
1178 if (!GetModuleFileNameW( NULL
, image
, MAX_PATH
))
1180 SysFreeString( image
);
1183 init
= CoInitializeEx( 0, COINIT_APARTMENTTHREADED
);
1185 hr
= CoCreateInstance( &CLSID_NetFwMgr
, NULL
, CLSCTX_INPROC_SERVER
, &IID_INetFwMgr
,
1187 ok( hr
== S_OK
, "got %08lx\n", hr
);
1188 if (hr
!= S_OK
) goto done
;
1190 hr
= INetFwMgr_get_LocalPolicy( mgr
, &policy
);
1191 ok( hr
== S_OK
, "got %08lx\n", hr
);
1192 if (hr
!= S_OK
) goto done
;
1194 hr
= INetFwPolicy_get_CurrentProfile( policy
, &profile
);
1195 if (hr
!= S_OK
) goto done
;
1197 hr
= INetFwProfile_get_AuthorizedApplications( profile
, &apps
);
1198 ok( hr
== S_OK
, "got %08lx\n", hr
);
1199 if (hr
!= S_OK
) goto done
;
1201 hr
= CoCreateInstance( &CLSID_NetFwAuthorizedApplication
, NULL
, CLSCTX_INPROC_SERVER
,
1202 &IID_INetFwAuthorizedApplication
, (void **)&app
);
1203 ok( hr
== S_OK
, "got %08lx\n", hr
);
1204 if (hr
!= S_OK
) goto done
;
1206 hr
= INetFwAuthorizedApplication_put_ProcessImageFileName( app
, image
);
1207 if (hr
!= S_OK
) goto done
;
1209 name
= SysAllocString( L
"rpcrt4_test" );
1210 hr
= INetFwAuthorizedApplication_put_Name( app
, name
);
1211 SysFreeString( name
);
1212 ok( hr
== S_OK
, "got %08lx\n", hr
);
1213 if (hr
!= S_OK
) goto done
;
1216 hr
= INetFwAuthorizedApplications_Add( apps
, app
);
1217 else if (op
== APP_REMOVE
)
1218 hr
= INetFwAuthorizedApplications_Remove( apps
, image
);
1223 if (app
) INetFwAuthorizedApplication_Release( app
);
1224 if (apps
) INetFwAuthorizedApplications_Release( apps
);
1225 if (policy
) INetFwPolicy_Release( policy
);
1226 if (profile
) INetFwProfile_Release( profile
);
1227 if (mgr
) INetFwMgr_Release( mgr
);
1228 if (SUCCEEDED( init
)) CoUninitialize();
1229 SysFreeString( image
);
1235 static unsigned char ncacn_np
[] = "ncacn_np";
1236 static unsigned char ncalrpc
[] = "ncalrpc";
1237 static unsigned char np_address
[] = ".";
1238 BOOL firewall_enabled
= is_firewall_enabled();
1241 test_UuidFromString();
1243 test_UuidCreateSequential();
1244 test_DceErrorInqTextA();
1245 test_I_RpcMapWin32Status();
1246 test_RpcStringBindingParseA();
1247 test_RpcExceptionFilter();
1249 if (firewall_enabled
&& !is_process_elevated())
1251 skip("no privileges, skipping tests to avoid firewall dialog\n");
1256 test_RpcStringBindingFromBinding();
1257 test_RpcBindingFree();
1259 test_RpcServerInqDefaultPrincName();
1260 test_RpcServerRegisterAuthInfo();
1262 if (firewall_enabled
)
1264 HRESULT hr
= set_firewall(APP_ADD
);
1267 skip("can't authorize app in firewall %08lx\n", hr
);
1272 test_rpc_ncacn_ip_tcp();
1273 test_RpcServerUseProtseq();
1274 test_endpoint_mapper(ncacn_np
, np_address
);
1275 test_endpoint_mapper(ncalrpc
, NULL
);
1277 if (firewall_enabled
) set_firewall(APP_REMOVE
);