rpcrt4: Compile tests with -D__WINESRC__.

This commit is contained in:
Jacek Caban 2013-11-08 11:50:20 +01:00 committed by Alexandre Julliard
parent a808f23cba
commit 06246aff90
9 changed files with 65 additions and 60 deletions

View File

@ -1,6 +1,5 @@
TESTDLL = rpcrt4.dll
IMPORTS = ole32 rpcrt4 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
EXTRAIDLFLAGS = --prefix-server=s_
IDL_C_SRCS = server.idl

View File

@ -29,8 +29,8 @@
#include <winnt.h>
#include <winerror.h>
#include "initguid.h"
#include <ole2.h>
#include "rpc.h"
#include "rpcdce.h"
#include "rpcproxy.h"

View File

@ -14,6 +14,7 @@
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "rpc.h"
#include "rpcndr.h"
#include "rpcproxy.h"

View File

@ -29,6 +29,7 @@
#include <winbase.h>
#include <winnt.h>
#include <winerror.h>
#include <ole2.h>
#include "rpc.h"
#include "rpcdce.h"
@ -2092,7 +2093,7 @@ static void test_ndr_buffer(void)
StubDesc.RpcInterfaceInformation = (void *)&IFoo___RpcServerInterface;
status = RpcServerUseProtseqEp(ncalrpc, 20, endpoint, NULL);
status = RpcServerUseProtseqEpA(ncalrpc, 20, endpoint, NULL);
ok(RPC_S_OK == status, "RpcServerUseProtseqEp failed with status %u\n", status);
status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL);
ok(RPC_S_OK == status, "RpcServerRegisterIf failed with status %u\n", status);
@ -2104,12 +2105,12 @@ static void test_ndr_buffer(void)
return;
}
status = RpcStringBindingCompose(NULL, ncalrpc, NULL, endpoint, NULL, &binding);
status = RpcStringBindingComposeA(NULL, ncalrpc, NULL, endpoint, NULL, &binding);
ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%u)\n", status);
status = RpcBindingFromStringBinding(binding, &Handle);
status = RpcBindingFromStringBindingA(binding, &Handle);
ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%u)\n", status);
RpcStringFree(&binding);
RpcStringFreeA(&binding);
NdrClientInitializeNew(&RpcMessage, &StubMsg, &StubDesc, 5);
@ -2208,7 +2209,7 @@ static void test_NdrGetUserMarshalInfo(void)
RPC_MESSAGE rpc_msg;
RPC_STATUS (RPC_ENTRY *pNdrGetUserMarshalInfo)(ULONG *,ULONG,NDR_USER_MARSHAL_INFO *);
pNdrGetUserMarshalInfo = (void *)GetProcAddress(GetModuleHandle("rpcrt4.dll"), "NdrGetUserMarshalInfo");
pNdrGetUserMarshalInfo = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "NdrGetUserMarshalInfo");
if (!pNdrGetUserMarshalInfo)
{
skip("NdrGetUserMarshalInfo not exported\n");

View File

@ -28,6 +28,8 @@
#include <winbase.h>
#include <winnt.h>
#include <winerror.h>
#include <ole2.h>
#include <ntsecapi.h>
#include "rpc.h"
#include "rpcdce.h"
@ -113,7 +115,7 @@ static void UuidConversionAndComparison(void) {
ok( (UuidFromStringA((unsigned char*)str, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID String\n" );
str[i2] = x; /* change it back so remaining tests are interesting. */
}
RpcStringFree((unsigned char **)&str);
RpcStringFreeA((unsigned char **)&str);
}
/* Uuid to String to Uuid (wchar) */
@ -215,10 +217,10 @@ static void test_rpc_ncacn_ip_tcp(void)
static unsigned char endpoint[] = "4114";
static unsigned char spn[] = "principal";
status = RpcNetworkIsProtseqValid(foo);
status = RpcNetworkIsProtseqValidA(foo);
ok(status == RPC_S_INVALID_RPC_PROTSEQ, "return wrong\n");
status = RpcNetworkIsProtseqValid(ncacn_ip_tcp);
status = RpcNetworkIsProtseqValidA(ncacn_ip_tcp);
ok(status == RPC_S_OK, "return wrong\n");
status = RpcMgmtStopServerListening(NULL);
@ -235,7 +237,7 @@ todo_wine {
ok(status == RPC_S_NO_PROTSEQS_REGISTERED,
"wrong RpcServerListen error (%u)\n", status);
status = RpcServerUseProtseqEp(ncacn_ip_tcp, 20, endpoint, NULL);
status = RpcServerUseProtseqEpA(ncacn_ip_tcp, 20, endpoint, NULL);
ok(status == RPC_S_OK, "RpcServerUseProtseqEp failed (%u)\n", status);
status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL);
@ -252,30 +254,30 @@ todo_wine {
"wrong RpcServerListen error (%u)\n", status);
}
status = RpcStringBindingCompose(NULL, ncacn_ip_tcp, address,
status = RpcStringBindingComposeA(NULL, ncacn_ip_tcp, address,
endpoint, NULL, &binding);
ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%u)\n", status);
status = RpcBindingFromStringBinding(binding, &IFoo_IfHandle);
status = RpcBindingFromStringBindingA(binding, &IFoo_IfHandle);
ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%u)\n",
status);
status = RpcBindingSetAuthInfo(IFoo_IfHandle, NULL, RPC_C_AUTHN_LEVEL_NONE,
status = RpcBindingSetAuthInfoA(IFoo_IfHandle, NULL, RPC_C_AUTHN_LEVEL_NONE,
RPC_C_AUTHN_WINNT, NULL, RPC_C_AUTHZ_NAME);
ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%u)\n", status);
status = RpcBindingInqAuthInfo(IFoo_IfHandle, NULL, NULL, NULL, NULL, NULL);
status = RpcBindingInqAuthInfoA(IFoo_IfHandle, NULL, NULL, NULL, NULL, NULL);
ok(status == RPC_S_BINDING_HAS_NO_AUTH, "RpcBindingInqAuthInfo failed (%u)\n",
status);
status = RpcBindingSetAuthInfo(IFoo_IfHandle, spn, RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
status = RpcBindingSetAuthInfoA(IFoo_IfHandle, spn, RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
RPC_C_AUTHN_WINNT, NULL, RPC_C_AUTHZ_NAME);
ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%u)\n", status);
level = authnsvc = authzsvc = 0;
principal = (unsigned char *)0xdeadbeef;
identity = (RPC_AUTH_IDENTITY_HANDLE *)0xdeadbeef;
status = RpcBindingInqAuthInfo(IFoo_IfHandle, &principal, &level, &authnsvc,
status = RpcBindingInqAuthInfoA(IFoo_IfHandle, &principal, &level, &authnsvc,
&identity, &authzsvc);
ok(status == RPC_S_OK, "RpcBindingInqAuthInfo failed (%u)\n", status);
@ -284,7 +286,7 @@ todo_wine {
ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "expected RPC_C_AUTHN_LEVEL_PKT_PRIVACY, got %d\n", level);
ok(authnsvc == RPC_C_AUTHN_WINNT, "expected RPC_C_AUTHN_WINNT, got %d\n", authnsvc);
todo_wine ok(authzsvc == RPC_C_AUTHZ_NAME, "expected RPC_C_AUTHZ_NAME, got %d\n", authzsvc);
if (status == RPC_S_OK) RpcStringFree(&principal);
if (status == RPC_S_OK) RpcStringFreeA(&principal);
status = RpcMgmtStopServerListening(NULL);
ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%u)\n",
@ -302,7 +304,7 @@ todo_wine {
ok(status == RPC_S_OK, "RpcMgmtWaitServerListen failed (%u)\n", status);
}
status = RpcStringFree(&binding);
status = RpcStringFreeA(&binding);
ok(status == RPC_S_OK, "RpcStringFree failed (%u)\n", status);
status = RpcBindingFree(&IFoo_IfHandle);
@ -659,7 +661,7 @@ static void test_I_RpcExceptionFilter(void)
{
ULONG exception;
int retval;
int (WINAPI *pI_RpcExceptionFilter)(ULONG) = (void *)GetProcAddress(GetModuleHandle("rpcrt4.dll"), "I_RpcExceptionFilter");
int (WINAPI *pI_RpcExceptionFilter)(ULONG) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "I_RpcExceptionFilter");
if (!pI_RpcExceptionFilter)
{
@ -709,20 +711,20 @@ static void test_RpcStringBindingFromBinding(void)
handle_t handle;
RPC_CSTR binding;
status = RpcStringBindingCompose(NULL, ncacn_np, address,
status = RpcStringBindingComposeA(NULL, ncacn_np, address,
endpoint, NULL, &binding);
ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%u)\n", status);
status = RpcBindingFromStringBinding(binding, &handle);
status = RpcBindingFromStringBindingA(binding, &handle);
ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%u)\n", status);
RpcStringFree(&binding);
RpcStringFreeA(&binding);
status = RpcBindingToStringBinding(handle, &binding);
status = RpcBindingToStringBindingA(handle, &binding);
ok(status == RPC_S_OK, "RpcStringBindingFromBinding failed with error %u\n", status);
ok(!strcmp((const char *)binding, "ncacn_np:.[\\\\pipe\\\\wine_rpc_test]"),
"binding string didn't match what was expected: \"%s\"\n", binding);
RpcStringFree(&binding);
RpcStringFreeA(&binding);
status = RpcBindingFree(&handle);
ok(status == RPC_S_OK, "RpcBindingFree failed with error %u\n", status);
@ -798,7 +800,7 @@ static void test_UuidCreateSequential(void)
{
UUID guid1;
BYTE version;
RPC_STATUS (WINAPI *pUuidCreateSequential)(UUID *) = (void *)GetProcAddress(GetModuleHandle("rpcrt4.dll"), "UuidCreateSequential");
RPC_STATUS (WINAPI *pUuidCreateSequential)(UUID *) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "UuidCreateSequential");
RPC_STATUS ret;
if (!pUuidCreateSequential)
@ -903,12 +905,12 @@ static void test_RpcServerInqDefaultPrincName(void)
ok( ret == RPC_S_OK, "got %u\n", ret );
ok( principal != (RPC_CSTR)0xdeadbeef, "expected valid principal\n" );
ok( !strcmp( (const char *)principal, username ), "got \'%s\'\n", principal );
RpcStringFree( &principal );
RpcStringFreeA( &principal );
ret = RpcServerRegisterAuthInfoA( saved_principal, RPC_C_AUTHN_WINNT, NULL, NULL );
ok( ret == RPC_S_OK, "got %u\n", ret );
RpcStringFree( &saved_principal );
RpcStringFreeA( &saved_principal );
HeapFree( GetProcessHeap(), 0, username );
}

