ReactOS 0.4.16-dev-1946-g52006dd
rpc.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <ntstatus.h>
#include "wine/test.h"
#include <windef.h>
#include <winbase.h>
#include <winnt.h>
#include <winerror.h>
#include <ole2.h>
#include <oleauto.h>
#include <ntsecapi.h>
#include <initguid.h>
#include <netfw.h>
#include "rpc.h"
#include "rpcdce.h"
#include "secext.h"
Include dependency graph for rpc.c:

Go to the source code of this file.

Classes

struct  twr_t
 

Macros

#define COBJMACROS
 
#define WIN32_NO_STATUS
 

Typedefs

typedef unsigned int unsigned32
 
typedef struct twr_t twr_t
 

Enumerations

enum  firewall_op {
  APP_ADD , APP_REMOVE , APP_ADD , APP_REMOVE ,
  APP_ADD , APP_REMOVE
}
 

Functions

RPC_STATUS WINAPI TowerExplode (const twr_t *tower, RPC_SYNTAX_IDENTIFIER *object, RPC_SYNTAX_IDENTIFIER *syntax, char **protseq, char **endpoint, char **address)
 
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)
 
static void test_UuidEqual (void)
 
static void test_UuidFromString (void)
 
static void test_DceErrorInqTextA (void)
 
static void test_rpc_ncacn_ip_tcp (void)
 
static void test_towers (void)
 
static void test_I_RpcMapWin32Status (void)
 
static void test_RpcStringBindingParseA (void)
 
static void test_RpcExceptionFilter (void)
 
static void test_RpcStringBindingFromBinding (void)
 
static void test_UuidCreate (void)
 
static void test_UuidCreateSequential (void)
 
static void test_RpcBindingFree (void)
 
static void test_RpcIfInqId (void)
 
static void test_RpcServerInqDefaultPrincName (void)
 
static void test_RpcServerRegisterAuthInfo (void)
 
static void test_RpcServerUseProtseq (void)
 
static void test_endpoint_mapper (RPC_CSTR protseq, RPC_CSTR address)
 
static BOOL is_process_elevated (void)
 
static BOOL is_firewall_enabled (void)
 
static HRESULT set_firewall (enum firewall_op op)
 
 START_TEST (rpc)
 

Variables

static UUID Uuid_Table [10]
 
static BOOL Uuid_Comparison_Grid [11][11]
 
static RPC_DISPATCH_FUNCTION IFoo_table []
 
static RPC_DISPATCH_TABLE IFoo_v0_0_DispatchTable
 
static const RPC_SERVER_INTERFACE IFoo___RpcServerInterface
 
static RPC_IF_HANDLE IFoo_v0_0_s_ifspec = (RPC_IF_HANDLE)& IFoo___RpcServerInterface
 
static const unsigned char tower_data_tcp_ip1 []
 
static const unsigned char tower_data_tcp_ip2 []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file rpc.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 27 of file rpc.c.

Typedef Documentation

◆ twr_t

typedef struct twr_t twr_t

◆ unsigned32

Definition at line 47 of file rpc.c.

Enumeration Type Documentation

◆ firewall_op

Enumerator
APP_ADD 
APP_REMOVE 
APP_ADD 
APP_REMOVE 
APP_ADD 
APP_REMOVE 

Definition at line 1184 of file rpc.c.

1185{
1186 APP_ADD,
1188};
@ APP_REMOVE
Definition: rpc.c:1187
@ APP_ADD
Definition: rpc.c:1186

Function Documentation

◆ is_firewall_enabled()

static BOOL is_firewall_enabled ( void  )
static

Definition at line 1151 of file rpc.c.

1152{
1153 HRESULT hr, init;
1154 INetFwMgr *mgr = NULL;
1157 VARIANT_BOOL enabled = VARIANT_FALSE;
1158
1160
1161 hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
1162 (void **)&mgr );
1163 ok( hr == S_OK, "got %08lx\n", hr );
1164 if (hr != S_OK) goto done;
1165
1166 hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
1167 ok( hr == S_OK, "got %08lx\n", hr );
1168 if (hr != S_OK) goto done;
1169
1170 hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
1171 if (hr != S_OK) goto done;
1172
1173 hr = INetFwProfile_get_FirewallEnabled( profile, &enabled );
1174 ok( hr == S_OK, "got %08lx\n", hr );
1175
1176done:
1177 if (policy) INetFwPolicy_Release( policy );
1178 if (profile) INetFwProfile_Release( profile );
1179 if (mgr) INetFwMgr_Release( mgr );
1180 if (SUCCEEDED( init )) CoUninitialize();
1181 return (enabled == VARIANT_TRUE);
1182}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:73
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
short VARIANT_BOOL
Definition: compat.h:2290
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define profile
Definition: kernel32.h:12
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
HRESULT hr
Definition: shlfolder.c:183
static int init
Definition: wintirpc.c:33

Referenced by START_TEST().

◆ is_process_elevated()

static BOOL is_process_elevated ( void  )
static

Definition at line 1135 of file rpc.c.

1136{
1137 HANDLE token;
1139 {
1141 DWORD size;
1142 BOOL ret;
1143
1145 CloseHandle( token );
1146 return (ret && type == TokenElevationTypeFull);
1147 }
1148 return FALSE;
1149}
#define FALSE
Definition: types.h:117
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
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 token
Definition: glfuncs.h:210
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeFull
Definition: winnt_old.h:2700
#define TOKEN_QUERY
Definition: setypes.h:940
@ TokenElevationType
Definition: setypes.h:995

Referenced by START_TEST().

◆ set_firewall()

static HRESULT set_firewall ( enum firewall_op  op)
static

Definition at line 1190 of file rpc.c.

1191{
1192 HRESULT hr, init;
1193 INetFwMgr *mgr = NULL;
1199
1201 {
1203 return E_FAIL;
1204 }
1206
1207 hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
1208 (void **)&mgr );
1209 ok( hr == S_OK, "got %08lx\n", hr );
1210 if (hr != S_OK) goto done;
1211
1212 hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
1213 ok( hr == S_OK, "got %08lx\n", hr );
1214 if (hr != S_OK) goto done;
1215
1216 hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
1217 if (hr != S_OK) goto done;
1218
1219 hr = INetFwProfile_get_AuthorizedApplications( profile, &apps );
1220 ok( hr == S_OK, "got %08lx\n", hr );
1221 if (hr != S_OK) goto done;
1222
1223 hr = CoCreateInstance( &CLSID_NetFwAuthorizedApplication, NULL, CLSCTX_INPROC_SERVER,
1224 &IID_INetFwAuthorizedApplication, (void **)&app );
1225 ok( hr == S_OK, "got %08lx\n", hr );
1226 if (hr != S_OK) goto done;
1227
1228 hr = INetFwAuthorizedApplication_put_ProcessImageFileName( app, image );
1229 if (hr != S_OK) goto done;
1230
1231 name = SysAllocString( L"rpcrt4_test" );
1232 hr = INetFwAuthorizedApplication_put_Name( app, name );
1234 ok( hr == S_OK, "got %08lx\n", hr );
1235 if (hr != S_OK) goto done;
1236
1237 if (op == APP_ADD)
1238 hr = INetFwAuthorizedApplications_Add( apps, app );
1239 else if (op == APP_REMOVE)
1240 hr = INetFwAuthorizedApplications_Remove( apps, image );
1241 else
1242 hr = E_INVALIDARG;
1243
1244done:
1245 if (app) INetFwAuthorizedApplication_Release( app );
1246 if (apps) INetFwAuthorizedApplications_Release( apps );
1247 if (policy) INetFwPolicy_Release( policy );
1248 if (profile) INetFwProfile_Release( profile );
1249 if (mgr) INetFwMgr_Release( mgr );
1250 if (SUCCEEDED( init )) CoUninitialize();
1252 return hr;
1253}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
UINT op
Definition: effect.c:236
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
#define L(x)
Definition: resources.c:13
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
Definition: name.c:39

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( rpc  )

Definition at line 1255 of file rpc.c.

1256{
1257 static unsigned char ncacn_np[] = "ncacn_np";
1258 static unsigned char ncalrpc[] = "ncalrpc";
1259 static unsigned char np_address[] = ".";
1260 BOOL firewall_enabled = is_firewall_enabled();
1261
1270
1271 if (firewall_enabled && !is_process_elevated())
1272 {
1273 skip("no privileges, skipping tests to avoid firewall dialog\n");
1274 return;
1275 }
1276
1277 test_towers();
1280#ifdef __REACTOS__
1281 test_RpcStringFree();
1282#endif
1286
1287 if (firewall_enabled)
1288 {
1290 if (hr != S_OK)
1291 {
1292 skip("can't authorize app in firewall %08lx\n", hr);
1293 return;
1294 }
1295 }
1296
1299 test_endpoint_mapper(ncacn_np, np_address);
1300 test_endpoint_mapper(ncalrpc, NULL);
1301
1302 if (firewall_enabled) set_firewall(APP_REMOVE);
1303}
#define skip(...)
Definition: atltest.h:64
static void test_UuidFromString(void)
Definition: rpc.c:116
static void test_rpc_ncacn_ip_tcp(void)
Definition: rpc.c:214
static void test_RpcIfInqId(void)
Definition: rpc.c:881
static void test_DceErrorInqTextA(void)
Definition: rpc.c:162
static void test_RpcServerUseProtseq(void)
Definition: rpc.c:984
static void test_UuidCreateSequential(void)
Definition: rpc.c:787
static HRESULT set_firewall(enum firewall_op op)
Definition: rpc.c:1190
static void test_endpoint_mapper(RPC_CSTR protseq, RPC_CSTR address)
Definition: rpc.c:1082
static void test_RpcServerRegisterAuthInfo(void)
Definition: rpc.c:976
static void test_UuidEqual(void)
Definition: rpc.c:85
static void test_towers(void)
Definition: rpc.c:343
static void test_RpcBindingFree(void)
Definition: rpc.c:852
static void test_RpcStringBindingParseA(void)
Definition: rpc.c:575
static void test_I_RpcMapWin32Status(void)
Definition: rpc.c:431
static BOOL is_process_elevated(void)
Definition: rpc.c:1135
static BOOL is_firewall_enabled(void)
Definition: rpc.c:1151
static void test_UuidCreate(void)
Definition: rpc.c:731
static void test_RpcExceptionFilter(void)
Definition: rpc.c:656
static void test_RpcStringBindingFromBinding(void)
Definition: rpc.c:703
static void test_RpcServerInqDefaultPrincName(void)
Definition: rpc.c:930

◆ test_DceErrorInqTextA()

static void test_DceErrorInqTextA ( void  )
static

Definition at line 162 of file rpc.c.

163{
164 char bufferInvalid [1024];
165 char buffer [1024];
166 DWORD dwCount;
168
170 RPC_S_NOT_RPC_ERROR, 0, bufferInvalid, ARRAY_SIZE(bufferInvalid), NULL);
171 ok(dwCount, "Cannot set up for DceErrorInqText\n");
172
173 /* 0 is success */
174 status = DceErrorInqTextA(0, (unsigned char*)buffer);
175 ok(status == RPC_S_OK, "got %lx\n", status);
176
177 /* A real RPC_S error */
179 ok(status == RPC_S_OK, "got %lx\n", status);
180
181 /* A message for which FormatMessage should fail which should return RPC_S_OK and the
182 * fixed "not valid" message */
183 status = DceErrorInqTextA(35, (unsigned char*)buffer);
184 ok(status == RPC_S_OK, "got %lx\n", status);
185 ok(!strcmp(buffer, bufferInvalid), "got %s vs %s\n", wine_dbgstr_a(buffer), wine_dbgstr_a(bufferInvalid));
186}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define ARRAY_SIZE(A)
Definition: main.h:20
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
GLuint buffer
Definition: glext.h:5915
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS RPC_ENTRY DceErrorInqTextA(RPC_STATUS e, RPC_CSTR buffer)
Definition: rpcrt4_main.c:728
long RPC_STATUS
Definition: rpc.h:48
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:187
Definition: ps.c:97
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:397
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1372
#define RPC_S_NOT_RPC_ERROR
Definition: winerror.h:1487

