ReactOS  0.4.14-dev-50-g13bb5e2
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 UuidConversionAndComparison (void)
 
static void TestDceErrorInqText (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 (const char *func_name)
 
static void test_RpcStringBindingFromBinding (void)
 
static void test_UuidCreate (void)
 
static void test_UuidCreateSequential (void)
 
static void test_RpcBindingFree (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

typedef unsigned int unsigned32

Definition at line 43 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 1111 of file rpc.c.

1112 {
1113  APP_ADD,
1114  APP_REMOVE
1115 };
Definition: rpc.c:1113

Function Documentation

◆ is_firewall_enabled()

static BOOL is_firewall_enabled ( void  )
static

Definition at line 1078 of file rpc.c.

1079 {
1080  HRESULT hr, init;
1081  INetFwMgr *mgr = NULL;
1082  INetFwPolicy *policy = NULL;
1084  VARIANT_BOOL enabled = VARIANT_FALSE;
1085 
1087 
1088  hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
1089  (void **)&mgr );
1090  ok( hr == S_OK, "got %08x\n", hr );
1091  if (hr != S_OK) goto done;
1092 
1093  hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
1094  ok( hr == S_OK, "got %08x\n", hr );
1095  if (hr != S_OK) goto done;
1096 
1097  hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
1098  if (hr != S_OK) goto done;
1099 
1100  hr = INetFwProfile_get_FirewallEnabled( profile, &enabled );
1101  ok( hr == S_OK, "got %08x\n", hr );
1102 
1103 done:
1104  if (policy) INetFwPolicy_Release( policy );
1105  if (profile) INetFwProfile_Release( profile );
1106  if (mgr) INetFwMgr_Release( mgr );
1107  if (SUCCEEDED( init )) CoUninitialize();
1108  return (enabled == VARIANT_TRUE);
1109 }
HRESULT hr
Definition: shlfolder.c:183
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
short VARIANT_BOOL
Definition: compat.h:1931
static int init
Definition: wintirpc.c:33
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935
#define profile
Definition: kernel32.h:12
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ is_process_elevated()

static BOOL is_process_elevated ( void  )
static

Definition at line 1062 of file rpc.c.

1063 {
1064  HANDLE token;
1066  {
1068  DWORD size;
1069  BOOL ret;
1070 
1072  CloseHandle( token );
1073  return (ret && type == TokenElevationTypeFull);
1074  }
1075  return FALSE;
1076 }
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
#define CloseHandle
Definition: compat.h:398
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int BOOL
Definition: ntddk_ex.h:94
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
GLsizeiptr size
Definition: glext.h:5919
#define TOKEN_QUERY
Definition: setypes.h:874
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413

Referenced by START_TEST().

◆ set_firewall()

static HRESULT set_firewall ( enum firewall_op  op)
static

Definition at line 1117 of file rpc.c.

1118 {
1119  static const WCHAR testW[] = {'r','p','c','r','t','4','_','t','e','s','t',0};
1120  HRESULT hr, init;
1121  INetFwMgr *mgr = NULL;
1122  INetFwPolicy *policy = NULL;
1127 
1129  {
1130  SysFreeString( image );
1131  return E_FAIL;
1132  }
1134 
1135  hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
1136  (void **)&mgr );
1137  ok( hr == S_OK, "got %08x\n", hr );
1138  if (hr != S_OK) goto done;
1139 
1140  hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
1141  ok( hr == S_OK, "got %08x\n", hr );
1142  if (hr != S_OK) goto done;
1143 
1144  hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
1145  if (hr != S_OK) goto done;
1146 
1147  hr = INetFwProfile_get_AuthorizedApplications( profile, &apps );
1148  ok( hr == S_OK, "got %08x\n", hr );
1149  if (hr != S_OK) goto done;
1150 
1151  hr = CoCreateInstance( &CLSID_NetFwAuthorizedApplication, NULL, CLSCTX_INPROC_SERVER,
1152  &IID_INetFwAuthorizedApplication, (void **)&app );
1153  ok( hr == S_OK, "got %08x\n", hr );
1154  if (hr != S_OK) goto done;
1155 
1156  hr = INetFwAuthorizedApplication_put_ProcessImageFileName( app, image );
1157  if (hr != S_OK) goto done;
1158 
1159  name = SysAllocString( testW );
1160  hr = INetFwAuthorizedApplication_put_Name( app, name );
1161  SysFreeString( name );
1162  ok( hr == S_OK, "got %08x\n", hr );
1163  if (hr != S_OK) goto done;
1164 
1165  if (op == APP_ADD)
1166  hr = INetFwAuthorizedApplications_Add( apps, app );
1167  else if (op == APP_REMOVE)
1168  hr = INetFwAuthorizedApplications_Remove( apps, image );
1169  else
1170  hr = E_INVALIDARG;
1171 
1172 done:
1173  if (app) INetFwAuthorizedApplication_Release( app );
1174  if (apps) INetFwAuthorizedApplications_Release( apps );
1175  if (policy) INetFwPolicy_Release( policy );
1176  if (profile) INetFwProfile_Release( profile );
1177  if (mgr) INetFwMgr_Release( mgr );
1178  if (SUCCEEDED( init )) CoUninitialize();
1179  SysFreeString( image );
1180  return hr;
1181 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:609
HRESULT hr
Definition: shlfolder.c:183
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
OLECHAR * BSTR
Definition: compat.h:1934
#define E_FAIL
Definition: ddrawi.h:102
static int init
Definition: wintirpc.c:33
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
Definition: name.c:36
Definition: rpc.c:1113
#define profile
Definition: kernel32.h:12
UINT op
Definition: effect.c:223
static const WCHAR testW[]
Definition: jsregexp.c:44
#define SUCCEEDED(hr)
Definition: intsafe.h:57
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( rpc  )

Definition at line 1183 of file rpc.c.

1184 {
1185  static unsigned char ncacn_np[] = "ncacn_np";
1186  static unsigned char ncalrpc[] = "ncalrpc";
1187  static unsigned char np_address[] = ".";
1188  BOOL firewall_enabled = is_firewall_enabled();
1189 
1190  if (firewall_enabled && !is_process_elevated())
1191  {
1192  skip("no privileges, skipping tests to avoid firewall dialog\n");
1193  return;
1194  }
1195 
1198  test_towers();
1201  test_RpcExceptionFilter("I_RpcExceptionFilter");
1202  test_RpcExceptionFilter("RpcExceptionFilter");
1204  test_UuidCreate();
1209 
1210  if (firewall_enabled)
1211  {
1213  if (hr != S_OK)
1214  {
1215  skip("can't authorize app in firewall %08x\n", hr);
1216  return;
1217  }
1218  }
1219 
1222  test_endpoint_mapper(ncacn_np, np_address);
1223  test_endpoint_mapper(ncalrpc, NULL);
1224 
1225  if (firewall_enabled) set_firewall(APP_REMOVE);
1226 }
static void UuidConversionAndComparison(void)
Definition: rpc.c:81
HRESULT hr
Definition: shlfolder.c:183
static void test_RpcServerUseProtseq(void)
Definition: rpc.c:911
static HRESULT set_firewall(enum firewall_op op)
Definition: rpc.c:1117
static void test_UuidCreate(void)
Definition: rpc.c:725
static void test_RpcExceptionFilter(const char *func_name)
Definition: rpc.c:652
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static void TestDceErrorInqText(void)
Definition: rpc.c:144
static void test_endpoint_mapper(RPC_CSTR protseq, RPC_CSTR address)
Definition: rpc.c:1009
static void test_UuidCreateSequential(void)
Definition: rpc.c:781
LONG HRESULT
Definition: typedefs.h:77
static void test_rpc_ncacn_ip_tcp(void)
Definition: rpc.c:210
static BOOL is_process_elevated(void)
Definition: rpc.c:1062
static void test_RpcServerRegisterAuthInfo(void)
Definition: rpc.c:903
static void test_towers(void)
Definition: rpc.c:339
static void test_RpcServerInqDefaultPrincName(void)
Definition: rpc.c:857
static void test_RpcStringBindingFromBinding(void)
Definition: rpc.c:697
#define S_OK
Definition: intsafe.h:59
static void test_RpcBindingFree(void)
Definition: rpc.c:846
static BOOL is_firewall_enabled(void)
Definition: rpc.c:1078
static void test_RpcStringBindingParseA(void)
Definition: rpc.c:571
#define skip(...)
Definition: atltest.h:64
Definition: rpc.c:1113
static void test_I_RpcMapWin32Status(void)
Definition: rpc.c:427

◆ test_endpoint_mapper()

static void test_endpoint_mapper ( RPC_CSTR  protseq,
RPC_CSTR  address 
)
static

Definition at line 1009 of file rpc.c.

1010 {
1011  static unsigned char annotation[] = "Test annotation string.";
1013  RPC_BINDING_VECTOR *binding_vector;
1014  handle_t handle;
1015  unsigned char *binding;
1016 
1018  ok(status == RPC_S_OK, "%s: RpcServerRegisterIf failed (%u)\n", protseq, status);
1019 
1020  status = RpcServerInqBindings(&binding_vector);
1021  ok(status == RPC_S_OK, "%s: RpcServerInqBindings failed with error %u\n", protseq, status);
1022 
1023  /* register endpoints created in test_RpcServerUseProtseq */
1025  ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %u\n", protseq, status);
1026  /* reregister the same endpoint with no annotation */
1027  status = RpcEpRegisterA(IFoo_v0_0_s_ifspec, binding_vector, NULL, NULL);
1028  ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %u\n", protseq, status);
1029 
1031  NULL, NULL, &binding);
1032  ok(status == RPC_S_OK, "%s: RpcStringBindingCompose failed (%u)\n", protseq, status);
1033 
1035  ok(status == RPC_S_OK, "%s: RpcBindingFromStringBinding failed (%u)\n", protseq, status);
1036 
1037  RpcStringFreeA(&binding);
1038 
1040  ok(status == RPC_S_OK, "%s: RpcBindingReset failed with error %u\n", protseq, status);
1041 
1043  ok(status == RPC_S_OK || broken(status == RPC_S_SERVER_UNAVAILABLE), /* win9x */
1044  "%s: RpcEpResolveBinding failed with error %u\n", protseq, status);
1045 
1047  ok(status == RPC_S_OK, "%s: RpcBindingReset failed with error %u\n", protseq, status);
1048 
1050  ok(status == RPC_S_OK, "%s: RpcBindingFree failed with error %u\n", protseq, status);
1051 
1053  ok(status == RPC_S_OK, "%s: RpcServerUnregisterIf failed (%u)\n", protseq, status);
1054 
1055  status = RpcEpUnregister(IFoo_v0_0_s_ifspec, binding_vector, NULL);
1056  ok(status == RPC_S_OK, "%s: RpcEpUnregisterA failed with error %u\n", protseq, status);
1057 
1058  status = RpcBindingVectorFree(&binding_vector);
1059  ok(status == RPC_S_OK, "%s: RpcBindingVectorFree failed with error %u\n", protseq, status);
1060 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
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:458
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1033
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1209
RPC_STATUS RPC_ENTRY RpcBindingReset(RPC_BINDING_HANDLE Binding)
Definition: rpc_binding.c:1021
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
static RPC_IF_HANDLE IFoo_v0_0_s_ifspec
Definition: rpc.c:208
RPC_STATUS WINAPI RpcServerInqBindings(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_server.c:868
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:837
RPC_STATUS WINAPI RpcBindingVectorFree(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_binding.c:799
GLuint address
Definition: glext.h:9393
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1123
RPC_STATUS WINAPI RpcEpRegisterA(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, UUID_VECTOR *UuidVector, RPC_CSTR Annotation)
Definition: rpc_epmap.c:296
RPC_STATUS WINAPI RpcEpUnregister(RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, UUID_VECTOR *UuidVector)
Definition: rpc_epmap.c:344
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
RPC_STATUS WINAPI RpcEpResolveBinding(RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec)
Definition: rpc_epmap.c:431
#define annotation(x)
Definition: dispex.idl:19
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by START_TEST().

◆ test_I_RpcMapWin32Status()

static void test_I_RpcMapWin32Status ( void  )
static

Definition at line 427 of file rpc.c.

428 {
429  LONG win32status;
430  RPC_STATUS rpc_status;
431  BOOL w2k3_up = FALSE;
432 
433  /* Windows 2003 and above return STATUS_UNSUCCESSFUL if given an unknown status */
434  win32status = I_RpcMapWin32Status(9999);
435  if (win32status == STATUS_UNSUCCESSFUL)
436  w2k3_up = TRUE;
437 
438  /* On Windows XP-SP1 and below some statuses are not mapped and return
439  * the given status
440  */
441  for (rpc_status = 0; rpc_status < 10000; rpc_status++)
442  {
443  LONG expected_win32status;
444  BOOL missing = FALSE;
445 
446  win32status = I_RpcMapWin32Status(rpc_status);
447  switch (rpc_status)
448  {
449  case ERROR_SUCCESS: expected_win32status = ERROR_SUCCESS; break;
450  case ERROR_ACCESS_DENIED: expected_win32status = STATUS_ACCESS_DENIED; break;
451  case ERROR_INVALID_HANDLE: expected_win32status = RPC_NT_SS_CONTEXT_MISMATCH; break;
452  case ERROR_OUTOFMEMORY: expected_win32status = STATUS_NO_MEMORY; break;
453  case ERROR_INVALID_PARAMETER: expected_win32status = STATUS_INVALID_PARAMETER; break;
454  case ERROR_INSUFFICIENT_BUFFER: expected_win32status = STATUS_BUFFER_TOO_SMALL; break;
455  case ERROR_MAX_THRDS_REACHED: expected_win32status = STATUS_NO_MEMORY; break;
456  case ERROR_NOACCESS: expected_win32status = STATUS_ACCESS_VIOLATION; break;
457  case ERROR_NOT_ENOUGH_SERVER_MEMORY: expected_win32status = STATUS_INSUFF_SERVER_RESOURCES; break;
458  case ERROR_WRONG_PASSWORD: expected_win32status = STATUS_WRONG_PASSWORD; missing = TRUE; break;
459  case ERROR_INVALID_LOGON_HOURS: expected_win32status = STATUS_INVALID_LOGON_HOURS; missing = TRUE; break;
460  case ERROR_PASSWORD_EXPIRED: expected_win32status = STATUS_PASSWORD_EXPIRED; missing = TRUE; break;
461  case ERROR_ACCOUNT_DISABLED: expected_win32status = STATUS_ACCOUNT_DISABLED; missing = TRUE; break;
462  case ERROR_INVALID_SECURITY_DESCR: expected_win32status = STATUS_INVALID_SECURITY_DESCR; break;
463  case RPC_S_INVALID_STRING_BINDING: expected_win32status = RPC_NT_INVALID_STRING_BINDING; break;
464  case RPC_S_WRONG_KIND_OF_BINDING: expected_win32status = RPC_NT_WRONG_KIND_OF_BINDING; break;
465  case RPC_S_INVALID_BINDING: expected_win32status = RPC_NT_INVALID_BINDING; break;
466  case RPC_S_PROTSEQ_NOT_SUPPORTED: expected_win32status = RPC_NT_PROTSEQ_NOT_SUPPORTED; break;
467  case RPC_S_INVALID_RPC_PROTSEQ: expected_win32status = RPC_NT_INVALID_RPC_PROTSEQ; break;
468  case RPC_S_INVALID_STRING_UUID: expected_win32status = RPC_NT_INVALID_STRING_UUID; break;
469  case RPC_S_INVALID_ENDPOINT_FORMAT: expected_win32status = RPC_NT_INVALID_ENDPOINT_FORMAT; break;
470  case RPC_S_INVALID_NET_ADDR: expected_win32status = RPC_NT_INVALID_NET_ADDR; break;
471  case RPC_S_NO_ENDPOINT_FOUND: expected_win32status = RPC_NT_NO_ENDPOINT_FOUND; break;
472  case RPC_S_INVALID_TIMEOUT: expected_win32status = RPC_NT_INVALID_TIMEOUT; break;
473  case RPC_S_OBJECT_NOT_FOUND: expected_win32status = RPC_NT_OBJECT_NOT_FOUND; break;
474  case RPC_S_ALREADY_REGISTERED: expected_win32status = RPC_NT_ALREADY_REGISTERED; break;
475  case RPC_S_TYPE_ALREADY_REGISTERED: expected_win32status = RPC_NT_TYPE_ALREADY_REGISTERED; break;
476  case RPC_S_ALREADY_LISTENING: expected_win32status = RPC_NT_ALREADY_LISTENING; break;
477  case RPC_S_NO_PROTSEQS_REGISTERED: expected_win32status = RPC_NT_NO_PROTSEQS_REGISTERED; break;
478  case RPC_S_NOT_LISTENING: expected_win32status = RPC_NT_NOT_LISTENING; break;
479  case RPC_S_UNKNOWN_MGR_TYPE: expected_win32status = RPC_NT_UNKNOWN_MGR_TYPE; break;
480  case RPC_S_UNKNOWN_IF: expected_win32status = RPC_NT_UNKNOWN_IF; break;
481  case RPC_S_NO_BINDINGS: expected_win32status = RPC_NT_NO_BINDINGS; break;
482  case RPC_S_NO_PROTSEQS: expected_win32status = RPC_NT_NO_PROTSEQS; break;
483  case RPC_S_CANT_CREATE_ENDPOINT: expected_win32status = RPC_NT_CANT_CREATE_ENDPOINT; break;
484  case RPC_S_OUT_OF_RESOURCES: expected_win32status = RPC_NT_OUT_OF_RESOURCES; break;
485  case RPC_S_SERVER_UNAVAILABLE: expected_win32status = RPC_NT_SERVER_UNAVAILABLE; break;
486  case RPC_S_SERVER_TOO_BUSY: expected_win32status = RPC_NT_SERVER_TOO_BUSY; break;
487  case RPC_S_INVALID_NETWORK_OPTIONS: expected_win32status = RPC_NT_INVALID_NETWORK_OPTIONS; break;
488  case RPC_S_NO_CALL_ACTIVE: expected_win32status = RPC_NT_NO_CALL_ACTIVE; break;
489  case RPC_S_CALL_FAILED: expected_win32status = RPC_NT_CALL_FAILED; break;
490  case RPC_S_CALL_FAILED_DNE: expected_win32status = RPC_NT_CALL_FAILED_DNE; break;
491  case RPC_S_PROTOCOL_ERROR: expected_win32status = RPC_NT_PROTOCOL_ERROR; break;
492  case RPC_S_UNSUPPORTED_TRANS_SYN: expected_win32status = RPC_NT_UNSUPPORTED_TRANS_SYN; break;
493  case RPC_S_UNSUPPORTED_TYPE: expected_win32status = RPC_NT_UNSUPPORTED_TYPE; break;
494  case RPC_S_INVALID_TAG: expected_win32status = RPC_NT_INVALID_TAG; break;
495  case RPC_S_INVALID_BOUND: expected_win32status = RPC_NT_INVALID_BOUND; break;
496  case RPC_S_NO_ENTRY_NAME: expected_win32status = RPC_NT_NO_ENTRY_NAME; break;
497  case RPC_S_INVALID_NAME_SYNTAX: expected_win32status = RPC_NT_INVALID_NAME_SYNTAX; break;
498  case RPC_S_UNSUPPORTED_NAME_SYNTAX: expected_win32status = RPC_NT_UNSUPPORTED_NAME_SYNTAX; break;
499  case RPC_S_UUID_NO_ADDRESS: expected_win32status = RPC_NT_UUID_NO_ADDRESS; break;
500  case RPC_S_DUPLICATE_ENDPOINT: expected_win32status = RPC_NT_DUPLICATE_ENDPOINT; break;
501  case RPC_S_UNKNOWN_AUTHN_TYPE: expected_win32status = RPC_NT_UNKNOWN_AUTHN_TYPE; break;
502  case RPC_S_MAX_CALLS_TOO_SMALL: expected_win32status = RPC_NT_MAX_CALLS_TOO_SMALL; break;
503  case RPC_S_STRING_TOO_LONG: expected_win32status = RPC_NT_STRING_TOO_LONG; break;
504  case RPC_S_PROTSEQ_NOT_FOUND: expected_win32status = RPC_NT_PROTSEQ_NOT_FOUND; break;
505  case RPC_S_PROCNUM_OUT_OF_RANGE: expected_win32status = RPC_NT_PROCNUM_OUT_OF_RANGE; break;
506  case RPC_S_BINDING_HAS_NO_AUTH: expected_win32status = RPC_NT_BINDING_HAS_NO_AUTH; break;
507  case RPC_S_UNKNOWN_AUTHN_SERVICE: expected_win32status = RPC_NT_UNKNOWN_AUTHN_SERVICE; break;
508  case RPC_S_UNKNOWN_AUTHN_LEVEL: expected_win32status = RPC_NT_UNKNOWN_AUTHN_LEVEL; break;
509  case RPC_S_INVALID_AUTH_IDENTITY: expected_win32status = RPC_NT_INVALID_AUTH_IDENTITY; break;
510  case RPC_S_UNKNOWN_AUTHZ_SERVICE: expected_win32status = RPC_NT_UNKNOWN_AUTHZ_SERVICE; break;
511  case EPT_S_INVALID_ENTRY: expected_win32status = EPT_NT_INVALID_ENTRY; break;
512  case EPT_S_CANT_PERFORM_OP: expected_win32status = EPT_NT_CANT_PERFORM_OP; break;
513  case EPT_S_NOT_REGISTERED: expected_win32status = EPT_NT_NOT_REGISTERED; break;
514  case EPT_S_CANT_CREATE: expected_win32status = EPT_NT_CANT_CREATE; break;
515  case RPC_S_NOTHING_TO_EXPORT: expected_win32status = RPC_NT_NOTHING_TO_EXPORT; break;
516  case RPC_S_INCOMPLETE_NAME: expected_win32status = RPC_NT_INCOMPLETE_NAME; break;
517  case RPC_S_INVALID_VERS_OPTION: expected_win32status = RPC_NT_INVALID_VERS_OPTION; break;
518  case RPC_S_NO_MORE_MEMBERS: expected_win32status = RPC_NT_NO_MORE_MEMBERS; break;
519  case RPC_S_NOT_ALL_OBJS_UNEXPORTED: expected_win32status = RPC_NT_NOT_ALL_OBJS_UNEXPORTED; break;
520  case RPC_S_INTERFACE_NOT_FOUND: expected_win32status = RPC_NT_INTERFACE_NOT_FOUND; break;
521  case RPC_S_ENTRY_ALREADY_EXISTS: expected_win32status = RPC_NT_ENTRY_ALREADY_EXISTS; break;
522  case RPC_S_ENTRY_NOT_FOUND: expected_win32status = RPC_NT_ENTRY_NOT_FOUND; break;
523  case RPC_S_NAME_SERVICE_UNAVAILABLE: expected_win32status = RPC_NT_NAME_SERVICE_UNAVAILABLE; break;
524  case RPC_S_INVALID_NAF_ID: expected_win32status = RPC_NT_INVALID_NAF_ID; break;
525  case RPC_S_CANNOT_SUPPORT: expected_win32status = RPC_NT_CANNOT_SUPPORT; break;
526  case RPC_S_NO_CONTEXT_AVAILABLE: expected_win32status = RPC_NT_NO_CONTEXT_AVAILABLE; break;
527  case RPC_S_INTERNAL_ERROR: expected_win32status = RPC_NT_INTERNAL_ERROR; break;
528  case RPC_S_ZERO_DIVIDE: expected_win32status = RPC_NT_ZERO_DIVIDE; break;
529  case RPC_S_ADDRESS_ERROR: expected_win32status = RPC_NT_ADDRESS_ERROR; break;
530  case RPC_S_FP_DIV_ZERO: expected_win32status = RPC_NT_FP_DIV_ZERO; break;
531  case RPC_S_FP_UNDERFLOW: expected_win32status = RPC_NT_FP_UNDERFLOW; break;
532  case RPC_S_FP_OVERFLOW: expected_win32status = RPC_NT_FP_OVERFLOW; break;
533  case RPC_S_CALL_IN_PROGRESS: expected_win32status = RPC_NT_CALL_IN_PROGRESS; break;
534  case RPC_S_NO_MORE_BINDINGS: expected_win32status = RPC_NT_NO_MORE_BINDINGS; break;
535  case RPC_S_CALL_CANCELLED: expected_win32status = RPC_NT_CALL_CANCELLED; missing = TRUE; break;
536  case RPC_S_INVALID_OBJECT: expected_win32status = RPC_NT_INVALID_OBJECT; break;
537  case RPC_S_INVALID_ASYNC_HANDLE: expected_win32status = RPC_NT_INVALID_ASYNC_HANDLE; missing = TRUE; break;
538  case RPC_S_INVALID_ASYNC_CALL: expected_win32status = RPC_NT_INVALID_ASYNC_CALL; missing = TRUE; break;
539  case RPC_S_GROUP_MEMBER_NOT_FOUND: expected_win32status = RPC_NT_GROUP_MEMBER_NOT_FOUND; break;
540  case RPC_X_NO_MORE_ENTRIES: expected_win32status = RPC_NT_NO_MORE_ENTRIES; break;
541  case RPC_X_SS_CHAR_TRANS_OPEN_FAIL: expected_win32status = RPC_NT_SS_CHAR_TRANS_OPEN_FAIL; break;
542  case RPC_X_SS_CHAR_TRANS_SHORT_FILE: expected_win32status = RPC_NT_SS_CHAR_TRANS_SHORT_FILE; break;
543  case RPC_X_SS_IN_NULL_CONTEXT: expected_win32status = RPC_NT_SS_IN_NULL_CONTEXT; break;
544  case RPC_X_SS_CONTEXT_DAMAGED: expected_win32status = RPC_NT_SS_CONTEXT_DAMAGED; break;
545  case RPC_X_SS_HANDLES_MISMATCH: expected_win32status = RPC_NT_SS_HANDLES_MISMATCH; break;
546  case RPC_X_SS_CANNOT_GET_CALL_HANDLE: expected_win32status = RPC_NT_SS_CANNOT_GET_CALL_HANDLE; break;
547  case RPC_X_NULL_REF_POINTER: expected_win32status = RPC_NT_NULL_REF_POINTER; break;
548  case RPC_X_ENUM_VALUE_OUT_OF_RANGE: expected_win32status = RPC_NT_ENUM_VALUE_OUT_OF_RANGE; break;
549  case RPC_X_BYTE_COUNT_TOO_SMALL: expected_win32status = RPC_NT_BYTE_COUNT_TOO_SMALL; break;
550  case RPC_X_BAD_STUB_DATA: expected_win32status = RPC_NT_BAD_STUB_DATA; break;
551  case RPC_X_PIPE_CLOSED: expected_win32status = RPC_NT_PIPE_CLOSED; missing = TRUE; break;
552  case RPC_X_PIPE_DISCIPLINE_ERROR: expected_win32status = RPC_NT_PIPE_DISCIPLINE_ERROR; missing = TRUE; break;
553  case RPC_X_PIPE_EMPTY: expected_win32status = RPC_NT_PIPE_EMPTY; missing = TRUE; break;
554  case ERROR_PASSWORD_MUST_CHANGE: expected_win32status = STATUS_PASSWORD_MUST_CHANGE; missing = TRUE; break;
555  case ERROR_ACCOUNT_LOCKED_OUT: expected_win32status = STATUS_ACCOUNT_LOCKED_OUT; missing = TRUE; break;
556  default:
557  if (w2k3_up)
558  expected_win32status = STATUS_UNSUCCESSFUL;
559  else
560  expected_win32status = rpc_status;
561  }
562 
563  ok(win32status == expected_win32status ||
564  broken(missing && win32status == rpc_status),
565  "I_RpcMapWin32Status(%d) should have returned 0x%x instead of 0x%x%s\n",
566  rpc_status, expected_win32status, win32status,
567  broken(missing) ? " (or have returned with the given status)" : "");
568  }
569 }
#define RPC_NT_NO_PROTSEQS_REGISTERED
Definition: ntstatus.h:974
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1028
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1083
#define STATUS_WRONG_PASSWORD
Definition: ntstatus.h:328
#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL
Definition: winerror.h:1081
#define RPC_S_ENTRY_ALREADY_EXISTS
Definition: winerror.h:1068
#define RPC_NT_DUPLICATE_ENDPOINT
Definition: ntstatus.h:997
#define RPC_NT_SS_CONTEXT_MISMATCH
Definition: ntstatus.h:1050
#define RPC_S_UNSUPPORTED_TRANS_SYN
Definition: winerror.h:1040
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:343
#define RPC_S_PROCNUM_OUT_OF_RANGE
Definition: winerror.h:1053
#define RPC_NT_INVALID_TIMEOUT
Definition: ntstatus.h:969
#define RPC_NT_BAD_STUB_DATA
Definition: ntstatus.h:1057
#define ERROR_ACCOUNT_DISABLED
Definition: winerror.h:813
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
#define RPC_NT_BYTE_COUNT_TOO_SMALL
Definition: ntstatus.h:1056
#define RPC_S_NO_ENDPOINT_FOUND
Definition: winerror.h:1019
#define ERROR_SUCCESS
Definition: deptool.c:10
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
#define RPC_NT_NO_CONTEXT_AVAILABLE
Definition: ntstatus.h:1022
#define RPC_X_PIPE_EMPTY
Definition: winerror.h:1160
#define RPC_NT_INTERFACE_NOT_FOUND
Definition: ntstatus.h:1016
#define RPC_NT_UNKNOWN_AUTHZ_SERVICE
Definition: ntstatus.h:1007
#define RPC_X_SS_CONTEXT_DAMAGED
Definition: winerror.h:1084
#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL
Definition: ntstatus.h:1047
#define RPC_NT_CANNOT_SUPPORT
Definition: ntstatus.h:1021
#define RPC_X_SS_CHAR_TRANS_SHORT_FILE
Definition: winerror.h:1082
#define RPC_S_NO_CONTEXT_AVAILABLE
Definition: winerror.h:1073
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define RPC_S_NOTHING_TO_EXPORT
Definition: winerror.h:1062
#define RPC_S_NAME_SERVICE_UNAVAILABLE
Definition: winerror.h:1070
#define RPC_NT_NO_PROTSEQS
Definition: ntstatus.h:979
#define RPC_S_INVALID_NET_ADDR
Definition: winerror.h:1018
#define RPC_NT_ALREADY_LISTENING
Definition: ntstatus.h:973
#define EPT_NT_CANT_CREATE
Definition: ntstatus.h:1032
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1029
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1025
#define RPC_NT_INVALID_TAG
Definition: ntstatus.h:991
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1012
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define RPC_NT_NO_MORE_MEMBERS
Definition: ntstatus.h:1014
#define RPC_NT_UNKNOWN_AUTHN_LEVEL
Definition: ntstatus.h:1005
#define RPC_S_INVALID_ASYNC_CALL
Definition: winerror.h:1157
#define RPC_X_BYTE_COUNT_TOO_SMALL
Definition: winerror.h:1089
#define RPC_NT_INVALID_RPC_PROTSEQ
Definition: ntstatus.h:964
#define RPC_NT_SERVER_TOO_BUSY
Definition: ntstatus.h:983
#define STATUS_INSUFF_SERVER_RESOURCES
Definition: ntstatus.h:635
#define RPC_NT_NO_CALL_ACTIVE
Definition: ntstatus.h:985
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1033
#define RPC_NT_UNKNOWN_AUTHN_TYPE
Definition: ntstatus.h:998
#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE
Definition: ntstatus.h:1055
#define RPC_X_PIPE_CLOSED
Definition: winerror.h:1158
#define RPC_S_NO_MORE_BINDINGS
Definition: winerror.h:1113
#define RPC_NT_GROUP_MEMBER_NOT_FOUND
Definition: ntstatus.h:1031
#define STATUS_ACCOUNT_LOCKED_OUT
Definition: ntstatus.h:682
#define RPC_NT_INVALID_BOUND
Definition: ntstatus.h:992
#define RPC_NT_INVALID_NAME_SYNTAX
Definition: ntstatus.h:994
#define RPC_NT_INVALID_VERS_OPTION
Definition: ntstatus.h:1013
#define RPC_S_INVALID_ENDPOINT_FORMAT
Definition: winerror.h:1017
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
#define STATUS_INVALID_LOGON_HOURS
Definition: ntstatus.h:333
#define EPT_NT_CANT_PERFORM_OP
Definition: ntstatus.h:1009
#define ERROR_WRONG_PASSWORD
Definition: winerror.h:805
#define ERROR_MAX_THRDS_REACHED
Definition: winerror.h:235
#define RPC_S_UNKNOWN_AUTHN_LEVEL
Definition: winerror.h:1056
long RPC_STATUS
Definition: rpc.h:52
#define ERROR_NOACCESS
Definition: winerror.h:578
#define RPC_S_INVALID_OBJECT
Definition: winerror.h:1142
#define RPC_S_ZERO_DIVIDE
Definition: winerror.h:1075
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
#define RPC_NT_INVALID_NAF_ID
Definition: ntstatus.h:1020
#define RPC_NT_ZERO_DIVIDE
Definition: ntstatus.h:1024
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define RPC_NT_INVALID_STRING_UUID
Definition: ntstatus.h:965
#define ERROR_NOT_ENOUGH_SERVER_MEMORY
Definition: winerror.h:666
#define RPC_NT_INVALID_ASYNC_CALL
Definition: ntstatus.h:1044
#define RPC_NT_INTERNAL_ERROR
Definition: ntstatus.h:1023
#define RPC_S_INVALID_TAG
Definition: winerror.h:1042
#define RPC_S_FP_UNDERFLOW
Definition: winerror.h:1078
#define RPC_NT_CANT_CREATE_ENDPOINT
Definition: ntstatus.h:980
#define RPC_S_CALL_FAILED_DNE
Definition: winerror.h:1038
#define ERROR_PASSWORD_MUST_CHANGE
Definition: winerror.h:1149
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013
#define RPC_NT_INCOMPLETE_NAME
Definition: ntstatus.h:1012
#define RPC_NT_CALL_CANCELLED
Definition: ntstatus.h:1035
#define RPC_S_NO_ENTRY_NAME
Definition: winerror.h:1044
#define RPC_S_INVALID_TIMEOUT
Definition: winerror.h:1020
#define RPC_S_CANNOT_SUPPORT
Definition: winerror.h:1072
#define RPC_NT_PROCNUM_OUT_OF_RANGE
Definition: ntstatus.h:1002
#define RPC_NT_UNSUPPORTED_TRANS_SYN
Definition: ntstatus.h:989
#define RPC_S_INVALID_VERS_OPTION
Definition: winerror.h:1064
#define RPC_NT_UNKNOWN_IF
Definition: ntstatus.h:977
#define RPC_NT_INVALID_OBJECT
Definition: ntstatus.h:1033
#define RPC_S_FP_OVERFLOW
Definition: winerror.h:1079
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026
#define RPC_NT_ENTRY_ALREADY_EXISTS
Definition: ntstatus.h:1017
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1039
#define RPC_S_INTERFACE_NOT_FOUND
Definition: winerror.h:1067
#define RPC_S_INCOMPLETE_NAME
Definition: winerror.h:1063
#define STATUS_ACCOUNT_DISABLED
Definition: ntstatus.h:336
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1014
#define RPC_S_CALL_IN_PROGRESS
Definition: winerror.h:1098
#define RPC_S_DUPLICATE_ENDPOINT
Definition: winerror.h:1048
#define RPC_NT_ALREADY_REGISTERED
Definition: ntstatus.h:971
#define RPC_S_UNSUPPORTED_TYPE
Definition: winerror.h:1041
#define RPC_S_INVALID_NETWORK_OPTIONS
Definition: winerror.h:1035
#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE
Definition: ntstatus.h:1053
#define RPC_S_NO_PROTSEQS
Definition: winerror.h:1030
#define RPC_S_GROUP_MEMBER_NOT_FOUND
Definition: winerror.h:1140
#define RPC_NT_UNKNOWN_MGR_TYPE
Definition: ntstatus.h:976
#define EPT_S_INVALID_ENTRY
Definition: winerror.h:1059
#define STATUS_PASSWORD_EXPIRED
Definition: ntstatus.h:335
#define RPC_NT_INVALID_NET_ADDR
Definition: ntstatus.h:967
#define RPC_NT_SS_IN_NULL_CONTEXT
Definition: ntstatus.h:1049
#define RPC_S_UNKNOWN_MGR_TYPE
Definition: winerror.h:1027
#define RPC_NT_PIPE_EMPTY
Definition: ntstatus.h:1066
#define RPC_S_OBJECT_NOT_FOUND
Definition: winerror.h:1021
#define RPC_NT_STRING_TOO_LONG
Definition: ntstatus.h:1000
#define RPC_S_NO_MORE_MEMBERS
Definition: winerror.h:1065
#define RPC_NT_NO_ENDPOINT_FOUND
Definition: ntstatus.h:968
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define RPC_NT_FP_UNDERFLOW
Definition: ntstatus.h:1027
#define RPC_S_TYPE_ALREADY_REGISTERED
Definition: winerror.h:1023
#define RPC_NT_FP_OVERFLOW
Definition: ntstatus.h:1028
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1016
#define RPC_S_CALL_CANCELLED
Definition: winerror.h:1125
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define RPC_NT_FP_DIV_ZERO
Definition: ntstatus.h:1026
#define RPC_NT_INVALID_STRING_BINDING
Definition: ntstatus.h:960
#define RPC_NT_ENTRY_NOT_FOUND
Definition: ntstatus.h:1018
#define RPC_X_ENUM_VALUE_OUT_OF_RANGE
Definition: winerror.h:1088
#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED
Definition: ntstatus.h:1015
#define RPC_S_MAX_CALLS_TOO_SMALL
Definition: winerror.h:1050
#define RPC_NT_INVALID_BINDING
Definition: ntstatus.h:962
#define RPC_NT_MAX_CALLS_TOO_SMALL
Definition: ntstatus.h:999
#define RPC_S_UNSUPPORTED_NAME_SYNTAX
Definition: winerror.h:1046
#define RPC_S_UUID_NO_ADDRESS
Definition: winerror.h:1047
#define RPC_NT_INVALID_NETWORK_OPTIONS
Definition: ntstatus.h:984
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
#define ERROR_INVALID_SECURITY_DESCR
Definition: winerror.h:820
#define RPC_NT_OBJECT_NOT_FOUND
Definition: ntstatus.h:970
#define RPC_S_ADDRESS_ERROR
Definition: winerror.h:1076
#define RPC_NT_NO_MORE_ENTRIES
Definition: ntstatus.h:1046
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1036
#define RPC_NT_UNSUPPORTED_NAME_SYNTAX
Definition: ntstatus.h:995
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1074
#define RPC_NT_TYPE_ALREADY_REGISTERED
Definition: ntstatus.h:972
#define ERROR_INVALID_LOGON_HOURS
Definition: winerror.h:810
#define broken(x)
Definition: _sntprintf.h:21
#define RPC_X_SS_CANNOT_GET_CALL_HANDLE
Definition: winerror.h:1086
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1024
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1015
#define RPC_S_SERVER_TOO_BUSY
Definition: winerror.h:1034
#define RPC_S_INVALID_NAME_SYNTAX
Definition: winerror.h:1045
#define RPC_NT_SS_CONTEXT_DAMAGED
Definition: ntstatus.h:1051
#define RPC_NT_PROTOCOL_ERROR
Definition: ntstatus.h:988
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1054
#define RPC_NT_SS_HANDLES_MISMATCH
Definition: ntstatus.h:1052
#define RPC_NT_CALL_IN_PROGRESS
Definition: ntstatus.h:1029
#define ERROR_PASSWORD_EXPIRED
Definition: winerror.h:812
#define RPC_NT_UNKNOWN_AUTHN_SERVICE
Definition: ntstatus.h:1004
#define RPC_NT_CALL_FAILED_DNE
Definition: ntstatus.h:987
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
#define STATUS_PASSWORD_MUST_CHANGE
Definition: ntstatus.h:666
#define RPC_NT_INVALID_AUTH_IDENTITY
Definition: ntstatus.h:1006
#define ok(value,...)
Definition: atltest.h:57
#define RPC_X_SS_HANDLES_MISMATCH
Definition: winerror.h:1085
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define RPC_NT_PIPE_DISCIPLINE_ERROR
Definition: ntstatus.h:1065
#define RPC_NT_NO_ENTRY_NAME
Definition: ntstatus.h:993
#define RPC_NT_INVALID_ENDPOINT_FORMAT
Definition: ntstatus.h:966
#define RPC_NT_PIPE_CLOSED
Definition: ntstatus.h:1064
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
#define EPT_S_NOT_REGISTERED
Definition: winerror.h:1061
#define RPC_S_INVALID_NAF_ID
Definition: winerror.h:1071
#define RPC_NT_INVALID_ASYNC_HANDLE
Definition: ntstatus.h:1043
#define RPC_S_ENTRY_NOT_FOUND
Definition: winerror.h:1069
#define RPC_X_NO_MORE_ENTRIES
Definition: winerror.h:1080
#define EPT_S_CANT_CREATE
Definition: winerror.h:1141
#define RPC_NT_NAME_SERVICE_UNAVAILABLE
Definition: ntstatus.h:1019
#define RPC_S_UNKNOWN_AUTHZ_SERVICE
Definition: winerror.h:1058
#define EPT_NT_NOT_REGISTERED
Definition: ntstatus.h:1010
#define RPC_X_BAD_STUB_DATA
Definition: winerror.h:1090
#define RPC_NT_NOTHING_TO_EXPORT
Definition: ntstatus.h:1011
#define RPC_NT_BINDING_HAS_NO_AUTH
Definition: ntstatus.h:1003
#define EPT_S_CANT_PERFORM_OP
Definition: winerror.h:1060
#define RPC_S_INVALID_AUTH_IDENTITY
Definition: winerror.h:1057
#define RPC_NT_UNSUPPORTED_TYPE
Definition: ntstatus.h:990
#define RPC_S_CALL_FAILED
Definition: winerror.h:1037
#define RPC_NT_NULL_REF_POINTER
Definition: ntstatus.h:1054
#define RPC_NT_OUT_OF_RESOURCES
Definition: ntstatus.h:981
#define ERROR_ACCOUNT_LOCKED_OUT
Definition: winerror.h:1151
#define RPC_NT_CALL_FAILED
Definition: ntstatus.h:986
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1011
#define RPC_S_NOT_ALL_OBJS_UNEXPORTED
Definition: winerror.h:1066
#define EPT_NT_INVALID_ENTRY
Definition: ntstatus.h:1008
#define RPC_NT_WRONG_KIND_OF_BINDING
Definition: ntstatus.h:961
#define RPC_S_PROTSEQ_NOT_FOUND
Definition: winerror.h:1052
#define RPC_S_INVALID_ASYNC_HANDLE
Definition: winerror.h:1156
#define RPC_S_UNKNOWN_AUTHN_TYPE
Definition: winerror.h:1049
#define RPC_S_ALREADY_REGISTERED
Definition: winerror.h:1022
#define RPC_NT_NO_MORE_BINDINGS
Definition: ntstatus.h:1030
#define RPC_NT_SERVER_UNAVAILABLE
Definition: ntstatus.h:982
#define RPC_NT_NO_BINDINGS
Definition: ntstatus.h:978
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define RPC_S_CANT_CREATE_ENDPOINT
Definition: winerror.h:1031
#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE
Definition: ntstatus.h:1048
#define RPC_NT_UUID_NO_ADDRESS
Definition: ntstatus.h:996
#define RPC_S_STRING_TOO_LONG
Definition: winerror.h:1051
#define RPC_NT_NOT_LISTENING
Definition: ntstatus.h:975
#define RPC_NT_PROTSEQ_NOT_FOUND
Definition: ntstatus.h:1001
#define RPC_NT_PROTSEQ_NOT_SUPPORTED
Definition: ntstatus.h:963
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define RPC_X_PIPE_DISCIPLINE_ERROR
Definition: winerror.h:1159
#define RPC_NT_ADDRESS_ERROR
Definition: ntstatus.h:1025
#define RPC_S_FP_DIV_ZERO
Definition: winerror.h:1077
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by START_TEST().

◆ test_rpc_ncacn_ip_tcp()

static void test_rpc_ncacn_ip_tcp ( void  )
static

Definition at line 210 of file rpc.c.

211 {
213  unsigned char *binding, *principal;
214  handle_t IFoo_IfHandle;
215  ULONG level, authnsvc, authzsvc;
217  static unsigned char foo[] = "foo";
218  static unsigned char ncacn_ip_tcp[] = "ncacn_ip_tcp";
219  static unsigned char address[] = "127.0.0.1";
220  static unsigned char endpoint[] = "4114";
221  static unsigned char spn[] = "principal";
222 
224  ok(status == RPC_S_INVALID_RPC_PROTSEQ, "return wrong\n");
225 
226  status = RpcNetworkIsProtseqValidA(ncacn_ip_tcp);
227  ok(status == RPC_S_OK, "return wrong\n");
228 
231  "wrong RpcMgmtStopServerListening error (%u)\n", status);
232 
235  "wrong RpcMgmtWaitServerListen error status (%u)\n", status);
236 
237  status = RpcServerListen(1, 20, FALSE);
239  "wrong RpcServerListen error (%u)\n", status);
240 
241  status = RpcServerUseProtseqEpA(ncacn_ip_tcp, 20, endpoint, NULL);
242  ok(status == RPC_S_OK, "RpcServerUseProtseqEp failed (%u)\n", status);
243 
245  ok(status == RPC_S_OK, "RpcServerRegisterIf failed (%u)\n", status);
246 
247  status = RpcServerListen(1, 20, TRUE);
248  ok(status == RPC_S_OK, "RpcServerListen failed (%u)\n", status);
249 
250  status = RpcServerListen(1, 20, TRUE);
252  "wrong RpcServerListen error (%u)\n", status);
253 
254  status = RpcStringBindingComposeA(NULL, ncacn_ip_tcp, address,
255  endpoint, NULL, &binding);
256  ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%u)\n", status);
257 
258  status = RpcBindingFromStringBindingA(binding, &IFoo_IfHandle);
259  ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%u)\n",
260  status);
261 
264  ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%u)\n", status);
265 
266  status = RpcBindingInqAuthInfoA(IFoo_IfHandle, NULL, NULL, NULL, NULL, NULL);
267  ok(status == RPC_S_BINDING_HAS_NO_AUTH, "RpcBindingInqAuthInfo failed (%u)\n",
268  status);
269 
272  ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%u)\n", status);
273 
274  level = authnsvc = authzsvc = 0;
275  principal = (unsigned char *)0xdeadbeef;
276  identity = (RPC_AUTH_IDENTITY_HANDLE *)0xdeadbeef;
277  status = RpcBindingInqAuthInfoA(IFoo_IfHandle, &principal, &level, &authnsvc,
278  &identity, &authzsvc);
279 
280  ok(status == RPC_S_OK, "RpcBindingInqAuthInfo failed (%u)\n", status);
281  ok(identity == NULL, "expected NULL identity, got %p\n", identity);
282  ok(principal != (unsigned char *)0xdeadbeef, "expected valid principal, got %p\n", principal);
283  ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "expected RPC_C_AUTHN_LEVEL_PKT_PRIVACY, got %d\n", level);
284  ok(authnsvc == RPC_C_AUTHN_WINNT, "expected RPC_C_AUTHN_WINNT, got %d\n", authnsvc);
285  todo_wine ok(authzsvc == RPC_C_AUTHZ_NAME, "expected RPC_C_AUTHZ_NAME, got %d\n", authzsvc);
286  if (status == RPC_S_OK) RpcStringFreeA(&principal);
287 
289  ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%u)\n",
290  status);
291 
293  ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%u)\n",
294  status);
295 
297  ok(status == RPC_S_OK, "RpcServerUnregisterIf failed (%u)\n", status);
298 
300  ok(status == RPC_S_OK, "RpcMgmtWaitServerListen failed (%u)\n", status);
301 
302  status = RpcStringFreeA(&binding);
303  ok(status == RPC_S_OK, "RpcStringFree failed (%u)\n", status);
304 
305  status = RpcBindingFree(&IFoo_IfHandle);
306  ok(status == RPC_S_OK, "RpcBindingFree failed (%u)\n", status);
307 }
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:1547
GLint level
Definition: gl.h:1546
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
#define TRUE
Definition: types.h:120
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1599
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:458
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1025
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1209
long RPC_STATUS
Definition: rpc.h:52
static D3DRMMATRIX4D identity
Definition: frame.c:29
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1527
smooth NULL
Definition: ftsmooth.c:416
static RPC_IF_HANDLE IFoo_v0_0_s_ifspec
Definition: rpc.c:208
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
Definition: rpcdce.h:151
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:837
RPC_STATUS WINAPI RpcServerUseProtseqEpA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:917
GLuint address
Definition: glext.h:9393
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1123
#define todo_wine
Definition: test.h:154
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1024
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1015
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1054
Definition: nis.h:10
#define ok(value,...)
Definition: atltest.h:57
#define RPC_C_AUTHZ_NAME
Definition: rpcdce.h:168
unsigned int ULONG
Definition: retypes.h:1
RPC_STATUS WINAPI RpcMgmtWaitServerListen(void)
Definition: rpc_server.c:1546
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:1930
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_C_AUTHN_LEVEL_NONE
Definition: rpcdce.h:146
RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(RPC_CSTR protseq)
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by START_TEST().