View File

@ -80,7 +80,7 @@ static void test_RpcAsyncGetCallStatus(void)
START_TEST( rpc_async )
{
HMODULE hRpcRt4 = GetModuleHandle("rpcrt4.dll");
HMODULE hRpcRt4 = GetModuleHandleA("rpcrt4.dll");
pRpcAsyncInitializeHandle = (void *)GetProcAddress(hRpcRt4, "RpcAsyncInitializeHandle");
pRpcAsyncGetCallStatus = (void *)GetProcAddress(hRpcRt4, "RpcAsyncGetCallStatus");
if (!pRpcAsyncInitializeHandle || !pRpcAsyncGetCallStatus)

View File

@ -55,24 +55,24 @@ static void test_RpcServerUseProtseq(void)
/* show that RpcServerUseProtseqEp(..., NULL, ...) is the same as
* RpcServerUseProtseq(...) */
status = RpcServerUseProtseqEp(ncalrpc, 0, NULL, NULL);
status = RpcServerUseProtseqEpA(ncalrpc, 0, NULL, NULL);
ok(status == RPC_S_OK || broken(status == RPC_S_INVALID_ENDPOINT_FORMAT),
"RpcServerUseProtseqEp with NULL endpoint failed with status %d\n",
status);
/* register protocol sequences without explicit endpoints */
status = RpcServerUseProtseq(np, 0, NULL);
status = RpcServerUseProtseqA(np, 0, NULL);
if (status == RPC_S_PROTSEQ_NOT_SUPPORTED)
win_skip("ncacn_np not supported\n");
else
ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_np) failed with status %d\n", status);
if (status == RPC_S_OK) endpoints_registered++;
status = RpcServerUseProtseq(iptcp, 0, NULL);
status = RpcServerUseProtseqA(iptcp, 0, NULL);
ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %d\n", status);
if (status == RPC_S_OK) endpoints_registered++;
status = RpcServerUseProtseq(ncalrpc, 0, NULL);
status = RpcServerUseProtseqA(ncalrpc, 0, NULL);
ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status);
if (status == RPC_S_OK) endpoints_registered++;
@ -85,24 +85,24 @@ static void test_RpcServerUseProtseq(void)
for (i = 0; i < bindings->Count; i++)
{
RPC_CSTR str_bind;
status = RpcBindingToStringBinding(bindings->BindingH[i], &str_bind);
status = RpcBindingToStringBindingA(bindings->BindingH[i], &str_bind);
ok(status == RPC_S_OK, "RpcBindingToStringBinding failed with status %d\n", status);
trace("string binding: %s\n", str_bind);
RpcStringFree(&str_bind);
RpcStringFreeA(&str_bind);
}
RpcBindingVectorFree(&bindings);
/* re-register - endpoints should be reused */
status = RpcServerUseProtseq(np, 0, NULL);
status = RpcServerUseProtseqA(np, 0, NULL);
if (status == RPC_S_PROTSEQ_NOT_SUPPORTED)
win_skip("ncacn_np not supported\n");
else
ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_np) failed with status %d\n", status);
status = RpcServerUseProtseq(iptcp, 0, NULL);
status = RpcServerUseProtseqA(iptcp, 0, NULL);
ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %d\n", status);
status = RpcServerUseProtseq(ncalrpc, 0, NULL);
status = RpcServerUseProtseqA(ncalrpc, 0, NULL);
ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status);
status = RpcServerInqBindings(&bindings);
@ -161,14 +161,14 @@ static void test_endpoint_mapper(RPC_CSTR protseq, RPC_CSTR address)
status = RpcEpRegisterA(IFoo_v0_0_s_ifspec, binding_vector, NULL, NULL);
ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %u\n", protseq, status);
status = RpcStringBindingCompose(NULL, protseq, address,
status = RpcStringBindingComposeA(NULL, protseq, address,
NULL, NULL, &binding);
ok(status == RPC_S_OK, "%s: RpcStringBindingCompose failed (%u)\n", protseq, status);
status = RpcBindingFromStringBinding(binding, &handle);
status = RpcBindingFromStringBindingA(binding, &handle);
ok(status == RPC_S_OK, "%s: RpcBindingFromStringBinding failed (%u)\n", protseq, status);
RpcStringFree(&binding);
RpcStringFreeA(&binding);
status = RpcBindingReset(handle);
ok(status == RPC_S_OK, "%s: RpcBindingReset failed with error %u\n", protseq, status);

View File

@ -19,6 +19,7 @@
*/
#include <windows.h>
#include <ole2.h>
#include <secext.h>
#include <rpcdce.h>
#include "wine/test.h"
@ -1492,58 +1493,58 @@ client(const char *test)
if (strcmp(test, "tcp_basic") == 0)
{
ok(RPC_S_OK == RpcStringBindingCompose(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
ok(RPC_S_OK == RpcStringBindingComposeA(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
run_tests();
authinfo_test(RPC_PROTSEQ_TCP, 0);
ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
}
else if (strcmp(test, "tcp_secure") == 0)
{
ok(RPC_S_OK == RpcStringBindingCompose(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
ok(RPC_S_OK == RpcStringBindingComposeA(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
set_auth_info(IServer_IfHandle);
authinfo_test(RPC_PROTSEQ_TCP, 1);
ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
}
else if (strcmp(test, "ncalrpc_basic") == 0)
{
ok(RPC_S_OK == RpcStringBindingCompose(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
run_tests(); /* can cause RPC_X_BAD_STUB_DATA exception */
authinfo_test(RPC_PROTSEQ_LRPC, 0);
ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
}
else if (strcmp(test, "ncalrpc_secure") == 0)
{
ok(RPC_S_OK == RpcStringBindingCompose(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
set_auth_info(IServer_IfHandle);
authinfo_test(RPC_PROTSEQ_LRPC, 1);
ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
}
else if (strcmp(test, "np_basic") == 0)
{
ok(RPC_S_OK == RpcStringBindingCompose(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
run_tests();
authinfo_test(RPC_PROTSEQ_NMP, 0);
stop();
ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
}
}
@ -1560,13 +1561,13 @@ server(void)
RPC_STATUS status, iptcp_status, np_status, ncalrpc_status;
DWORD ret;
iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL);
iptcp_status = RpcServerUseProtseqEpA(iptcp, 20, port, NULL);
ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %d\n", iptcp_status);
ncalrpc_status = RpcServerUseProtseqEp(ncalrpc, 0, guid, NULL);
ncalrpc_status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL);
ok(ncalrpc_status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", ncalrpc_status);
np_status = RpcServerUseProtseqEp(np, 0, pipe, NULL);
np_status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED)
skip("Protocol sequence ncacn_np is not supported\n");
else
@ -1584,7 +1585,7 @@ server(void)
ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status);
status = RpcServerListen(1, 20, TRUE);
ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status);
stop_event = CreateEvent(NULL, FALSE, FALSE, NULL);
stop_event = CreateEventW(NULL, FALSE, FALSE, NULL);
ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
if (iptcp_status == RPC_S_OK)

View File

@ -934,6 +934,7 @@ rpcproxy.h
<stdarg.h>
"windef.h"
"winbase.h"
"ole2.h"
"rpc.h"
"rpcndr.h"
"rpcproxy.h"