Referenced by START_TEST().

◆ test_endpoint_mapper()

static void test_endpoint_mapper ( RPC_CSTR  protseq,
RPC_CSTR  address 
)
static

Definition at line 1082 of file rpc.c.

1083{
1084 static unsigned char annotation[] = "Test annotation string.";
1086 RPC_BINDING_VECTOR *binding_vector;
1088 unsigned char *binding;
1089
1091 ok(status == RPC_S_OK, "%s: RpcServerRegisterIf failed (%lu)\n", protseq, status);
1092
1093 status = RpcServerInqBindings(&binding_vector);
1094 ok(status == RPC_S_OK, "%s: RpcServerInqBindings failed with error %lu\n", protseq, status);
1095
1096 /* register endpoints created in test_RpcServerUseProtseq */
1098 ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %lu\n", protseq, status);
1099 /* reregister the same endpoint with no annotation */
1100 status = RpcEpRegisterA(IFoo_v0_0_s_ifspec, binding_vector, NULL, NULL);
1101 ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %lu\n", protseq, status);
1102
1104 NULL, NULL, &binding);
1105 ok(status == RPC_S_OK, "%s: RpcStringBindingCompose failed (%lu)\n", protseq, status);
1106
1108 ok(status == RPC_S_OK, "%s: RpcBindingFromStringBinding failed (%lu)\n", protseq, status);
1109
1111
1113 ok(status == RPC_S_OK, "%s: RpcBindingReset failed with error %lu\n", protseq, status);
1114
1117 "%s: RpcEpResolveBinding failed with error %lu\n", protseq, status);
1118
1120 ok(status == RPC_S_OK, "%s: RpcBindingReset failed with error %lu\n", protseq, status);
1121
1123 ok(status == RPC_S_OK, "%s: RpcBindingFree failed with error %lu\n", protseq, status);
1124
1126 ok(status == RPC_S_OK, "%s: RpcServerUnregisterIf failed (%lu)\n", protseq, status);
1127
1128 status = RpcEpUnregister(IFoo_v0_0_s_ifspec, binding_vector, NULL);
1129 ok(status == RPC_S_OK, "%s: RpcEpUnregisterA failed with error %lu\n", protseq, status);
1130
1131 status = RpcBindingVectorFree(&binding_vector);
1132 ok(status == RPC_S_OK, "%s: RpcBindingVectorFree failed with error %lu\n", protseq, status);
1133}
#define broken(x)
Definition: atltest.h:178
#define annotation(x)
Definition: dispex.idl:19
GLuint address
Definition: glext.h:9393
static RPC_IF_HANDLE IFoo_v0_0_s_ifspec
Definition: rpc.c:212
static RPC_BINDING_HANDLE binding
Definition: server.c:166
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769
RPC_STATUS WINAPI RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:440
RPC_STATUS WINAPI RpcBindingVectorFree(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_binding.c:784
RPC_STATUS RPC_ENTRY RpcBindingReset(RPC_BINDING_HANDLE Binding)
Definition: rpc_binding.c:1006
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:822
RPC_STATUS WINAPI RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, UUID_VECTOR *UuidVector)
Definition: rpc_epmap.c:343
RPC_STATUS WINAPI RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec)
Definition: rpc_epmap.c:430
RPC_STATUS WINAPI RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, UUID_VECTOR *UuidVector, RPC_CSTR Annotation)
Definition: rpc_epmap.c:295
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
RPC_STATUS WINAPI RpcServerInqBindings(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_server.c:863
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:164
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1389

Referenced by START_TEST().

◆ test_I_RpcMapWin32Status()

static void test_I_RpcMapWin32Status ( void  )
static

Definition at line 431 of file rpc.c.

432{
433 LONG win32status;
434 RPC_STATUS rpc_status;
435 BOOL w2k3_up = FALSE;
436
437 /* Windows 2003 and above return STATUS_UNSUCCESSFUL if given an unknown status */
438 win32status = I_RpcMapWin32Status(9999);
439 if (win32status == STATUS_UNSUCCESSFUL)
440 w2k3_up = TRUE;
441
442 /* On Windows XP-SP1 and below some statuses are not mapped and return
443 * the given status
444 */
445 for (rpc_status = 0; rpc_status < 10000; rpc_status++)
446 {
447 LONG expected_win32status;
448 BOOL missing = FALSE;
449
450 win32status = I_RpcMapWin32Status(rpc_status);
451 switch (rpc_status)
452 {
453 case ERROR_SUCCESS: expected_win32status = ERROR_SUCCESS; break;
454 case ERROR_ACCESS_DENIED: expected_win32status = STATUS_ACCESS_DENIED; break;
455 case ERROR_INVALID_HANDLE: expected_win32status = RPC_NT_SS_CONTEXT_MISMATCH; break;
456 case ERROR_OUTOFMEMORY: expected_win32status = STATUS_NO_MEMORY; break;
457 case ERROR_INVALID_PARAMETER: expected_win32status = STATUS_INVALID_PARAMETER; break;
458 case ERROR_INSUFFICIENT_BUFFER: expected_win32status = STATUS_BUFFER_TOO_SMALL; break;
459 case ERROR_MAX_THRDS_REACHED: expected_win32status = STATUS_NO_MEMORY; break;
460 case ERROR_NOACCESS: expected_win32status = STATUS_ACCESS_VIOLATION; break;
461 case ERROR_NOT_ENOUGH_SERVER_MEMORY: expected_win32status = STATUS_INSUFF_SERVER_RESOURCES; break;
462 case ERROR_WRONG_PASSWORD: expected_win32status = STATUS_WRONG_PASSWORD; missing = TRUE; break;
463 case ERROR_INVALID_LOGON_HOURS: expected_win32status = STATUS_INVALID_LOGON_HOURS; missing = TRUE; break;
464 case ERROR_PASSWORD_EXPIRED: expected_win32status = STATUS_PASSWORD_EXPIRED; missing = TRUE; break;
465 case ERROR_ACCOUNT_DISABLED: expected_win32status = STATUS_ACCOUNT_DISABLED; missing = TRUE; break;
466 case ERROR_INVALID_SECURITY_DESCR: expected_win32status = STATUS_INVALID_SECURITY_DESCR; break;
467 case RPC_S_INVALID_STRING_BINDING: expected_win32status = RPC_NT_INVALID_STRING_BINDING; break;
468 case RPC_S_WRONG_KIND_OF_BINDING: expected_win32status = RPC_NT_WRONG_KIND_OF_BINDING; break;
469 case RPC_S_INVALID_BINDING: expected_win32status = RPC_NT_INVALID_BINDING; break;
470 case RPC_S_PROTSEQ_NOT_SUPPORTED: expected_win32status = RPC_NT_PROTSEQ_NOT_SUPPORTED; break;
471 case RPC_S_INVALID_RPC_PROTSEQ: expected_win32status = RPC_NT_INVALID_RPC_PROTSEQ; break;
472 case RPC_S_INVALID_STRING_UUID: expected_win32status = RPC_NT_INVALID_STRING_UUID; break;
473 case RPC_S_INVALID_ENDPOINT_FORMAT: expected_win32status = RPC_NT_INVALID_ENDPOINT_FORMAT; break;
474 case RPC_S_INVALID_NET_ADDR: expected_win32status = RPC_NT_INVALID_NET_ADDR; break;
475 case RPC_S_NO_ENDPOINT_FOUND: expected_win32status = RPC_NT_NO_ENDPOINT_FOUND; break;
476 case RPC_S_INVALID_TIMEOUT: expected_win32status = RPC_NT_INVALID_TIMEOUT; break;
477 case RPC_S_OBJECT_NOT_FOUND: expected_win32status = RPC_NT_OBJECT_NOT_FOUND; break;
478 case RPC_S_ALREADY_REGISTERED: expected_win32status = RPC_NT_ALREADY_REGISTERED; break;
479 case RPC_S_TYPE_ALREADY_REGISTERED: expected_win32status = RPC_NT_TYPE_ALREADY_REGISTERED; break;
480 case RPC_S_ALREADY_LISTENING: expected_win32status = RPC_NT_ALREADY_LISTENING; break;
481 case RPC_S_NO_PROTSEQS_REGISTERED: expected_win32status = RPC_NT_NO_PROTSEQS_REGISTERED; break;
482 case RPC_S_NOT_LISTENING: expected_win32status = RPC_NT_NOT_LISTENING; break;
483 case RPC_S_UNKNOWN_MGR_TYPE: expected_win32status = RPC_NT_UNKNOWN_MGR_TYPE; break;
484 case RPC_S_UNKNOWN_IF: expected_win32status = RPC_NT_UNKNOWN_IF; break;
485 case RPC_S_NO_BINDINGS: expected_win32status = RPC_NT_NO_BINDINGS; break;
486 case RPC_S_NO_PROTSEQS: expected_win32status = RPC_NT_NO_PROTSEQS; break;
487 case RPC_S_CANT_CREATE_ENDPOINT: expected_win32status = RPC_NT_CANT_CREATE_ENDPOINT; break;
488 case RPC_S_OUT_OF_RESOURCES: expected_win32status = RPC_NT_OUT_OF_RESOURCES; break;
489 case RPC_S_SERVER_UNAVAILABLE: expected_win32status = RPC_NT_SERVER_UNAVAILABLE; break;
490 case RPC_S_SERVER_TOO_BUSY: expected_win32status = RPC_NT_SERVER_TOO_BUSY; break;
491 case RPC_S_INVALID_NETWORK_OPTIONS: expected_win32status = RPC_NT_INVALID_NETWORK_OPTIONS; break;
492 case RPC_S_NO_CALL_ACTIVE: expected_win32status = RPC_NT_NO_CALL_ACTIVE; break;
493 case RPC_S_CALL_FAILED: expected_win32status = RPC_NT_CALL_FAILED; break;
494 case RPC_S_CALL_FAILED_DNE: expected_win32status = RPC_NT_CALL_FAILED_DNE; break;
495 case RPC_S_PROTOCOL_ERROR: expected_win32status = RPC_NT_PROTOCOL_ERROR; break;
496 case RPC_S_UNSUPPORTED_TRANS_SYN: expected_win32status = RPC_NT_UNSUPPORTED_TRANS_SYN; break;
497 case RPC_S_UNSUPPORTED_TYPE: expected_win32status = RPC_NT_UNSUPPORTED_TYPE; break;
498 case RPC_S_INVALID_TAG: expected_win32status = RPC_NT_INVALID_TAG; break;
499 case RPC_S_INVALID_BOUND: expected_win32status = RPC_NT_INVALID_BOUND; break;
500 case RPC_S_NO_ENTRY_NAME: expected_win32status = RPC_NT_NO_ENTRY_NAME; break;
501 case RPC_S_INVALID_NAME_SYNTAX: expected_win32status = RPC_NT_INVALID_NAME_SYNTAX; break;
502 case RPC_S_UNSUPPORTED_NAME_SYNTAX: expected_win32status = RPC_NT_UNSUPPORTED_NAME_SYNTAX; break;
503 case RPC_S_UUID_NO_ADDRESS: expected_win32status = RPC_NT_UUID_NO_ADDRESS; break;
504 case RPC_S_DUPLICATE_ENDPOINT: expected_win32status = RPC_NT_DUPLICATE_ENDPOINT; break;
505 case RPC_S_UNKNOWN_AUTHN_TYPE: expected_win32status = RPC_NT_UNKNOWN_AUTHN_TYPE; break;
506 case RPC_S_MAX_CALLS_TOO_SMALL: expected_win32status = RPC_NT_MAX_CALLS_TOO_SMALL; break;
507 case RPC_S_STRING_TOO_LONG: expected_win32status = RPC_NT_STRING_TOO_LONG; break;
508 case RPC_S_PROTSEQ_NOT_FOUND: expected_win32status = RPC_NT_PROTSEQ_NOT_FOUND; break;
509 case RPC_S_PROCNUM_OUT_OF_RANGE: expected_win32status = RPC_NT_PROCNUM_OUT_OF_RANGE; break;
510 case RPC_S_BINDING_HAS_NO_AUTH: expected_win32status = RPC_NT_BINDING_HAS_NO_AUTH; break;
511 case RPC_S_UNKNOWN_AUTHN_SERVICE: expected_win32status = RPC_NT_UNKNOWN_AUTHN_SERVICE; break;
512 case RPC_S_UNKNOWN_AUTHN_LEVEL: expected_win32status = RPC_NT_UNKNOWN_AUTHN_LEVEL; break;
513 case RPC_S_INVALID_AUTH_IDENTITY: expected_win32status = RPC_NT_INVALID_AUTH_IDENTITY; break;
514 case RPC_S_UNKNOWN_AUTHZ_SERVICE: expected_win32status = RPC_NT_UNKNOWN_AUTHZ_SERVICE; break;
515 case EPT_S_INVALID_ENTRY: expected_win32status = EPT_NT_INVALID_ENTRY; break;
516 case EPT_S_CANT_PERFORM_OP: expected_win32status = EPT_NT_CANT_PERFORM_OP; break;
517 case EPT_S_NOT_REGISTERED: expected_win32status = EPT_NT_NOT_REGISTERED; break;
518 case EPT_S_CANT_CREATE: expected_win32status = EPT_NT_CANT_CREATE; break;
519 case RPC_S_NOTHING_TO_EXPORT: expected_win32status = RPC_NT_NOTHING_TO_EXPORT; break;
520 case RPC_S_INCOMPLETE_NAME: expected_win32status = RPC_NT_INCOMPLETE_NAME; break;
521 case RPC_S_INVALID_VERS_OPTION: expected_win32status = RPC_NT_INVALID_VERS_OPTION; break;
522 case RPC_S_NO_MORE_MEMBERS: expected_win32status = RPC_NT_NO_MORE_MEMBERS; break;
523 case RPC_S_NOT_ALL_OBJS_UNEXPORTED: expected_win32status = RPC_NT_NOT_ALL_OBJS_UNEXPORTED; break;
524 case RPC_S_INTERFACE_NOT_FOUND: expected_win32status = RPC_NT_INTERFACE_NOT_FOUND; break;
525 case RPC_S_ENTRY_ALREADY_EXISTS: expected_win32status = RPC_NT_ENTRY_ALREADY_EXISTS; break;
526 case RPC_S_ENTRY_NOT_FOUND: expected_win32status = RPC_NT_ENTRY_NOT_FOUND; break;
527 case RPC_S_NAME_SERVICE_UNAVAILABLE: expected_win32status = RPC_NT_NAME_SERVICE_UNAVAILABLE; break;
528 case RPC_S_INVALID_NAF_ID: expected_win32status = RPC_NT_INVALID_NAF_ID; break;
529 case RPC_S_CANNOT_SUPPORT: expected_win32status = RPC_NT_CANNOT_SUPPORT; break;
530 case RPC_S_NO_CONTEXT_AVAILABLE: expected_win32status = RPC_NT_NO_CONTEXT_AVAILABLE; break;
531 case RPC_S_INTERNAL_ERROR: expected_win32status = RPC_NT_INTERNAL_ERROR; break;
532 case RPC_S_ZERO_DIVIDE: expected_win32status = RPC_NT_ZERO_DIVIDE; break;
533 case RPC_S_ADDRESS_ERROR: expected_win32status = RPC_NT_ADDRESS_ERROR; break;
534 case RPC_S_FP_DIV_ZERO: expected_win32status = RPC_NT_FP_DIV_ZERO; break;
535 case RPC_S_FP_UNDERFLOW: expected_win32status = RPC_NT_FP_UNDERFLOW; break;
536 case RPC_S_FP_OVERFLOW: expected_win32status = RPC_NT_FP_OVERFLOW; break;
537 case RPC_S_CALL_IN_PROGRESS: expected_win32status = RPC_NT_CALL_IN_PROGRESS; break;
538 case RPC_S_NO_MORE_BINDINGS: expected_win32status = RPC_NT_NO_MORE_BINDINGS; break;
539 case RPC_S_CALL_CANCELLED: expected_win32status = RPC_NT_CALL_CANCELLED; missing = TRUE; break;
540 case RPC_S_INVALID_OBJECT: expected_win32status = RPC_NT_INVALID_OBJECT; break;
541 case RPC_S_INVALID_ASYNC_HANDLE: expected_win32status = RPC_NT_INVALID_ASYNC_HANDLE; missing = TRUE; break;
542 case RPC_S_INVALID_ASYNC_CALL: expected_win32status = RPC_NT_INVALID_ASYNC_CALL; missing = TRUE; break;
543 case RPC_S_GROUP_MEMBER_NOT_FOUND: expected_win32status = RPC_NT_GROUP_MEMBER_NOT_FOUND; break;
544 case RPC_X_NO_MORE_ENTRIES: expected_win32status = RPC_NT_NO_MORE_ENTRIES; break;
545 case RPC_X_SS_CHAR_TRANS_OPEN_FAIL: expected_win32status = RPC_NT_SS_CHAR_TRANS_OPEN_FAIL; break;
546 case RPC_X_SS_CHAR_TRANS_SHORT_FILE: expected_win32status = RPC_NT_SS_CHAR_TRANS_SHORT_FILE; break;
547 case RPC_X_SS_IN_NULL_CONTEXT: expected_win32status = RPC_NT_SS_IN_NULL_CONTEXT; break;
548 case RPC_X_SS_CONTEXT_DAMAGED: expected_win32status = RPC_NT_SS_CONTEXT_DAMAGED; break;
549 case RPC_X_SS_HANDLES_MISMATCH: expected_win32status = RPC_NT_SS_HANDLES_MISMATCH; break;
550 case RPC_X_SS_CANNOT_GET_CALL_HANDLE: expected_win32status = RPC_NT_SS_CANNOT_GET_CALL_HANDLE; break;
551 case RPC_X_NULL_REF_POINTER: expected_win32status = RPC_NT_NULL_REF_POINTER; break;
552 case RPC_X_ENUM_VALUE_OUT_OF_RANGE: expected_win32status = RPC_NT_ENUM_VALUE_OUT_OF_RANGE; break;
553 case RPC_X_BYTE_COUNT_TOO_SMALL: expected_win32status = RPC_NT_BYTE_COUNT_TOO_SMALL; break;
554 case RPC_X_BAD_STUB_DATA: expected_win32status = RPC_NT_BAD_STUB_DATA; break;
555 case RPC_X_PIPE_CLOSED: expected_win32status = RPC_NT_PIPE_CLOSED; missing = TRUE; break;
556 case RPC_X_PIPE_DISCIPLINE_ERROR: expected_win32status = RPC_NT_PIPE_DISCIPLINE_ERROR; missing = TRUE; break;
557 case RPC_X_PIPE_EMPTY: expected_win32status = RPC_NT_PIPE_EMPTY; missing = TRUE; break;
558 case ERROR_PASSWORD_MUST_CHANGE: expected_win32status = STATUS_PASSWORD_MUST_CHANGE; missing = TRUE; break;
559 case ERROR_ACCOUNT_LOCKED_OUT: expected_win32status = STATUS_ACCOUNT_LOCKED_OUT; missing = TRUE; break;
560 default:
561 if (w2k3_up)
562 expected_win32status = STATUS_UNSUCCESSFUL;
563 else
564 expected_win32status = rpc_status;
565 }
566
567 ok(win32status == expected_win32status ||
568 broken(missing && win32status == rpc_status),
569 "I_RpcMapWin32Status(%ld) should have returned 0x%lx instead of 0x%lx%s\n",
570 rpc_status, expected_win32status, win32status,
571 broken(missing) ? " (or have returned with the given status)" : "");
572 }
573}
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define STATUS_ACCESS_VIOLATION
#define RPC_NT_INVALID_NAF_ID
Definition: ntstatus.h:1593
#define EPT_NT_INVALID_ENTRY
Definition: ntstatus.h:1581
#define RPC_NT_SERVER_UNAVAILABLE
Definition: ntstatus.h:1555
#define RPC_NT_UNSUPPORTED_TYPE
Definition: ntstatus.h:1563
#define STATUS_WRONG_PASSWORD
Definition: ntstatus.h:436
#define RPC_NT_INTERFACE_NOT_FOUND
Definition: ntstatus.h:1589
#define RPC_NT_INVALID_NETWORK_OPTIONS
Definition: ntstatus.h:1557
#define RPC_NT_INVALID_RPC_PROTSEQ
Definition: ntstatus.h:1537
#define RPC_NT_BAD_STUB_DATA
Definition: ntstatus.h:1632
#define STATUS_INVALID_LOGON_HOURS
Definition: ntstatus.h:441
#define RPC_NT_INTERNAL_ERROR
Definition: ntstatus.h:1596
#define RPC_NT_UNKNOWN_AUTHN_LEVEL
Definition: ntstatus.h:1578
#define RPC_NT_SS_IN_NULL_CONTEXT
Definition: ntstatus.h:1624
#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE
Definition: ntstatus.h:1630
#define RPC_NT_PIPE_CLOSED
Definition: ntstatus.h:1639
#define RPC_NT_ENTRY_ALREADY_EXISTS
Definition: ntstatus.h:1590
#define RPC_NT_DUPLICATE_ENDPOINT
Definition: ntstatus.h:1570
#define RPC_NT_CALL_IN_PROGRESS
Definition: ntstatus.h:1602
#define RPC_NT_NO_CALL_ACTIVE
Definition: ntstatus.h:1558
#define RPC_NT_NO_ENDPOINT_FOUND
Definition: ntstatus.h:1541
#define RPC_NT_STRING_TOO_LONG
Definition: ntstatus.h:1573
#define RPC_NT_PROCNUM_OUT_OF_RANGE
Definition: ntstatus.h:1575
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:444
#define RPC_NT_PIPE_EMPTY
Definition: ntstatus.h:1641
#define RPC_NT_NO_MORE_ENTRIES
Definition: ntstatus.h:1621
#define STATUS_PASSWORD_MUST_CHANGE
Definition: ntstatus.h:802
#define RPC_NT_BYTE_COUNT_TOO_SMALL
Definition: ntstatus.h:1631
#define RPC_NT_SS_CONTEXT_MISMATCH
Definition: ntstatus.h:1625
#define RPC_NT_WRONG_KIND_OF_BINDING
Definition: ntstatus.h:1534
#define RPC_NT_ALREADY_REGISTERED
Definition: ntstatus.h:1544
#define EPT_NT_NOT_REGISTERED
Definition: ntstatus.h:1583
#define RPC_NT_INVALID_ASYNC_HANDLE
Definition: ntstatus.h:1616
#define RPC_NT_INVALID_NAME_SYNTAX
Definition: ntstatus.h:1567
#define RPC_NT_NOTHING_TO_EXPORT
Definition: ntstatus.h:1584
#define RPC_NT_UNKNOWN_IF
Definition: ntstatus.h:1550
#define RPC_NT_PROTOCOL_ERROR
Definition: ntstatus.h:1561
#define RPC_NT_ENTRY_NOT_FOUND
Definition: ntstatus.h:1591
#define RPC_NT_NO_PROTSEQS_REGISTERED
Definition: ntstatus.h:1547
#define RPC_NT_NULL_REF_POINTER
Definition: ntstatus.h:1629
#define RPC_NT_GROUP_MEMBER_NOT_FOUND
Definition: ntstatus.h:1604
#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL
Definition: ntstatus.h:1622
#define RPC_NT_UNSUPPORTED_TRANS_SYN
Definition: ntstatus.h:1562
#define RPC_NT_INVALID_STRING_UUID
Definition: ntstatus.h:1538
#define RPC_NT_NOT_LISTENING
Definition: ntstatus.h:1548
#define RPC_NT_OBJECT_NOT_FOUND
Definition: ntstatus.h:1543
#define STATUS_INSUFF_SERVER_RESOURCES
Definition: ntstatus.h:771
#define RPC_NT_INVALID_AUTH_IDENTITY
Definition: ntstatus.h:1579
#define RPC_NT_INVALID_ASYNC_CALL
Definition: ntstatus.h:1617
#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE
Definition: ntstatus.h:1623
#define RPC_NT_PROTSEQ_NOT_FOUND
Definition: ntstatus.h:1574
#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE
Definition: ntstatus.h:1628
#define RPC_NT_NO_ENTRY_NAME
Definition: ntstatus.h:1566
#define RPC_NT_CALL_CANCELLED
Definition: ntstatus.h:1608
#define RPC_NT_TYPE_ALREADY_REGISTERED
Definition: ntstatus.h:1545
#define RPC_NT_UUID_NO_ADDRESS
Definition: ntstatus.h:1569
#define RPC_NT_OUT_OF_RESOURCES
Definition: ntstatus.h:1554
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:451
#define RPC_NT_NO_CONTEXT_AVAILABLE
Definition: ntstatus.h:1595
#define RPC_NT_PIPE_DISCIPLINE_ERROR
Definition: ntstatus.h:1640
#define RPC_NT_MAX_CALLS_TOO_SMALL
Definition: ntstatus.h:1572
#define RPC_NT_INVALID_STRING_BINDING
Definition: ntstatus.h:1533
#define RPC_NT_NO_PROTSEQS
Definition: ntstatus.h:1552
#define RPC_NT_SS_HANDLES_MISMATCH
Definition: ntstatus.h:1627
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:443
#define RPC_NT_NO_BINDINGS
Definition: ntstatus.h:1551
#define RPC_NT_FP_DIV_ZERO
Definition: ntstatus.h:1599
#define RPC_NT_FP_UNDERFLOW
Definition: ntstatus.h:1600
#define RPC_NT_INCOMPLETE_NAME
Definition: ntstatus.h:1585
#define RPC_NT_SS_CONTEXT_DAMAGED
Definition: ntstatus.h:1626
#define RPC_NT_SERVER_TOO_BUSY
Definition: ntstatus.h:1556
#define RPC_NT_FP_OVERFLOW
Definition: ntstatus.h:1601
#define RPC_NT_UNKNOWN_AUTHN_SERVICE
Definition: ntstatus.h:1577
#define RPC_NT_INVALID_TIMEOUT
Definition: ntstatus.h:1542
#define RPC_NT_CANNOT_SUPPORT
Definition: ntstatus.h:1594
#define RPC_NT_PROTSEQ_NOT_SUPPORTED
Definition: ntstatus.h:1536
#define RPC_NT_INVALID_NET_ADDR
Definition: ntstatus.h:1540
#define RPC_NT_INVALID_BOUND
Definition: ntstatus.h:1565
#define RPC_NT_NO_MORE_BINDINGS
Definition: ntstatus.h:1603
#define RPC_NT_INVALID_OBJECT
Definition: ntstatus.h:1606
#define RPC_NT_ZERO_DIVIDE
Definition: ntstatus.h:1597
#define RPC_NT_UNKNOWN_AUTHZ_SERVICE
Definition: ntstatus.h:1580
#define RPC_NT_BINDING_HAS_NO_AUTH
Definition: ntstatus.h:1576
#define RPC_NT_INVALID_BINDING
Definition: ntstatus.h:1535
#define RPC_NT_UNSUPPORTED_NAME_SYNTAX
Definition: ntstatus.h:1568
#define RPC_NT_UNKNOWN_MGR_TYPE
Definition: ntstatus.h:1549
#define RPC_NT_CANT_CREATE_ENDPOINT
Definition: ntstatus.h:1553
#define STATUS_ACCOUNT_LOCKED_OUT
Definition: ntstatus.h:818
#define RPC_NT_NAME_SERVICE_UNAVAILABLE
Definition: ntstatus.h:1592
#define EPT_NT_CANT_PERFORM_OP
Definition: ntstatus.h:1582
#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED
Definition: ntstatus.h:1588
#define RPC_NT_NO_MORE_MEMBERS
Definition: ntstatus.h:1587
#define RPC_NT_INVALID_ENDPOINT_FORMAT
Definition: ntstatus.h:1539
#define RPC_NT_ALREADY_LISTENING
Definition: ntstatus.h:1546
#define RPC_NT_UNKNOWN_AUTHN_TYPE
Definition: ntstatus.h:1571
#define EPT_NT_CANT_CREATE
Definition: ntstatus.h:1605
#define RPC_NT_ADDRESS_ERROR
Definition: ntstatus.h:1598
#define RPC_NT_CALL_FAILED
Definition: ntstatus.h:1559
#define RPC_NT_CALL_FAILED_DNE
Definition: ntstatus.h:1560
#define RPC_NT_INVALID_TAG
Definition: ntstatus.h:1564
#define RPC_NT_INVALID_VERS_OPTION
Definition: ntstatus.h:1586
long LONG
Definition: pedump.c:60
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:771
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define RPC_S_SERVER_TOO_BUSY
Definition: winerror.h:1390
#define EPT_S_INVALID_ENTRY
Definition: winerror.h:1416
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1370
#define RPC_S_TYPE_ALREADY_REGISTERED
Definition: winerror.h:1379
#define RPC_S_NOTHING_TO_EXPORT
Definition: winerror.h:1419
#define RPC_S_NO_MORE_MEMBERS
Definition: winerror.h:1422
#define ERROR_INVALID_SECURITY_DESCR
Definition: winerror.h:1165
#define RPC_S_CALL_IN_PROGRESS
Definition: winerror.h:1455
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1388
#define RPC_S_CALL_FAILED_DNE
Definition: winerror.h:1394
#define RPC_S_ADDRESS_ERROR
Definition: winerror.h:1433
#define RPC_S_INVALID_NAME_SYNTAX
Definition: winerror.h:1402
#define RPC_X_SS_HANDLES_MISMATCH
Definition: winerror.h:1442
#define ERROR_INVALID_LOGON_HOURS
Definition: winerror.h:1155
#define EPT_S_NOT_REGISTERED
Definition: winerror.h:1418
#define RPC_S_UNSUPPORTED_TRANS_SYN
Definition: winerror.h:1397
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1400
#define RPC_S_CALL_FAILED
Definition: winerror.h:1393
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1368
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1392
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1367
#define RPC_S_ENTRY_ALREADY_EXISTS
Definition: winerror.h:1425
#define RPC_S_INVALID_TAG
Definition: winerror.h:1399
#define RPC_S_INVALID_ASYNC_CALL
Definition: winerror.h:1518
#define EPT_S_CANT_PERFORM_OP
Definition: winerror.h:1417
#define RPC_S_NOT_ALL_OBJS_UNEXPORTED
Definition: winerror.h:1423
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1445
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1380
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1440
#define RPC_S_INVALID_AUTH_IDENTITY
Definition: winerror.h:1414
#define RPC_S_FP_DIV_ZERO
Definition: winerror.h:1434
#define RPC_X_PIPE_DISCIPLINE_ERROR
Definition: winerror.h:1520
#define RPC_S_NAME_SERVICE_UNAVAILABLE
Definition: winerror.h:1427
#define RPC_S_UNSUPPORTED_TYPE
Definition: winerror.h:1398
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1384
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1447
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1411
#define RPC_S_NO_MORE_BINDINGS
Definition: winerror.h:1470
#define RPC_S_OBJECT_NOT_FOUND
Definition: winerror.h:1377
#define RPC_S_CANT_CREATE_ENDPOINT
Definition: winerror.h:1387
#define RPC_S_CANNOT_SUPPORT
Definition: winerror.h:1429
#define RPC_S_INVALID_ASYNC_HANDLE
Definition: winerror.h:1517
#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL
Definition: winerror.h:1438
#define RPC_S_INVALID_NAF_ID
Definition: winerror.h:1428
#define RPC_S_FP_UNDERFLOW
Definition: winerror.h:1435
#define RPC_S_CALL_CANCELLED
Definition: winerror.h:1482
#define RPC_X_NO_MORE_ENTRIES
Definition: winerror.h:1437
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1395
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1385
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1444
#define RPC_S_INVALID_TIMEOUT
Definition: winerror.h:1376
#define RPC_X_PIPE_CLOSED
Definition: winerror.h:1519
#define RPC_S_ZERO_DIVIDE
Definition: winerror.h:1432
#define RPC_S_ENTRY_NOT_FOUND
Definition: winerror.h:1426
#define RPC_X_PIPE_EMPTY
Definition: winerror.h:1521
#define RPC_S_NO_CONTEXT_AVAILABLE
Definition: winerror.h:1430
#define RPC_S_UNKNOWN_AUTHN_TYPE
Definition: winerror.h:1406
#define RPC_S_NO_ENDPOINT_FOUND
Definition: winerror.h:1375
#define EPT_S_CANT_CREATE
Definition: winerror.h:1502
#define RPC_S_GROUP_MEMBER_NOT_FOUND
Definition: winerror.h:1501
#define ERROR_ACCOUNT_LOCKED_OUT
Definition: winerror.h:1512
#define RPC_S_UNKNOWN_AUTHN_LEVEL
Definition: winerror.h:1413
#define RPC_S_INVALID_VERS_OPTION
Definition: winerror.h:1421
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1382
#define RPC_S_UNSUPPORTED_NAME_SYNTAX
Definition: winerror.h:1403
#define ERROR_ACCOUNT_DISABLED
Definition: winerror.h:1158
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1412
#define RPC_X_SS_CANNOT_GET_CALL_HANDLE
Definition: winerror.h:1443
#define RPC_X_BYTE_COUNT_TOO_SMALL
Definition: winerror.h:1446
#define ERROR_WRONG_PASSWORD
Definition: winerror.h:1150
#define ERROR_PASSWORD_MUST_CHANGE
Definition: winerror.h:1510
#define RPC_S_INCOMPLETE_NAME
Definition: winerror.h:1420
#define RPC_S_NO_PROTSEQS
Definition: winerror.h:1386
#define RPC_S_PROTSEQ_NOT_FOUND
Definition: winerror.h:1409
#define ERROR_MAX_THRDS_REACHED
Definition: winerror.h:357
#define RPC_S_STRING_TOO_LONG
Definition: winerror.h:1408
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1431
#define RPC_X_SS_CONTEXT_DAMAGED
Definition: winerror.h:1441
#define RPC_S_INVALID_NETWORK_OPTIONS
Definition: winerror.h:1391
#define ERROR_PASSWORD_EXPIRED
Definition: winerror.h:1157
#define RPC_S_ALREADY_REGISTERED
Definition: winerror.h:1378
#define RPC_S_INVALID_NET_ADDR
Definition: winerror.h:1374
#define RPC_S_INTERFACE_NOT_FOUND
Definition: winerror.h:1424
#define RPC_S_INVALID_ENDPOINT_FORMAT
Definition: winerror.h:1373
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1369
#define RPC_S_INVALID_OBJECT
Definition: winerror.h:1503
#define RPC_S_UUID_NO_ADDRESS
Definition: winerror.h:1404
#define RPC_S_DUPLICATE_ENDPOINT
Definition: winerror.h:1405
#define ERROR_NOACCESS
Definition: winerror.h:902
#define RPC_S_MAX_CALLS_TOO_SMALL
Definition: winerror.h:1407
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1371
#define RPC_S_NO_ENTRY_NAME
Definition: winerror.h:1401
#define RPC_S_UNKNOWN_AUTHZ_SERVICE
Definition: winerror.h:1415
#define RPC_S_PROCNUM_OUT_OF_RANGE
Definition: winerror.h:1410
#define RPC_X_SS_CHAR_TRANS_SHORT_FILE
Definition: winerror.h:1439
#define RPC_S_FP_OVERFLOW
Definition: winerror.h:1436
#define RPC_S_UNKNOWN_MGR_TYPE
Definition: winerror.h:1383
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1381
#define ERROR_NOT_ENOUGH_SERVER_MEMORY
Definition: winerror.h:990

Referenced by START_TEST().

◆ test_rpc_ncacn_ip_tcp()

static void test_rpc_ncacn_ip_tcp ( void  )
static

Definition at line 214 of file rpc.c.

215{
217 unsigned char *binding, *principal;
218 handle_t IFoo_IfHandle;
219 ULONG level, authnsvc, authzsvc;
221 static unsigned char foo[] = "foo";
222 static unsigned char ncacn_ip_tcp[] = "ncacn_ip_tcp";
223 static unsigned char address[] = "127.0.0.1";
224 static unsigned char endpoint[] = "4114";
225 static unsigned char spn[] = "principal";
226
228 ok(status == RPC_S_INVALID_RPC_PROTSEQ, "return wrong\n");
229
230 status = RpcNetworkIsProtseqValidA(ncacn_ip_tcp);
231 ok(status == RPC_S_OK, "return wrong\n");
232
235 "wrong RpcMgmtStopServerListening error (%lu)\n", status);
236
239 "wrong RpcMgmtWaitServerListen error status (%lu)\n", status);
240
241 status = RpcServerListen(1, 20, FALSE);
243 "wrong RpcServerListen error (%lu)\n", status);
244
245 status = RpcServerUseProtseqEpA(ncacn_ip_tcp, 20, endpoint, NULL);
246 ok(status == RPC_S_OK, "RpcServerUseProtseqEp failed (%lu)\n", status);
247
249 ok(status == RPC_S_OK, "RpcServerRegisterIf failed (%lu)\n", status);
250
251 status = RpcServerListen(1, 20, TRUE);
252 ok(status == RPC_S_OK, "RpcServerListen failed (%lu)\n", status);
253
254 status = RpcServerListen(1, 20, TRUE);
256 "wrong RpcServerListen error (%lu)\n", status);
257
260 ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%lu)\n", status);
261
263 ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%lu)\n",
264 status);
265
268 ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%lu)\n", status);
269
270 status = RpcBindingInqAuthInfoA(IFoo_IfHandle, NULL, NULL, NULL, NULL, NULL);
271 ok(status == RPC_S_BINDING_HAS_NO_AUTH, "RpcBindingInqAuthInfo failed (%lu)\n",
272 status);
273
276 ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%lu)\n", status);
277
278 level = authnsvc = authzsvc = 0;
279 principal = (unsigned char *)0xdeadbeef;
280 identity = (RPC_AUTH_IDENTITY_HANDLE *)0xdeadbeef;
281 status = RpcBindingInqAuthInfoA(IFoo_IfHandle, &principal, &level, &authnsvc,
282 &identity, &authzsvc);
283
284 ok(status == RPC_S_OK, "RpcBindingInqAuthInfo failed (%lu)\n", status);
285 ok(identity == NULL, "expected NULL identity, got %p\n", identity);
286 ok(principal != (unsigned char *)0xdeadbeef, "expected valid principal, got %p\n", principal);
287 ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "expected RPC_C_AUTHN_LEVEL_PKT_PRIVACY, got %ld\n", level);
288 ok(authnsvc == RPC_C_AUTHN_WINNT, "expected RPC_C_AUTHN_WINNT, got %ld\n", authnsvc);
289 todo_wine ok(authzsvc == RPC_C_AUTHZ_NAME, "expected RPC_C_AUTHZ_NAME, got %ld\n", authzsvc);
290 if (status == RPC_S_OK) RpcStringFreeA(&principal);
291
293 ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%lu)\n",
294 status);
295
297 ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%lu)\n",
298 status);
299
301 ok(status == RPC_S_OK, "RpcServerUnregisterIf failed (%lu)\n", status);
302
304 ok(status == RPC_S_OK, "RpcMgmtWaitServerListen failed (%lu)\n", status);
305
307 ok(status == RPC_S_OK, "RpcStringFree failed (%lu)\n", status);
308
309 status = RpcBindingFree(&IFoo_IfHandle);
310 ok(status == RPC_S_OK, "RpcBindingFree failed (%lu)\n", status);
311}
GLint level
Definition: gl.h:1546
#define todo_wine
Definition: minitest.h:80
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr)
Definition: rpc_binding.c:1915
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoA(RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc)
Definition: rpc_binding.c:1532
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
RPC_STATUS WINAPI RpcMgmtWaitServerListen(void)
Definition: rpc_server.c:1539
RPC_STATUS WINAPI RpcServerUseProtseqEpA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:910
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1596
RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(RPC_CSTR protseq)
#define RPC_C_AUTHZ_NAME
Definition: rpcdce.h:168
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
Definition: rpcdce.h:151
#define RPC_C_AUTHN_LEVEL_NONE
Definition: rpcdce.h:146
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
Definition: nis.h:10
uint32_t ULONG
Definition: typedefs.h:59