◆ test_RpcBindingFree()

static void test_RpcBindingFree ( void  )
static

Definition at line 846 of file rpc.c.

847 {
848  RPC_BINDING_HANDLE binding = NULL;
850 
851  status = RpcBindingFree(&binding);
853  "RpcBindingFree should have returned RPC_S_INVALID_BINDING instead of %d\n",
854  status);
855 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
long RPC_STATUS
Definition: rpc.h:52
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: atltest.h:57
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by START_TEST().

◆ test_RpcExceptionFilter()

static void test_RpcExceptionFilter ( const char func_name)
static

Definition at line 652 of file rpc.c.

653 {
655  int retval;
656  int (WINAPI *pRpcExceptionFilter)(ULONG) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), func_name);
657 
658  if (!pRpcExceptionFilter)
659  {
660  win_skip("%s not exported\n", func_name);
661  return;
662  }
663 
665  {
666  /* skip over uninteresting bits of the number space */
667  if (exception == 2000) exception = 0x40000000;
668  if (exception == 0x40000005) exception = 0x80000000;
669  if (exception == 0x80000005) exception = 0xc0000000;
670 
671  retval = pRpcExceptionFilter(exception);
672  switch (exception)
673  {
675  case STATUS_BREAKPOINT:
682  ok(retval == EXCEPTION_CONTINUE_SEARCH, "%s(0x%x) should have returned %d instead of %d\n",
684  break;
688  trace("%s(0x%x) returned %d\n", func_name, exception, retval);
689  break;
690  default:
691  ok(retval == EXCEPTION_EXECUTE_HANDLER, "%s(0x%x) should have returned %d instead of %d\n",
693  }
694  }
695 }
#define STATUS_ILLEGAL_INSTRUCTION
Definition: ntstatus.h:252
#define exception
Definition: math.h:26
#define STATUS_REG_NAT_CONSUMPTION
Definition: ntstatus.h:807
#define STATUS_GUARD_PAGE_VIOLATION
Definition: ntstatus.h:170
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define STATUS_BREAKPOINT
Definition: ntstatus.h:172
#define trace
Definition: atltest.h:70
void func_name(void)
#define WINAPI
Definition: msvc.h:8
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define STATUS_HANDLE_NOT_CLOSABLE
Definition: ntstatus.h:683
#define STATUS_PRIVILEGED_INSTRUCTION
Definition: ntstatus.h:372
#define STATUS_POSSIBLE_DEADLOCK
Definition: ntstatus.h:623
#define STATUS_INSTRUCTION_MISALIGNMENT
Definition: ntstatus.h:392
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
#define ok(value,...)
Definition: atltest.h:57
#define STATUS_STACK_OVERFLOW
Definition: ntstatus.h:475
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:171
unsigned int ULONG
Definition: retypes.h:1
#define GetProcAddress(x, y)
Definition: compat.h:410
#define STATUS_IN_PAGE_ERROR
Definition: ntstatus.h:229
#define win_skip
Definition: test.h:141
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by START_TEST().

◆ test_RpcServerInqDefaultPrincName()

static void test_RpcServerInqDefaultPrincName ( void  )
static

Definition at line 857 of file rpc.c.

858 {
859  RPC_STATUS ret;
860  RPC_CSTR principal, saved_principal;
861  char *username;
862  ULONG len = 0;
863 
864  GetUserNameExA( NameSamCompatible, NULL, &len );
866  GetUserNameExA( NameSamCompatible, username, &len );
867 
869  ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %u\n", ret );
870 
872  ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %u\n", ret );
873 
874  principal = (RPC_CSTR)0xdeadbeef;
876  ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %u\n", ret );
877  ok( principal == (RPC_CSTR)0xdeadbeef, "got unexpected principal\n" );
878 
879  saved_principal = (RPC_CSTR)0xdeadbeef;
880  ret = RpcServerInqDefaultPrincNameA( RPC_C_AUTHN_WINNT, &saved_principal );
881  ok( ret == RPC_S_OK, "got %u\n", ret );
882  ok( saved_principal != (RPC_CSTR)0xdeadbeef, "expected valid principal\n" );
883  ok( !strcmp( (const char *)saved_principal, username ), "got \'%s\'\n", saved_principal );
884  trace("%s\n", saved_principal);
885 
887  ok( ret == RPC_S_OK, "got %u\n", ret );
888 
889  principal = (RPC_CSTR)0xdeadbeef;
891  ok( ret == RPC_S_OK, "got %u\n", ret );
892  ok( principal != (RPC_CSTR)0xdeadbeef, "expected valid principal\n" );
893  ok( !strcmp( (const char *)principal, username ), "got \'%s\'\n", principal );
894  RpcStringFreeA( &principal );
895 
896  ret = RpcServerRegisterAuthInfoA( saved_principal, RPC_C_AUTHN_WINNT, NULL, NULL );
897  ok( ret == RPC_S_OK, "got %u\n", ret );
898 
899  RpcStringFreeA( &saved_principal );
901 }
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
BOOLEAN WINAPI GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize)
Definition: sspi.c:1044
#define RPC_C_AUTHN_DEFAULT
Definition: rpcdce.h:165
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
long RPC_STATUS
Definition: rpc.h:52
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
smooth NULL
Definition: ftsmooth.c:416
static WCHAR username[]
Definition: url.c:32
#define GetProcessHeap()
Definition: compat.h:395
#define trace
Definition: atltest.h:70
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
GLenum GLsizei len
Definition: glext.h:6722
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
RPC_STATUS WINAPI RpcServerRegisterAuthInfoA(RPC_CSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1421
#define HeapFree(x, y, z)
Definition: compat.h:394
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameA(ULONG AuthnSvc, RPC_CSTR *PrincName)
Definition: rpc_server.c:1488
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by START_TEST().

◆ test_RpcServerRegisterAuthInfo()

static void test_RpcServerRegisterAuthInfo ( void  )
static

Definition at line 903 of file rpc.c.

904 {
906 
908  ok(status == RPC_S_UNKNOWN_AUTHN_SERVICE, "status = %x\n", status);
909 }
RPC_STATUS WINAPI RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1441
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
#define ok(value,...)
Definition: atltest.h:57
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by START_TEST().

◆ test_RpcServerUseProtseq()

static void test_RpcServerUseProtseq ( void  )
static

Definition at line 911 of file rpc.c.

912 {
914  RPC_BINDING_VECTOR *bindings;
915  ULONG i;
916  ULONG binding_count_before;
917  ULONG binding_count_after1;
918  ULONG binding_count_after2;
919  ULONG endpoints_registered = 0;
920  static unsigned char iptcp[] = "ncacn_ip_tcp";
921  static unsigned char np[] = "ncacn_np";
922  static unsigned char ncalrpc[] = "ncalrpc";
923  BOOL iptcp_registered = FALSE, np_registered = FALSE, ncalrpc_registered = FALSE;
924 
925  status = RpcServerInqBindings(&bindings);
926  if (status == RPC_S_NO_BINDINGS)
927  binding_count_before = 0;
928  else
929  {
930  binding_count_before = bindings->Count;
931  ok(status == RPC_S_OK, "RpcServerInqBindings failed with status %d\n", status);
932  for (i = 0; i < bindings->Count; i++)
933  {
934  RPC_CSTR str_bind;
935  status = RpcBindingToStringBindingA(bindings->BindingH[i], &str_bind);
936  ok(status == RPC_S_OK, "RpcBindingToStringBinding failed with status %d\n", status);
937  if (lstrlenA((const char *)str_bind) > 12 && !memcmp(str_bind, "ncacn_ip_tcp", 12))
938  iptcp_registered = TRUE;
939  if (lstrlenA((const char *)str_bind) > 8 && !memcmp(str_bind, "ncacn_np", 8))
940  np_registered = TRUE;
941  if (lstrlenA((const char *)str_bind) > 7 && !memcmp(str_bind, "ncalrpc", 7))
942  ncalrpc_registered = TRUE;
943  RpcStringFreeA(&str_bind);
944  }
945  RpcBindingVectorFree(&bindings);
946  }
947 
948  /* show that RpcServerUseProtseqEp(..., NULL, ...) is the same as
949  * RpcServerUseProtseq(...) */
950  status = RpcServerUseProtseqEpA(ncalrpc, 0, NULL, NULL);
952  "RpcServerUseProtseqEp with NULL endpoint failed with status %d\n",
953  status);
954 
955  /* register protocol sequences without explicit endpoints */
956  status = RpcServerUseProtseqA(np, 0, NULL);
958  win_skip("ncacn_np not supported\n");
959  else
960  ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_np) failed with status %d\n", status);
961  if (status == RPC_S_OK && !np_registered) endpoints_registered++;
962 
963  status = RpcServerUseProtseqA(iptcp, 0, NULL);
964  ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %d\n", status);
965  if (status == RPC_S_OK && !iptcp_registered) endpoints_registered++;
966 
967  status = RpcServerUseProtseqA(ncalrpc, 0, NULL);
968  ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status);
969  if (status == RPC_S_OK && !ncalrpc_registered) endpoints_registered++;
970 
971  status = RpcServerInqBindings(&bindings);
972  ok(status == RPC_S_OK, "RpcServerInqBindings failed with status %d\n", status);
973  binding_count_after1 = bindings->Count;
974  ok(binding_count_after1 == binding_count_before + endpoints_registered,
975  "wrong binding count - before: %u, after %u, endpoints registered %u\n",
976  binding_count_before, binding_count_after1, endpoints_registered);
977  for (i = 0; i < bindings->Count; i++)
978  {
979  RPC_CSTR str_bind;
980  status = RpcBindingToStringBindingA(bindings->BindingH[i], &str_bind);
981  ok(status == RPC_S_OK, "RpcBindingToStringBinding failed with status %d\n", status);
982  trace("string binding: %s\n", str_bind);
983  RpcStringFreeA(&str_bind);
984  }
985  RpcBindingVectorFree(&bindings);
986 
987  /* re-register - endpoints should be reused */
988  status = RpcServerUseProtseqA(np, 0, NULL);
990  win_skip("ncacn_np not supported\n");
991  else
992  ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_np) failed with status %d\n", status);
993 
994  status = RpcServerUseProtseqA(iptcp, 0, NULL);
995  ok(status == RPC_S_OK, "RpcServerUseProtseq(ncacn_ip_tcp) failed with status %d\n", status);
996 
997  status = RpcServerUseProtseqA(ncalrpc, 0, NULL);
998  ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status);
999 
1000  status = RpcServerInqBindings(&bindings);
1001  ok(status == RPC_S_OK, "RpcServerInqBindings failed with status %d\n", status);
1002  binding_count_after2 = bindings->Count;
1003  ok(binding_count_after2 == binding_count_after1,
1004  "bindings should have been re-used - after1: %u after2: %u\n",
1005  binding_count_after1, binding_count_after2);
1006  RpcBindingVectorFree(&bindings);
1007 }
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1029
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
#define RPC_S_INVALID_ENDPOINT_FORMAT
Definition: winerror.h:1017
RPC_STATUS WINAPI RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor)
Definition: rpc_server.c:1067
long RPC_STATUS
Definition: rpc.h:52
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
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
smooth NULL
Definition: ftsmooth.c:416
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:917
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1014
RPC_STATUS WINAPI RpcServerInqBindings(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_server.c:868
#define trace
Definition: atltest.h:70
RPC_STATUS WINAPI RpcServerUseProtseqEpA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:917
RPC_BINDING_HANDLE BindingH[1]
Definition: rpcdce.h:58
RPC_STATUS WINAPI RpcBindingVectorFree(RPC_BINDING_VECTOR **BindingVector)
Definition: rpc_binding.c:799
#define broken(x)
Definition: _sntprintf.h:21
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1
static SERVICE_STATUS status
Definition: service.c:31
#define win_skip
Definition: test.h:141
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by START_TEST().

◆ test_RpcStringBindingFromBinding()

static void test_RpcStringBindingFromBinding ( void  )
static

Definition at line 697 of file rpc.c.

698 {
699  static unsigned char ncacn_np[] = "ncacn_np";
700  static unsigned char address[] = ".";
701  static unsigned char endpoint[] = "\\pipe\\wine_rpc_test";
704  RPC_CSTR binding;
705 
707  endpoint, NULL, &binding);
708  ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%u)\n", status);
709 
711  ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%u)\n", status);
712  RpcStringFreeA(&binding);
713 
715  ok(status == RPC_S_OK, "RpcStringBindingFromBinding failed with error %u\n", status);
716 
717  ok(!strcmp((const char *)binding, "ncacn_np:.[\\\\pipe\\\\wine_rpc_test]"),
718  "binding string didn't match what was expected: \"%s\"\n", binding);
719  RpcStringFreeA(&binding);
720 
722  ok(status == RPC_S_OK, "RpcBindingFree failed with error %u\n", status);
723 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
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:458
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
long RPC_STATUS
Definition: rpc.h:52
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
smooth NULL
Definition: ftsmooth.c:416
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:917
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:837
GLuint address
Definition: glext.h:9393
Definition: nis.h:10
#define ok(value,...)
Definition: atltest.h:57
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by START_TEST().