Referenced by START_TEST().

◆ test_RpcBindingFree()

static void test_RpcBindingFree ( void  )
static

Definition at line 852 of file rpc.c.

853{
856
859 "RpcBindingFree should have returned RPC_S_INVALID_BINDING instead of %ld\n",
860 status);
861}

Referenced by START_TEST().

◆ test_RpcExceptionFilter()

static void test_RpcExceptionFilter ( void  )
static

Definition at line 656 of file rpc.c.

657{
658 int retval, retval2;
660
662 {
663 /* skip over uninteresting bits of the number space */
664 if (exception == 2000) exception = 0x40000000;
665 if (exception == 0x40000005) exception = 0x80000000;
666 if (exception == 0x80000005) exception = 0xc0000000;
667
670 switch (exception)
671 {
680 ok(retval == EXCEPTION_CONTINUE_SEARCH, "RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
682 ok(retval2 == EXCEPTION_CONTINUE_SEARCH, "I_RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
684 break;
689 {
690 ok(!retval, "Unexpected return value %d.\n", retval);
691 ok(!retval2, "Unexpected return value %d.\n", retval2);
692 }
693 break;
694 default:
695 ok(retval == EXCEPTION_EXECUTE_HANDLER, "RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
697 ok(retval2 == EXCEPTION_EXECUTE_HANDLER, "I_RpcExceptionFilter(0x%lx) should have returned %d instead of %d\n",
699 }
700 }
701}
#define STATUS_ILLEGAL_INSTRUCTION
Definition: d3dkmdt.h:41
#define exception
Definition: math.h:26
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91
#define STATUS_REG_NAT_CONSUMPTION
Definition: ntstatus.h:947
#define STATUS_POSSIBLE_DEADLOCK
Definition: ntstatus.h:731
#define STATUS_INSTRUCTION_MISALIGNMENT
Definition: ntstatus.h:500
#define STATUS_STACK_OVERFLOW
Definition: ntstatus.h:583
#define STATUS_PRIVILEGED_INSTRUCTION
Definition: ntstatus.h:480
#define STATUS_BREAKPOINT
Definition: ntstatus.h:264
#define STATUS_IN_PAGE_ERROR
Definition: ntstatus.h:336
#define STATUS_HANDLE_NOT_CLOSABLE
Definition: ntstatus.h:819
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:263
#define STATUS_GUARD_PAGE_VIOLATION
Definition: ntstatus.h:262
RPCRTAPI int RPC_ENTRY I_RpcExceptionFilter(ULONG)
int WINAPI RpcExceptionFilter(ULONG ExceptionCode)
Definition: rpcrt4_main.c:890
int retval
Definition: wcstombs.cpp:91

Referenced by START_TEST().

◆ test_RpcIfInqId()

static void test_RpcIfInqId ( void  )
static

Definition at line 881 of file rpc.c.

882{
883 static const GUID guid = {0x12345678, 0xdead, 0xbeef, {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}};
884 static RPC_STATUS (WINAPI *pRpcIfInqId)(RPC_IF_HANDLE, RPC_IF_ID *);
885 RPC_SERVER_INTERFACE server_interface;
886 RPC_CLIENT_INTERFACE client_interface;
889 RPC_IF_ID if_id;
890 UINT test_idx;
891
892 pRpcIfInqId = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "RpcIfInqId");
893
894 memset(&server_interface, 0, sizeof(server_interface));
895 memset(&client_interface, 0, sizeof(client_interface));
896 server_interface.InterfaceId.SyntaxGUID = guid;
897 server_interface.InterfaceId.SyntaxVersion.MajorVersion = 1;
898 server_interface.InterfaceId.SyntaxVersion.MinorVersion = 2;
899 client_interface.InterfaceId.SyntaxGUID = guid;
900 client_interface.InterfaceId.SyntaxVersion.MajorVersion = 1;
901 client_interface.InterfaceId.SyntaxVersion.MinorVersion = 2;
902
903 /* Crash on Windows */
904 if (0)
905 {
906 status = pRpcIfInqId(NULL, &if_id);
907 ok(status == RPC_S_INVALID_ARG, "Expected %#x, got %#lx.\n", RPC_S_INVALID_ARG, status);
908
909 status = pRpcIfInqId((RPC_IF_HANDLE)&server_interface, NULL);
910 ok(status == RPC_S_INVALID_ARG, "Expected %#x, got %#lx.\n", RPC_S_INVALID_ARG, status);
911 }
912
913 test_handles[0] = (RPC_IF_HANDLE)&server_interface;
914 test_handles[1] = (RPC_IF_HANDLE)&client_interface;
915
916 for (test_idx = 0; test_idx < ARRAY_SIZE(test_handles); ++test_idx)
917 {
918 memset(&if_id, 0, sizeof(if_id));
919 status = pRpcIfInqId(test_handles[test_idx], &if_id);
920 ok(status == RPC_S_OK, "Test %u: Expected %#x, got %#lx.\n", test_idx, RPC_S_OK, status);
921 ok(!memcmp(&if_id.Uuid, &guid, sizeof(guid)), "Test %u: Expected UUID %s, got %s.\n", test_idx,
923 ok(if_id.VersMajor == 1, "Test %u: Expected major version 1, got %hu.\n", test_idx,
924 if_id.VersMajor);
925 ok(if_id.VersMinor == 2, "Test %u: Expected minor version 2, got %hu.\n", test_idx,
926 if_id.VersMinor);
927 }
928}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
GUID guid
Definition: version.c:147
unsigned int UINT
Definition: ndis.h:50
void * RPC_IF_HANDLE
Definition: rpcdce.h:49
#define RPC_S_INVALID_ARG
Definition: rpcnterr.h:23
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
#define memset(x, y, z)
Definition: compat.h:39
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:117
unsigned short VersMajor
Definition: rpcdce.h:72
UUID Uuid
Definition: rpcdce.h:71
unsigned short VersMinor
Definition: rpcdce.h:73
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:104
RPC_VERSION SyntaxVersion
Definition: rpcdcep.h:33
unsigned short MajorVersion
Definition: rpcdcep.h:27
unsigned short MinorVersion
Definition: rpcdcep.h:28
#define WINAPI
Definition: msvc.h:6
static void test_handles(void)
Definition: winstation.c:109

Referenced by START_TEST().

◆ test_RpcServerInqDefaultPrincName()

static void test_RpcServerInqDefaultPrincName ( void  )
static

Definition at line 930 of file rpc.c.

931{
933 RPC_CSTR principal, saved_principal;
934 char *username;
935 ULONG len = 0;
936
937 GetUserNameExA( NameSamCompatible, NULL, &len );
938 username = malloc( len );
939 GetUserNameExA( NameSamCompatible, username, &len );
940
942 ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %lu\n", ret );
943
945 ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %lu\n", ret );
946
947 principal = (RPC_CSTR)0xdeadbeef;
949 ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %lu\n", ret );
950 ok( principal == (RPC_CSTR)0xdeadbeef, "got unexpected principal\n" );
951
952 saved_principal = (RPC_CSTR)0xdeadbeef;
954 ok( ret == RPC_S_OK, "got %lu\n", ret );
955 ok( saved_principal != (RPC_CSTR)0xdeadbeef, "expected valid principal\n" );
956 ok( !strcmp( (const char *)saved_principal, username ), "got \'%s\'\n", saved_principal );
957 trace("%s\n", saved_principal);
958
960 ok( ret == RPC_S_OK, "got %lu\n", ret );
961
962 principal = (RPC_CSTR)0xdeadbeef;
964 ok( ret == RPC_S_OK, "got %lu\n", ret );
965 ok( principal != (RPC_CSTR)0xdeadbeef, "expected valid principal\n" );
966 ok( !strcmp( (const char *)principal, username ), "got \'%s\'\n", principal );
967 RpcStringFreeA( &principal );
968
970 ok( ret == RPC_S_OK, "got %lu\n", ret );
971
972 RpcStringFreeA( &saved_principal );
973 free( username );
974}
#define trace
Definition: atltest.h:70
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
GLenum GLsizei len
Definition: glext.h:6722
static WCHAR username[]
Definition: url.c:32
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameA(ULONG AuthnSvc, RPC_CSTR *PrincName)
Definition: rpc_server.c:1481
RPC_STATUS WINAPI RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1414
#define RPC_C_AUTHN_DEFAULT
Definition: rpcdce.h:165
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
BOOLEAN WINAPI GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize)
Definition: sspi.c:1044

Referenced by START_TEST().

◆ test_RpcServerRegisterAuthInfo()

static void test_RpcServerRegisterAuthInfo ( void  )
static

Definition at line 976 of file rpc.c.

977{
979
981 ok(status == RPC_S_UNKNOWN_AUTHN_SERVICE, "status = %lx\n", status);
982}
RPC_STATUS WINAPI RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1434

Referenced by START_TEST().

◆ test_RpcServerUseProtseq()

static void test_RpcServerUseProtseq ( void  )
static

Definition at line 984 of file rpc.c.

985{
987 RPC_BINDING_VECTOR *bindings;
988 ULONG i;
989 ULONG binding_count_before;
990 ULONG binding_count_after1;
991 ULONG binding_count_after2;
992 ULONG endpoints_registered = 0;
993 static unsigned char iptcp[] = "ncacn_ip_tcp";
994 static unsigned char np[] = "ncacn_np";
995 static unsigned char ncalrpc[] = "ncalrpc";
996 BOOL iptcp_registered = FALSE, np_registered = FALSE, ncalrpc_registered = FALSE;
997
998 status = RpcServerInqBindings(&bindings);
1000 binding_count_before = 0;
1001 else
1002 {
1003 binding_count_before = bindings->Count;
1004 ok(status == RPC_S_OK, "RpcServerInqBindings failed with status %ld\n", status);
1005 for (i = 0; i < bindings->Count; i++)
1006 {
1007 RPC_CSTR str_bind;
1008 status = RpcBindingToStringBindingA(bindings->BindingH[i], &str_bind);
1009 ok(status == RPC_S_OK, "RpcBindingToStringBinding failed with status %ld\n", status);
1010 if (lstrlenA((const char *)str_bind) > 12 && !memcmp(str_bind, "ncacn_ip_tcp", 12))
1011 iptcp_registered = TRUE;
1012 if (lstrlenA((const char *)str_bind) > 8 && !memcmp(str_bind, "ncacn_np", 8))
1013 np_registered = TRUE;
1014 if (lstrlenA((const char *)str_bind) > 7 && !memcmp(str_bind, "ncalrpc", 7))
1015 ncalrpc_registered = TRUE;
1016 RpcStringFreeA(&str_bind);
1017 }
1018 RpcBindingVectorFree(&bindings);
1019 }
1020
1021 /* show that RpcServerUseProtseqEp(..., NULL, ...) is the same as
1022 * RpcServerUseProtseq(...) */
1023 status = RpcServerUseProtseqEpA(ncalrpc, 0, NULL, NULL);
1025 "RpcServerUseProtseqEp with NULL endpoint failed with status %ld\n",
1026 status);
1027
1028 /* register protocol sequences without explicit endpoints */
1031 win_skip("ncacn_np not supported\n");
1032 else
1033 ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_np) failed with status %ld\n", status);
1034 if (status == RPC_S_OK && !np_registered) endpoints_registered++;
1035
1036 status = RpcServerUseProtseqA(iptcp, 0, NULL);
1037 ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %ld\n", status);
1038 if (status == RPC_S_OK && !iptcp_registered) endpoints_registered++;
1039
1040 status = RpcServerUseProtseqA(ncalrpc, 0, NULL);
1041 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %ld\n", status);
1042 if (status == RPC_S_OK && !ncalrpc_registered) endpoints_registered++;
1043
1044 status = RpcServerInqBindings(&bindings);
1045 ok(status == RPC_S_OK, "RpcServerInqBindings failed with status %ld\n", status);
1046 binding_count_after1 = bindings->Count;
1047 ok(binding_count_after1 == binding_count_before + endpoints_registered,
1048 "wrong binding count - before: %lu, after %lu, endpoints registered %lu\n",
1049 binding_count_before, binding_count_after1, endpoints_registered);
1050 for (i = 0; i < bindings->Count; i++)
1051 {
1052 RPC_CSTR str_bind;
1053 status = RpcBindingToStringBindingA(bindings->BindingH[i], &str_bind);
1054 ok(status == RPC_S_OK, "RpcBindingToStringBinding failed with status %ld\n", status);
1055 trace("string binding: %s\n", str_bind);
1056 RpcStringFreeA(&str_bind);
1057 }
1058 RpcBindingVectorFree(&bindings);
1059
1060 /* re-register - endpoints should be reused */
1063 win_skip("ncacn_np not supported\n");
1064 else
1065 ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_np) failed with status %ld\n", status);
1066
1067 status = RpcServerUseProtseqA(iptcp, 0, NULL);
1068 ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %ld\n", status);
1069
1070 status = RpcServerUseProtseqA(ncalrpc, 0, NULL);
1071 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %ld\n", status);
1072
1073 status = RpcServerInqBindings(&bindings);
1074 ok(status == RPC_S_OK, "RpcServerInqBindings failed with status %ld\n", status);
1075 binding_count_after2 = bindings->Count;
1076 ok(binding_count_after2 == binding_count_after1,
1077 "bindings should have been re-used - after1: %lu after2: %lu\n",
1078 binding_count_after1, binding_count_after2);
1079 RpcBindingVectorFree(&bindings);
1080}
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
Definition: glfuncs.h:248
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define win_skip
Definition: minitest.h:67
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:902
RPC_STATUS WINAPI RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor)
Definition: rpc_server.c:1060
RPC_BINDING_HANDLE BindingH[1]
Definition: rpcdce.h:58

Referenced by START_TEST().

◆ test_RpcStringBindingFromBinding()

static void test_RpcStringBindingFromBinding ( void  )
static

Definition at line 703 of file rpc.c.

704{
705 static unsigned char ncacn_np[] = "ncacn_np";
706 static unsigned char address[] = ".";
707 static unsigned char endpoint[] = "\\pipe\\wine_rpc_test";
711
714 ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%lu)\n", status);
715
717 ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%lu)\n", status);
719
721 ok(status == RPC_S_OK, "RpcStringBindingFromBinding failed with error %lu\n", status);
722
723 ok(!strcmp((const char *)binding, "ncacn_np:.[\\\\pipe\\\\wine_rpc_test]"),
724 "binding string didn't match what was expected: \"%s\"\n", binding);
726
728 ok(status == RPC_S_OK, "RpcBindingFree failed with error %lu\n", status);
729}

Referenced by START_TEST().

◆ test_RpcStringBindingParseA()

static void test_RpcStringBindingParseA ( void  )
static

Definition at line 575 of file rpc.c.

576{
577 static unsigned char valid_binding[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[endpoint=\\pipe\\test]";
578 static unsigned char valid_binding2[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[\\pipe\\test]";
579 static unsigned char invalid_uuid_binding[] = "{00000000-0000-0000-c000-000000000046}@ncacn_np:.[endpoint=\\pipe\\test]";
580 static unsigned char invalid_ep_binding[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[endpoint=test]";
581 static unsigned char invalid_binding[] = "00000000-0000-0000-c000-000000000046@ncacn_np";
583 unsigned char *uuid;
584 unsigned char *protseq;
585 unsigned char *network_addr;
586 unsigned char *endpoint;
587 unsigned char *options;
588
589 /* test all parameters */
590 status = RpcStringBindingParseA(valid_binding, &uuid, &protseq, &network_addr, &endpoint, &options);
591 ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %ld\n", status);
592 ok(!strcmp((char *)uuid, "00000000-0000-0000-c000-000000000046"), "uuid should have been 00000000-0000-0000-C000-000000000046 instead of %s\n", uuid);
593 ok(!strcmp((char *)protseq, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq);
594 ok(!strcmp((char *)network_addr, "."), "network_addr should have been . instead of %s\n", network_addr);
595 ok(!strcmp((char *)endpoint, "pipetest"), "endpoint should have been pipetest instead of %s\n", endpoint);
596 if (options)
597 ok(!strcmp((char *)options, ""), "options should have been \"\" of \"%s\"\n", options);
598 else
599 todo_wine ok(FALSE, "options is NULL\n");
601 RpcStringFreeA(&protseq);
602 RpcStringFreeA(&network_addr);
605
606 /* test all parameters with different type of string binding */
607 status = RpcStringBindingParseA(valid_binding2, &uuid, &protseq, &network_addr, &endpoint, &options);
608 ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %ld\n", status);
609 ok(!strcmp((char *)uuid, "00000000-0000-0000-c000-000000000046"), "uuid should have been 00000000-0000-0000-C000-000000000046 instead of %s\n", uuid);
610 ok(!strcmp((char *)protseq, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq);
611 ok(!strcmp((char *)network_addr, "."), "network_addr should have been . instead of %s\n", network_addr);
612 ok(!strcmp((char *)endpoint, "pipetest"), "endpoint should have been pipetest instead of %s\n", endpoint);
613 if (options)
614 ok(!strcmp((char *)options, ""), "options should have been \"\" of \"%s\"\n", options);
615 else
616 todo_wine ok(FALSE, "options is NULL\n");
618 RpcStringFreeA(&protseq);
619 RpcStringFreeA(&network_addr);
622
623 /* test with as many parameters NULL as possible */
624 status = RpcStringBindingParseA(valid_binding, NULL, &protseq, NULL, NULL, NULL);
625 ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %ld\n", status);
626 ok(!strcmp((char *)protseq, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq);
627 RpcStringFreeA(&protseq);
628
629 /* test with invalid uuid */
630 status = RpcStringBindingParseA(invalid_uuid_binding, NULL, &protseq, NULL, NULL, NULL);
631 ok(status == RPC_S_INVALID_STRING_UUID, "RpcStringBindingParseA should have returned RPC_S_INVALID_STRING_UUID instead of %ld\n", status);
632 ok(protseq == NULL, "protseq was %p instead of NULL\n", protseq);
633
634 /* test with invalid endpoint */
635 status = RpcStringBindingParseA(invalid_ep_binding, NULL, &protseq, NULL, NULL, NULL);
636 ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %ld\n", status);
637 RpcStringFreeA(&protseq);
638
639 /* test with invalid binding */
640 status = RpcStringBindingParseA(invalid_binding, &uuid, &protseq, &network_addr, &endpoint, &options);
642 ok(status == RPC_S_INVALID_STRING_BINDING, "RpcStringBindingParseA should have returned RPC_S_INVALID_STRING_BINDING instead of %ld\n", status);
644 ok(uuid == NULL, "uuid was %p instead of NULL\n", uuid);
645 if (uuid)
647 ok(protseq == NULL, "protseq was %p instead of NULL\n", protseq);
649 ok(network_addr == NULL, "network_addr was %p instead of NULL\n", network_addr);
650 if (network_addr)
651 RpcStringFreeA(&network_addr);
652 ok(endpoint == NULL, "endpoint was %p instead of NULL\n", endpoint);
653 ok(options == NULL, "options was %p instead of NULL\n", options);
654}
Definition: msctf.idl:532
RPC_STATUS WINAPI RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR *Options)
Definition: rpc_binding.c:547

Referenced by START_TEST().

◆ test_towers()

static void test_towers ( void  )
static

Definition at line 343 of file rpc.c.

344{
346 twr_t *tower;
347 static const RPC_SYNTAX_IDENTIFIER mapi_if_id = { { 0xa4f1db00, 0xca47, 0x1067, { 0xb3, 0x1f, 0x00, 0xdd, 0x01, 0x06, 0x62, 0xda } }, { 0, 0 } };
348 static const RPC_SYNTAX_IDENTIFIER ndr_syntax = { { 0x8a885d04, 0x1ceb, 0x11c9, { 0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60 } }, { 2, 0 } };
350 char *protseq, *endpoint, *address;
351 BOOL same;
352
353 ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "10.0.0.1", &tower);
354 ok(ret == RPC_S_OK ||
355 broken(ret == RPC_S_INVALID_RPC_PROTSEQ), /* Vista */
356 "TowerConstruct failed with error %ld\n", ret);
358 {
359 /* Windows Vista fails with this error and crashes if we continue */
360 win_skip("TowerConstruct failed, we are most likely on Windows Vista\n");
361 return;
362 }
363
364 /* first check we have the right amount of data */
365 ok(tower->tower_length == sizeof(tower_data_tcp_ip1) ||
366 tower->tower_length == sizeof(tower_data_tcp_ip2),
367 "Wrong size of tower %d\n", tower->tower_length);
368
369 /* then do a byte-by-byte comparison */
370 same = ((tower->tower_length == sizeof(tower_data_tcp_ip1)) &&
372 ((tower->tower_length == sizeof(tower_data_tcp_ip2)) &&
374
375 ok(same, "Tower data differs\n");
376 if (!same)
377 {
379 for (i = 0; i < tower->tower_length; i++)
380 {
381 if (i % 8 == 0) printf(" ");
382 printf("0x%02x,", tower->tower_octet_string[i]);
383 if (i % 8 == 7) printf("\n");
384 }
385 printf("\n");
386 }
387
388 ret = TowerExplode(tower, &object, &syntax, &protseq, &endpoint, &address);
389 ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
390 ok(!memcmp(&object, &mapi_if_id, sizeof(mapi_if_id)), "object id didn't match\n");
391 ok(!memcmp(&syntax, &ndr_syntax, sizeof(syntax)), "syntax id didn't match\n");
392 ok(!strcmp(protseq, "ncacn_ip_tcp"), "protseq was \"%s\" instead of \"ncacn_ip_tcp\"\n", protseq);
393 ok(!strcmp(endpoint, "135"), "endpoint was \"%s\" instead of \"135\"\n", endpoint);
394 ok(!strcmp(address, "10.0.0.1"), "address was \"%s\" instead of \"10.0.0.1\"\n", address);
395
396 I_RpcFree(protseq);
399
400 ret = TowerExplode(tower, NULL, NULL, NULL, NULL, NULL);
401 ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
402
403 I_RpcFree(tower);
404
405 /* test the behaviour for ip_tcp with name instead of dotted IP notation */
406 ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "localhost", &tower);
407 ok(ret == RPC_S_OK, "TowerConstruct failed with error %ld\n", ret);
408 ret = TowerExplode(tower, NULL, NULL, NULL, NULL, &address);
409 ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
410 ok(!strcmp(address, "0.0.0.0") ||
411 broken(!strcmp(address, "255.255.255.255")),
412 "address was \"%s\" instead of \"0.0.0.0\"\n", address);
413
415 I_RpcFree(tower);
416
417 /* test the behaviour for np with no address */
418 ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_np", "\\pipe\\test", NULL, &tower);
419 ok(ret == RPC_S_OK, "TowerConstruct failed with error %ld\n", ret);
420 ret = TowerExplode(tower, NULL, NULL, NULL, NULL, &address);
421 ok(ret == RPC_S_OK ||
422 broken(ret != RPC_S_OK), /* win2k, indeterminate */
423 "TowerExplode failed with error %ld\n", ret);
424 /* Windows XP SP3 sets address to NULL */
425 ok(!address || !strcmp(address, ""), "address was \"%s\" instead of \"\" or NULL (XP SP3)\n", address);
426
428 I_RpcFree(tower);
429}
#define printf
Definition: freeldr.h:97
RPC_STATUS WINAPI TowerExplode(const twr_t *tower, RPC_SYNTAX_IDENTIFIER *object, RPC_SYNTAX_IDENTIFIER *syntax, char **protseq, char **endpoint, char **address)
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)
Definition: rpc_epmap.c:595
static const unsigned char tower_data_tcp_ip2[]
Definition: rpc.c:329
unsigned int unsigned32
Definition: rpc.c:47
static const unsigned char tower_data_tcp_ip1[]
Definition: rpc.c:315
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:755
Definition: rpc.c:49
byte tower_octet_string[1]
Definition: rpc.c:51
unsigned32 tower_length
Definition: rpc.c:50

Referenced by START_TEST().

◆ test_UuidCreate()

static void test_UuidCreate ( void  )
static

Definition at line 731 of file rpc.c.

732{
733 UUID guid;
735
737 version = (guid.Data3 & 0xf000) >> 12;
738 ok(version == 4 || broken(version == 1), "unexpected version %d\n",
739 version);
740 if (version == 4)
741 {
742 static UUID v4and = { 0, 0, 0x4000, { 0x80,0,0,0,0,0,0,0 } };
743 static UUID v4or = { 0xffffffff, 0xffff, 0x4fff,
744 { 0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff } };
745 UUID and, or;
746 RPC_STATUS rslt;
747 int i;
748
749 and = guid;
750 or = guid;
751 /* Generate a bunch of UUIDs and mask them. By the end, we expect
752 * every randomly generated bit to have been zero at least once,
753 * resulting in no bits set in the and mask except those which are not
754 * randomly generated: the version number and the topmost bits of the
755 * Data4 field (treated as big-endian.) Similarly, we expect only
756 * the bits which are not randomly set to be cleared in the or mask.
757 */
758 for (i = 0; i < 1000; i++)
759 {
760 LPBYTE src, dst;
761
763 for (src = (LPBYTE)&guid, dst = (LPBYTE)&and;
764 src - (LPBYTE)&guid < sizeof(guid); src++, dst++)
765 *dst &= *src;
766 for (src = (LPBYTE)&guid, dst = (LPBYTE)&or;
767 src - (LPBYTE)&guid < sizeof(guid); src++, dst++)
768 *dst |= *src;
769 }
770 ok(UuidEqual(&and, &v4and, &rslt),
771 "unexpected bits set in V4 UUID: %s\n", wine_dbgstr_guid(&and));
772 ok(UuidEqual(&or, &v4or, &rslt),
773 "unexpected bits set in V4 UUID: %s\n", wine_dbgstr_guid(&or));
774 }
775 else
776 {
777 /* Older versions of Windows generate V1 UUIDs. For these, there are
778 * many stable bits, including at least the MAC address if one is
779 * present. Just check that Data4[0]'s most significant bits are
780 * set as expected.
781 */
782 ok((guid.Data4[0] & 0xc0) == 0x80,
783 "unexpected value in Data4[0]: %02x\n", guid.Data4[0] & 0xc0);
784 }
785}
static const WCHAR version[]
Definition: asmname.c:66
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:277
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
Definition: rpcrt4_main.c:330
unsigned char * LPBYTE
Definition: typedefs.h:53
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().

◆ test_UuidCreateSequential()

static void test_UuidCreateSequential ( void  )
static

Definition at line 787 of file rpc.c.

788{
789 UUID guid1;
791 RPC_STATUS (WINAPI *pUuidCreateSequential)(UUID *) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "UuidCreateSequential");
792 RPC_STATUS (WINAPI *pI_UuidCreate)(UUID *) = (void*)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "I_UuidCreate");
794
795 if (!pUuidCreateSequential)
796 {
797 win_skip("UuidCreateSequential not exported\n");
798 return;
799 }
800
801 ok(pI_UuidCreate != pUuidCreateSequential, "got %p, %p\n", pI_UuidCreate, pUuidCreateSequential);
802
803 ret = pUuidCreateSequential(&guid1);
805 "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08lx\n", ret);
806 version = (guid1.Data3 & 0xf000) >> 12;
807 ok(version == 1, "unexpected version %d\n", version);
808 if (version == 1)
809 {
810 UUID guid2;
811
812 if (!ret)
813 {
814 /* If the call succeeded, there's a valid (non-multicast) MAC
815 * address in the uuid:
816 */
817 ok(!(guid1.Data4[2] & 0x01) || broken(guid1.Data4[2] & 0x01), /* Win 8.1 */
818 "GUID does not appear to contain a MAC address: %s\n",
819 wine_dbgstr_guid(&guid1));
820 }
821 else
822 {
823 /* Otherwise, there's a randomly generated multicast MAC address
824 * address in the uuid:
825 */
826 ok((guid1.Data4[2] & 0x01),
827 "GUID does not appear to contain a multicast MAC address: %s\n",
828 wine_dbgstr_guid(&guid1));
829 }
830 /* Generate another GUID, and make sure its MAC address matches the
831 * first.
832 */
833 ret = pUuidCreateSequential(&guid2);
835 "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08lx\n", ret);
836 version = (guid2.Data3 & 0xf000) >> 12;
837 ok(version == 1, "unexpected version %d\n", version);
838 ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)),
839 "unexpected value in MAC address: %s\n",
841
842 /* I_UuidCreate does exactly the same */
843 pI_UuidCreate(&guid2);
844 version = (guid2.Data3 & 0xf000) >> 12;
845 ok(version == 1, "unexpected version %d\n", version);
846 ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)),
847 "unexpected value in MAC address: %s\n",
849 }
850}
static GUID guid2
Definition: devinst.c:42
#define RPC_S_UUID_LOCAL_ONLY
Definition: winerror.h:1488