◆ test_RpcStringBindingParseA()

static void test_RpcStringBindingParseA ( void  )
static

Definition at line 571 of file rpc.c.

572 {
573  static unsigned char valid_binding[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[endpoint=\\pipe\\test]";
574  static unsigned char valid_binding2[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[\\pipe\\test]";
575  static unsigned char invalid_uuid_binding[] = "{00000000-0000-0000-c000-000000000046}@ncacn_np:.[endpoint=\\pipe\\test]";
576  static unsigned char invalid_ep_binding[] = "00000000-0000-0000-c000-000000000046@ncacn_np:.[endpoint=test]";
577  static unsigned char invalid_binding[] = "00000000-0000-0000-c000-000000000046@ncacn_np";
579  unsigned char *uuid;
580  unsigned char *protseq;
581  unsigned char *network_addr;
582  unsigned char *endpoint;
583  unsigned char *options;
584 
585  /* test all parameters */
586  status = RpcStringBindingParseA(valid_binding, &uuid, &protseq, &network_addr, &endpoint, &options);
587  ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %d\n", status);
588  ok(!strcmp((char *)uuid, "00000000-0000-0000-c000-000000000046"), "uuid should have been 00000000-0000-0000-C000-000000000046 instead of %s\n", uuid);
589  ok(!strcmp((char *)protseq, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq);
590  ok(!strcmp((char *)network_addr, "."), "network_addr should have been . instead of %s\n", network_addr);
591  ok(!strcmp((char *)endpoint, "pipetest"), "endpoint should have been pipetest instead of %s\n", endpoint);
592  if (options)
593  ok(!strcmp((char *)options, ""), "options should have been \"\" of \"%s\"\n", options);
594  else
595  todo_wine ok(FALSE, "options is NULL\n");
597  RpcStringFreeA(&protseq);
598  RpcStringFreeA(&network_addr);
601 
602  /* test all parameters with different type of string binding */
603  status = RpcStringBindingParseA(valid_binding2, &uuid, &protseq, &network_addr, &endpoint, &options);
604  ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %d\n", status);
605  ok(!strcmp((char *)uuid, "00000000-0000-0000-c000-000000000046"), "uuid should have been 00000000-0000-0000-C000-000000000046 instead of %s\n", uuid);
606  ok(!strcmp((char *)protseq, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq);
607  ok(!strcmp((char *)network_addr, "."), "network_addr should have been . instead of %s\n", network_addr);
608  ok(!strcmp((char *)endpoint, "pipetest"), "endpoint should have been pipetest instead of %s\n", endpoint);
609  if (options)
610  ok(!strcmp((char *)options, ""), "options should have been \"\" of \"%s\"\n", options);
611  else
612  todo_wine ok(FALSE, "options is NULL\n");
614  RpcStringFreeA(&protseq);
615  RpcStringFreeA(&network_addr);
618 
619  /* test with as many parameters NULL as possible */
620  status = RpcStringBindingParseA(valid_binding, NULL, &protseq, NULL, NULL, NULL);
621  ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %d\n", status);
622  ok(!strcmp((char *)protseq, "ncacn_np"), "protseq should have been ncacn_np instead of %s\n", protseq);
623  RpcStringFreeA(&protseq);
624 
625  /* test with invalid uuid */
626  status = RpcStringBindingParseA(invalid_uuid_binding, NULL, &protseq, NULL, NULL, NULL);
627  ok(status == RPC_S_INVALID_STRING_UUID, "RpcStringBindingParseA should have returned RPC_S_INVALID_STRING_UUID instead of %d\n", status);
628  ok(protseq == NULL, "protseq was %p instead of NULL\n", protseq);
629 
630  /* test with invalid endpoint */
631  status = RpcStringBindingParseA(invalid_ep_binding, NULL, &protseq, NULL, NULL, NULL);
632  ok(status == RPC_S_OK, "RpcStringBindingParseA failed with error %d\n", status);
633  RpcStringFreeA(&protseq);
634 
635  /* test with invalid binding */
636  status = RpcStringBindingParseA(invalid_binding, &uuid, &protseq, &network_addr, &endpoint, &options);
637  todo_wine
638  ok(status == RPC_S_INVALID_STRING_BINDING, "RpcStringBindingParseA should have returned RPC_S_INVALID_STRING_BINDING instead of %d\n", status);
639  todo_wine
640  ok(uuid == NULL, "uuid was %p instead of NULL\n", uuid);
641  if (uuid)
643  ok(protseq == NULL, "protseq was %p instead of NULL\n", protseq);
644  todo_wine
645  ok(network_addr == NULL, "network_addr was %p instead of NULL\n", network_addr);
646  if (network_addr)
647  RpcStringFreeA(&network_addr);
648  ok(endpoint == NULL, "endpoint was %p instead of NULL\n", endpoint);
649  ok(options == NULL, "options was %p instead of NULL\n", options);
650 }
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:565
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
int options
Definition: main.c:106
struct endpoint endpoint
Definition: nis.h:15
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1016
#define todo_wine
Definition: test.h:154
Definition: nis.h:10
#define ok(value,...)
Definition: atltest.h:57
Definition: msctf.idl:510
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1011
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by START_TEST().

◆ test_towers()

static void test_towers ( void  )
static

Definition at line 339 of file rpc.c.

340 {
341  RPC_STATUS ret;
342  twr_t *tower;
343  static const RPC_SYNTAX_IDENTIFIER mapi_if_id = { { 0xa4f1db00, 0xca47, 0x1067, { 0xb3, 0x1f, 0x00, 0xdd, 0x01, 0x06, 0x62, 0xda } }, { 0, 0 } };
344  static const RPC_SYNTAX_IDENTIFIER ndr_syntax = { { 0x8a885d04, 0x1ceb, 0x11c9, { 0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60 } }, { 2, 0 } };
346  char *protseq, *endpoint, *address;
347  BOOL same;
348 
349  ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "10.0.0.1", &tower);
350  ok(ret == RPC_S_OK ||
351  broken(ret == RPC_S_INVALID_RPC_PROTSEQ), /* Vista */
352  "TowerConstruct failed with error %d\n", ret);
354  {
355  /* Windows Vista fails with this error and crashes if we continue */
356  win_skip("TowerConstruct failed, we are most likely on Windows Vista\n");
357  return;
358  }
359 
360  /* first check we have the right amount of data */
361  ok(tower->tower_length == sizeof(tower_data_tcp_ip1) ||
362  tower->tower_length == sizeof(tower_data_tcp_ip2),
363  "Wrong size of tower %d\n", tower->tower_length);
364 
365  /* then do a byte-by-byte comparison */
366  same = ((tower->tower_length == sizeof(tower_data_tcp_ip1)) &&
368  ((tower->tower_length == sizeof(tower_data_tcp_ip2)) &&
370 
371  ok(same, "Tower data differs\n");
372  if (!same)
373  {
374  unsigned32 i;
375  for (i = 0; i < tower->tower_length; i++)
376  {
377  if (i % 8 == 0) printf(" ");
378  printf("0x%02x,", tower->tower_octet_string[i]);
379  if (i % 8 == 7) printf("\n");
380  }
381  printf("\n");
382  }
383 
384  ret = TowerExplode(tower, &object, &syntax, &protseq, &endpoint, &address);
385  ok(ret == RPC_S_OK, "TowerExplode failed with error %d\n", ret);
386  ok(!memcmp(&object, &mapi_if_id, sizeof(mapi_if_id)), "object id didn't match\n");
387  ok(!memcmp(&syntax, &ndr_syntax, sizeof(syntax)), "syntax id didn't match\n");
388  ok(!strcmp(protseq, "ncacn_ip_tcp"), "protseq was \"%s\" instead of \"ncacn_ip_tcp\"\n", protseq);
389  ok(!strcmp(endpoint, "135"), "endpoint was \"%s\" instead of \"135\"\n", endpoint);
390  ok(!strcmp(address, "10.0.0.1"), "address was \"%s\" instead of \"10.0.0.1\"\n", address);
391 
392  I_RpcFree(protseq);
395 
396  ret = TowerExplode(tower, NULL, NULL, NULL, NULL, NULL);
397  ok(ret == RPC_S_OK, "TowerExplode failed with error %d\n", ret);
398 
399  I_RpcFree(tower);
400 
401  /* test the behaviour for ip_tcp with name instead of dotted IP notation */
402  ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "localhost", &tower);
403  ok(ret == RPC_S_OK, "TowerConstruct failed with error %d\n", ret);
404  ret = TowerExplode(tower, NULL, NULL, NULL, NULL, &address);
405  ok(ret == RPC_S_OK, "TowerExplode failed with error %d\n", ret);
406  ok(!strcmp(address, "0.0.0.0") ||
407  broken(!strcmp(address, "255.255.255.255")),
408  "address was \"%s\" instead of \"0.0.0.0\"\n", address);
409 
411  I_RpcFree(tower);
412 
413  /* test the behaviour for np with no address */
414  ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_np", "\\pipe\\test", NULL, &tower);
415  ok(ret == RPC_S_OK, "TowerConstruct failed with error %d\n", ret);
416  ret = TowerExplode(tower, NULL, NULL, NULL, NULL, &address);
417  ok(ret == RPC_S_OK ||
418  broken(ret != RPC_S_OK), /* win2k, indeterminate */
419  "TowerExplode failed with error %d\n", ret);
420  /* Windows XP SP3 sets address to NULL */
421  ok(!address || !strcmp(address, ""), "address was \"%s\" instead of \"\" or NULL (XP SP3)\n", address);
422 
424  I_RpcFree(tower);
425 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:725
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:596
long RPC_STATUS
Definition: rpc.h:52
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
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: rpc.c:44
byte tower_octet_string[1]
Definition: rpc.c:47
RPC_STATUS WINAPI TowerExplode(const twr_t *tower, RPC_SYNTAX_IDENTIFIER *object, RPC_SYNTAX_IDENTIFIER *syntax, char **protseq, char **endpoint, char **address)
struct endpoint endpoint
Definition: nis.h:15
GLuint address
Definition: glext.h:9393
int ret
static const unsigned char tower_data_tcp_ip1[]
Definition: rpc.c:311
static const unsigned char tower_data_tcp_ip2[]
Definition: rpc.c:325
#define broken(x)
Definition: _sntprintf.h:21
unsigned32 tower_length
Definition: rpc.c:46
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1015
Definition: nis.h:10
unsigned int unsigned32
Definition: rpc.c:43
#define ok(value,...)
Definition: atltest.h:57
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define win_skip
Definition: test.h:141
void * object
Definition: jmemsys.h:48
#define RPC_S_OK
Definition: rpcnterr.h:22
#define printf
Definition: config.h:203

Referenced by START_TEST().

◆ test_UuidCreate()

static void test_UuidCreate ( void  )
static

Definition at line 725 of file rpc.c.

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

Referenced by START_TEST().

◆ test_UuidCreateSequential()

static void test_UuidCreateSequential ( void  )
static

Definition at line 781 of file rpc.c.

782 {
783  UUID guid1;
784  BYTE version;
785  RPC_STATUS (WINAPI *pUuidCreateSequential)(UUID *) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "UuidCreateSequential");
786  RPC_STATUS (WINAPI *pI_UuidCreate)(UUID *) = (void*)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "I_UuidCreate");
787  RPC_STATUS ret;
788 
789  if (!pUuidCreateSequential)
790  {
791  win_skip("UuidCreateSequential not exported\n");
792  return;
793  }
794 
795  ok(pI_UuidCreate != pUuidCreateSequential, "got %p, %p\n", pI_UuidCreate, pUuidCreateSequential);
796 
797  ret = pUuidCreateSequential(&guid1);
799  "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret);
800  version = (guid1.Data3 & 0xf000) >> 12;
801  ok(version == 1, "unexpected version %d\n", version);
802  if (version == 1)
803  {
804  UUID guid2;
805 
806  if (!ret)
807  {
808  /* If the call succeeded, there's a valid (non-multicast) MAC
809  * address in the uuid:
810  */
811  ok(!(guid1.Data4[2] & 0x01) || broken(guid1.Data4[2] & 0x01), /* Win 8.1 */
812  "GUID does not appear to contain a MAC address: %s\n",
813  wine_dbgstr_guid(&guid1));
814  }
815  else
816  {
817  /* Otherwise, there's a randomly generated multicast MAC address
818  * address in the uuid:
819  */
820  ok((guid1.Data4[2] & 0x01),
821  "GUID does not appear to contain a multicast MAC address: %s\n",
822  wine_dbgstr_guid(&guid1));
823  }
824  /* Generate another GUID, and make sure its MAC address matches the
825  * first.
826  */
827  ret = pUuidCreateSequential(&guid2);
829  "expected RPC_S_OK or RPC_S_UUID_LOCAL_ONLY, got %08x\n", ret);
830  version = (guid2.Data3 & 0xf000) >> 12;
831  ok(version == 1, "unexpected version %d\n", version);
832  ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)),
833  "unexpected value in MAC address: %s\n",
835 
836  /* I_UuidCreate does exactly the same */
837  pI_UuidCreate(&guid2);
838  version = (guid2.Data3 & 0xf000) >> 12;
839  ok(version == 1, "unexpected version %d\n", version);
840  ok(!memcmp(guid1.Data4, guid2.Data4, sizeof(guid2.Data4)),
841  "unexpected value in MAC address: %s\n",
843  }
844 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
const char * wine_dbgstr_guid(const GUID *guid)
long RPC_STATUS
Definition: rpc.h:52
static GUID guid2
Definition: devinst.c:42
static const WCHAR version[]
Definition: asmname.c:64
#define WINAPI
Definition: msvc.h:8
int ret
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
unsigned char BYTE
Definition: mem.h:68
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
#define GetProcAddress(x, y)
Definition: compat.h:410
#define win_skip
Definition: test.h:141
#define RPC_S_UUID_LOCAL_ONLY
Definition: winerror.h:1131

Referenced by START_TEST().

◆ TestDceErrorInqText()

static void TestDceErrorInqText ( void  )
static

Definition at line 144 of file rpc.c.

145 {
146  char bufferInvalid [1024];
147  char buffer [1024]; /* The required size is not documented but would
148  * appear to be 256.
149  */
150  DWORD dwCount;
151 
153  RPC_S_NOT_RPC_ERROR, 0, bufferInvalid, ARRAY_SIZE(bufferInvalid), NULL);
154 
155  /* A random sample of DceErrorInqText */
156  /* 0 is success */
157  ok ((DceErrorInqTextA (0, (unsigned char*)buffer) == RPC_S_OK),
158  "DceErrorInqTextA(0...)\n");
159  /* A real RPC_S error */
161  "DceErrorInqTextA(valid...)\n");
162 
163  if (dwCount)
164  {
165  /* A message for which FormatMessage should fail
166  * which should return RPC_S_OK and the
167  * fixed "not valid" message
168  */
169  ok ((DceErrorInqTextA (35, (unsigned char*)buffer) == RPC_S_OK &&
170  strcmp (buffer, bufferInvalid) == 0),
171  "DceErrorInqTextA(unformattable...)\n");
172  /* One for which FormatMessage should succeed but
173  * DceErrorInqText should "fail"
174  * 3814 is generally quite a long message
175  */
176  ok ((DceErrorInqTextA (3814, (unsigned char*)buffer) == RPC_S_OK &&
177  strcmp (buffer, bufferInvalid) == 0),
178  "DceErrorInqTextA(deviation...)\n");
179  }
180  else
181  ok (0, "Cannot set up for DceErrorInqText\n");
182 }
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
smooth NULL
Definition: ftsmooth.c:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
#define RPC_S_NOT_RPC_ERROR
Definition: winerror.h:1130
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1016
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
RPC_STATUS RPC_ENTRY DceErrorInqTextA(RPC_STATUS e, RPC_CSTR buffer)
Definition: rpcrt4_main.c:698
#define RPC_S_OK
Definition: rpcnterr.h:22

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 596 of file rpc_epmap.c.