Referenced by START_TEST().

◆ test_UuidEqual()

static void test_UuidEqual ( void  )
static

Definition at line 85 of file rpc.c.

86{
87 UUID Uuid1, Uuid2, *PUuid1, *PUuid2;
89 int i1, i2;
90
91 /* Uuid Equality */
92 for (i1 = 0; i1 < 11; i1++)
93 {
94 for (i2 = 0; i2 < 11; i2++)
95 {
96 if (i1 < 10)
97 {
98 Uuid1 = Uuid_Table[i1];
99 PUuid1 = &Uuid1;
100 }
101 else
102 PUuid1 = NULL;
103
104 if (i2 < 10)
105 {
106 Uuid2 = Uuid_Table[i2];
107 PUuid2 = &Uuid2;
108 }
109 else
110 PUuid2 = NULL;
111 ok(UuidEqual(PUuid1, PUuid2, &status) == Uuid_Comparison_Grid[i1][i2], "UUID Equality\n" );
112 }
113 }
114}
static UUID Uuid_Table[10]
Definition: rpc.c:57
static BOOL Uuid_Comparison_Grid[11][11]
Definition: rpc.c:71

Referenced by START_TEST().

◆ test_UuidFromString()

static void test_UuidFromString ( void  )
static

Definition at line 116 of file rpc.c.

117{
118 CHAR strx[100], x;
119 LPSTR str = strx;
120 WCHAR wstrx[100], wx;
121 LPWSTR wstr = wstrx;
122
123 UUID Uuid1, Uuid2;
124 RPC_STATUS rslt;
125
126 int i1,i2;
127
128 /* Uuid to String to Uuid (char) */
129 for (i1 = 0; i1 < 10; i1++) {
130 Uuid1 = Uuid_Table[i1];
131 ok( (UuidToStringA(&Uuid1, (unsigned char**)&str) == RPC_S_OK), "Simple UUID->String copy\n" );
132 ok( (UuidFromStringA((unsigned char*)str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String\n" );
133 ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform\n" );
134 /* invalid uuid tests -- size of valid UUID string=36 */
135 for (i2 = 0; i2 < 36; i2++) {
136 x = str[i2];
137 str[i2] = 'g'; /* whatever, but "g" is a good boundary condition */
138 ok( (UuidFromStringA((unsigned char*)str, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID String\n" );
139 str[i2] = x; /* change it back so remaining tests are interesting. */
140 }
141 RpcStringFreeA((unsigned char **)&str);
142 }
143
144 /* Uuid to String to Uuid (wchar) */
145 for (i1 = 0; i1 < 10; i1++) {
146 Uuid1 = Uuid_Table[i1];
147 rslt=UuidToStringW(&Uuid1, &wstr);
148 ok( (rslt == RPC_S_OK), "Simple UUID->WString copy\n" );
149 ok( (UuidFromStringW(wstr, &Uuid2) == RPC_S_OK), "Simple WString->UUID copy from generated UUID String\n" );
150 ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> WString -> Uuid transform\n" );
151 /* invalid uuid tests -- size of valid UUID string=36 */
152 for (i2 = 0; i2 < 36; i2++) {
153 wx = wstr[i2];
154 wstr[i2] = 'g'; /* whatever, but "g" is a good boundary condition */
155 ok( (UuidFromStringW(wstr, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID WString\n" );
156 wstr[i2] = wx; /* change it back so remaining tests are interesting. */
157 }
158 RpcStringFreeW(&wstr);
159 }
160}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const WCHAR * str
RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR *StringUuid)
Definition: rpcrt4_main.c:539
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:573
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:181
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:655
RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char * LPSTR
Definition: xmlstorage.h:182
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ TowerConstruct()

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 
)

Definition at line 595 of file rpc_epmap.c.

599{
600 size_t tower_size;
602 unsigned char *p;
603 twr_uuid_floor_t *object_floor;
604 twr_uuid_floor_t *syntax_floor;
605
606 TRACE("(%p, %p, %s, %s, %s, %p)\n", object, syntax, debugstr_a(protseq),
608
609 *tower = NULL;
610
611 status = RpcTransport_GetTopOfTower(NULL, &tower_size, protseq, address, endpoint);
612
613 if (status != RPC_S_OK)
614 return status;
615
616 tower_size += sizeof(u_int16) + sizeof(*object_floor) + sizeof(*syntax_floor);
617 *tower = I_RpcAllocate(FIELD_OFFSET(twr_t, tower_octet_string[tower_size]));
618 if (!*tower)
620
621 (*tower)->tower_length = tower_size;
622 p = &(*tower)->tower_octet_string[0];
623 *(u_int16 *)p = 5; /* number of floors */
624 p += sizeof(u_int16);
625 object_floor = (twr_uuid_floor_t *)p;
626 p += sizeof(*object_floor);
627 syntax_floor = (twr_uuid_floor_t *)p;
628 p += sizeof(*syntax_floor);
629
630 object_floor->count_lhs = sizeof(object_floor->protid) + sizeof(object_floor->uuid) +
631 sizeof(object_floor->major_version);
632 object_floor->protid = EPM_PROTOCOL_UUID;
633 object_floor->count_rhs = sizeof(object_floor->minor_version);
634 object_floor->uuid = object->SyntaxGUID;
635 object_floor->major_version = object->SyntaxVersion.MajorVersion;
636 object_floor->minor_version = object->SyntaxVersion.MinorVersion;
637
638 syntax_floor->count_lhs = sizeof(syntax_floor->protid) + sizeof(syntax_floor->uuid) +
639 sizeof(syntax_floor->major_version);
640 syntax_floor->protid = EPM_PROTOCOL_UUID;
641 syntax_floor->count_rhs = sizeof(syntax_floor->minor_version);
642 syntax_floor->uuid = syntax->SyntaxGUID;
643 syntax_floor->major_version = syntax->SyntaxVersion.MajorVersion;
644 syntax_floor->minor_version = syntax->SyntaxVersion.MinorVersion;
645
646 status = RpcTransport_GetTopOfTower(p, &tower_size, protseq, address, endpoint);
647 if (status != RPC_S_OK)
648 {
649 I_RpcFree(*tower);
650 *tower = NULL;
651 return status;
652 }
653 return RPC_S_OK;
654}
unsigned short u_int16
Definition: dcetypes.idl:33
#define EPM_PROTOCOL_UUID
Definition: epm_towers.h:33
GLfloat GLfloat p
Definition: glext.h:8902
#define debugstr_a
Definition: kernel32.h:31
RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint)
void *WINAPI I_RpcAllocate(unsigned int Size)
Definition: rpcrt4_main.c:747
#define TRACE(s)
Definition: solgame.cpp:4
u_int16 minor_version
Definition: epm_towers.h:60
u_int16 count_lhs
Definition: epm_towers.h:55
u_int16 count_rhs
Definition: epm_towers.h:59
u_int16 major_version
Definition: epm_towers.h:58
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by test_towers().

◆ TowerExplode()

RPC_STATUS WINAPI TowerExplode ( const twr_t tower,
RPC_SYNTAX_IDENTIFIER object,
RPC_SYNTAX_IDENTIFIER syntax,
char **  protseq,
char **  endpoint,
char **  address 
)

Referenced by test_towers().

Variable Documentation

◆ IFoo___RpcServerInterface

const RPC_SERVER_INTERFACE IFoo___RpcServerInterface
static
Initial value:
=
{
{{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x34}},{0,0}},
{{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
0,
0,
0,
0,
0,
}
static RPC_DISPATCH_TABLE IFoo_v0_0_DispatchTable
Definition: rpc.c:193
struct _RPC_SERVER_INTERFACE RPC_SERVER_INTERFACE

Definition at line 199 of file rpc.c.

◆ IFoo_table

RPC_DISPATCH_FUNCTION IFoo_table[]
static
Initial value:
=
{
0
}

Definition at line 188 of file rpc.c.

◆ IFoo_v0_0_DispatchTable

RPC_DISPATCH_TABLE IFoo_v0_0_DispatchTable
static
Initial value:
=
{
0,
}
static RPC_DISPATCH_FUNCTION IFoo_table[]
Definition: rpc.c:188

Definition at line 193 of file rpc.c.

◆ IFoo_v0_0_s_ifspec

RPC_IF_HANDLE IFoo_v0_0_s_ifspec = (RPC_IF_HANDLE)& IFoo___RpcServerInterface
static

Definition at line 212 of file rpc.c.

Referenced by test_endpoint_mapper(), and test_rpc_ncacn_ip_tcp().

◆ tower_data_tcp_ip1

const unsigned char tower_data_tcp_ip1[]
static
Initial value:
=
{
0x05,0x00,0x13,0x00,0x0d,0x00,0xdb,0xf1,
0xa4,0x47,0xca,0x67,0x10,0xb3,0x1f,0x00,
0xdd,0x01,0x06,0x62,0xda,0x00,0x00,0x02,
0x00,0x00,0x00,0x13,0x00,0x0d,0x04,0x5d,
0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,
0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,
0x02,0x00,0x00,0x00,0x01,0x00,0x0b,0x02,
0x00,0x00,0x00,0x01,0x00,0x07,0x02,0x00,
0x00,0x87,0x01,0x00,0x09,0x04,0x00,0x0a,
0x00,0x00,0x01,
}

Definition at line 315 of file rpc.c.

Referenced by test_towers().

◆ tower_data_tcp_ip2

const unsigned char tower_data_tcp_ip2[]
static
Initial value:
=
{
0x05,0x00,0x13,0x00,0x0d,0x00,0xdb,0xf1,
0xa4,0x47,0xca,0x67,0x10,0xb3,0x1f,0x00,
0xdd,0x01,0x06,0x62,0xda,0x00,0x00,0x02,
0x00,0x00,0x00,0x13,0x00,0x0d,0x04,0x5d,
0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,
0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,
0x02,0x00,0x00,0x00,0x01,0x00,0x0b,0x00,
0x00,0x01,0x00,0x07,0x02,0x00,0x00,0x87,
0x01,0x00,0x09,0x04,0x00,0x0a,0x00,0x00,
0x01,
}

Definition at line 329 of file rpc.c.

Referenced by test_towers().

◆ Uuid_Comparison_Grid

◆ Uuid_Table

UUID Uuid_Table[10]
static
Initial value:
= {
{ 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} },
{ 0xdeadbeef, 0xdead, 0xbeef, {0x10, 0x21, 0x35, 0x56, 0x89, 0xa0, 0xf4, 0x8a} },
{ 0xabadfeed, 0x49ff, 0xbead, {0x8a, 0xf4, 0xa0, 0x89, 0x56, 0x35, 0x21, 0x10} },
{ 0x93da375c, 0x1324, 0x1355, {0x87, 0xff, 0x49, 0x44, 0x34, 0x44, 0x22, 0x19} },
{ 0xdeadbeef, 0xdead, 0xbeef, {0x10, 0x21, 0x35, 0x56, 0x89, 0xa0, 0xf4, 0x8b} },
{ 0x9badfeed, 0x49ff, 0xbead, {0x8a, 0xf4, 0xa0, 0x89, 0x56, 0x35, 0x21, 0x10} },
{ 0x00000000, 0x0001, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} },
{ 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} },
{ 0x12312312, 0x1231, 0x1231, {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xff} },
{ 0x11111111, 0x1111, 0x1111, {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11} }
}

Definition at line 57 of file rpc.c.

Referenced by test_UuidEqual(), and test_UuidFromString().