600 {
601  size_t tower_size;
603  unsigned char *p;
604  twr_uuid_floor_t *object_floor;
605  twr_uuid_floor_t *syntax_floor;
606 
607  TRACE("(%p, %p, %s, %s, %s, %p)\n", object, syntax, debugstr_a(protseq),
609 
610  *tower = NULL;
611 
612  status = RpcTransport_GetTopOfTower(NULL, &tower_size, protseq, address, endpoint);
613 
614  if (status != RPC_S_OK)
615  return status;
616 
617  tower_size += sizeof(u_int16) + sizeof(*object_floor) + sizeof(*syntax_floor);
618  *tower = I_RpcAllocate(FIELD_OFFSET(twr_t, tower_octet_string[tower_size]));
619  if (!*tower)
620  return RPC_S_OUT_OF_RESOURCES;
621 
622  (*tower)->tower_length = tower_size;
623  p = &(*tower)->tower_octet_string[0];
624  *(u_int16 *)p = 5; /* number of floors */
625  p += sizeof(u_int16);
626  object_floor = (twr_uuid_floor_t *)p;
627  p += sizeof(*object_floor);
628  syntax_floor = (twr_uuid_floor_t *)p;
629  p += sizeof(*syntax_floor);
630 
631  object_floor->count_lhs = sizeof(object_floor->protid) + sizeof(object_floor->uuid) +
632  sizeof(object_floor->major_version);
633  object_floor->protid = EPM_PROTOCOL_UUID;
634  object_floor->count_rhs = sizeof(object_floor->minor_version);
635  object_floor->uuid = object->SyntaxGUID;
636  object_floor->major_version = object->SyntaxVersion.MajorVersion;
637  object_floor->minor_version = object->SyntaxVersion.MinorVersion;
638 
639  syntax_floor->count_lhs = sizeof(syntax_floor->protid) + sizeof(syntax_floor->uuid) +
640  sizeof(syntax_floor->major_version);
641  syntax_floor->protid = EPM_PROTOCOL_UUID;
642  syntax_floor->count_rhs = sizeof(syntax_floor->minor_version);
643  syntax_floor->uuid = syntax->SyntaxGUID;
644  syntax_floor->major_version = syntax->SyntaxVersion.MajorVersion;
645  syntax_floor->minor_version = syntax->SyntaxVersion.MinorVersion;
646 
647  status = RpcTransport_GetTopOfTower(p, &tower_size, protseq, address, endpoint);
648  if (status != RPC_S_OK)
649  {
650  I_RpcFree(*tower);
651  *tower = NULL;
652  return status;
653  }
654  return RPC_S_OK;
655 }
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:725
unsigned short MajorVersion
Definition: rpcdcep.h:27
#define EPM_PROTOCOL_UUID
Definition: epm_towers.h:35
long RPC_STATUS
Definition: rpc.h:52
RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint) DECLSPEC_HIDDEN
u_int16 count_rhs
Definition: epm_towers.h:61
RPC_VERSION SyntaxVersion
Definition: rpcdcep.h:33
smooth NULL
Definition: ftsmooth.c:416
u_int16 count_lhs
Definition: epm_towers.h:57
Definition: rpc.c:44
#define TRACE(s)
Definition: solgame.cpp:4
unsigned short u_int16
Definition: dcetypes.idl:33
#define debugstr_a
Definition: kernel32.h:31
GLuint address
Definition: glext.h:9393
u_int16 major_version
Definition: epm_towers.h:60
unsigned short MinorVersion
Definition: rpcdcep.h:28
Definition: nis.h:10
u_int16 minor_version
Definition: epm_towers.h:62
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
GLfloat GLfloat p
Definition: glext.h:8902
static SERVICE_STATUS status
Definition: service.c:31
void *WINAPI I_RpcAllocate(unsigned int Size)
Definition: rpcrt4_main.c:717
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by epm_register(), ept_map(), RpcEpResolveBinding(), RpcEpUnregister(), and 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().

◆ UuidConversionAndComparison()

static void UuidConversionAndComparison ( void  )
static

Definition at line 81 of file rpc.c.

81  {
82  CHAR strx[100], x;
83  LPSTR str = strx;
84  WCHAR wstrx[100], wx;
85  LPWSTR wstr = wstrx;
86 
87  UUID Uuid1, Uuid2, *PUuid1, *PUuid2;
88  RPC_STATUS rslt;
89 
90  int i1,i2;
91 
92  /* Uuid Equality */
93  for (i1 = 0; i1 < 11; i1++)
94  for (i2 = 0; i2 < 11; i2++) {
95  if (i1 < 10) {
96  Uuid1 = Uuid_Table[i1];
97  PUuid1 = &Uuid1;
98  } else {
99  PUuid1 = NULL;
100  }
101  if (i2 < 10) {
102  Uuid2 = Uuid_Table[i2];
103  PUuid2 = &Uuid2;
104  } else {
105  PUuid2 = NULL;
106  }
107  ok( (UuidEqual(PUuid1, PUuid2, &rslt) == Uuid_Comparison_Grid[i1][i2]), "UUID Equality\n" );
108  }
109 
110  /* Uuid to String to Uuid (char) */
111  for (i1 = 0; i1 < 10; i1++) {
112  Uuid1 = Uuid_Table[i1];
113  ok( (UuidToStringA(&Uuid1, (unsigned char**)&str) == RPC_S_OK), "Simple UUID->String copy\n" );
114  ok( (UuidFromStringA((unsigned char*)str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String\n" );
115  ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform\n" );
116  /* invalid uuid tests -- size of valid UUID string=36 */
117  for (i2 = 0; i2 < 36; i2++) {
118  x = str[i2];
119  str[i2] = 'g'; /* whatever, but "g" is a good boundary condition */
120  ok( (UuidFromStringA((unsigned char*)str, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID String\n" );
121  str[i2] = x; /* change it back so remaining tests are interesting. */
122  }
123  RpcStringFreeA((unsigned char **)&str);
124  }
125 
126  /* Uuid to String to Uuid (wchar) */
127  for (i1 = 0; i1 < 10; i1++) {
128  Uuid1 = Uuid_Table[i1];
129  rslt=UuidToStringW(&Uuid1, &wstr);
130  ok( (rslt == RPC_S_OK), "Simple UUID->WString copy\n" );
131  ok( (UuidFromStringW(wstr, &Uuid2) == RPC_S_OK), "Simple WString->UUID copy from generated UUID String\n" );
132  ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> WString -> Uuid transform\n" );
133  /* invalid uuid tests -- size of valid UUID string=36 */
134  for (i2 = 0; i2 < 36; i2++) {
135  wx = wstr[i2];
136  wstr[i2] = 'g'; /* whatever, but "g" is a good boundary condition */
137  ok( (UuidFromStringW(wstr, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID WString\n" );
138  wstr[i2] = wx; /* change it back so remaining tests are interesting. */
139  }
140  RpcStringFreeW(&wstr);
141  }
142 }
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
char CHAR
Definition: xmlstorage.h:175
static UUID Uuid_Table[10]
Definition: rpc.c:53
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:253
char * LPSTR
Definition: xmlstorage.h:182
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:161
static BOOL Uuid_Comparison_Grid[11][11]
Definition: rpc.c:67
long RPC_STATUS
Definition: rpc.h:52
RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR *StringUuid)
Definition: rpcrt4_main.c:515
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:541
#define RPC_S_INVALID_STRING_UUID
Definition: winerror.h:1016
#define ok(value,...)
Definition: atltest.h:57
RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid)
Definition: rpcrt4_main.c:575
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by START_TEST().

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:189
struct _RPC_SERVER_INTERFACE RPC_SERVER_INTERFACE

Definition at line 195 of file rpc.c.

◆ IFoo_table

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

Definition at line 184 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:184

Definition at line 189 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 208 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 311 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 325 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 53 of file rpc.c.

Referenced by UuidConversionAndComparison().