ReactOS 0.4.16-dev-1946-g52006dd
server.c File Reference
#include <windows.h>
#include <ole2.h>
#include <oleauto.h>
#include <secext.h>
#include <rpcdce.h>
#include <netfw.h>
#include "wine/test.h"
#include "server_s.h"
#include "server_interp_s.h"
#include "server_defines.h"
#include "explicit_handle.h"
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for server.c:

Go to the source code of this file.

Classes

struct  test_thread_params
 

Macros

#define COBJMACROS
 
#define SKIP_TYPE_DECLS
 
#define PORT   "4114"
 
#define PIPE   "\\pipe\\wine_rpcrt4_test"
 
#define INT_CODE   4198
 
#define SERVER_FUNCTIONS
 
#define X(name)   name = interp_##name;
 
#define X(name)   name = mixed_##name;
 
#define test_is_server_listening(a, b)   _test_is_server_listening(__LINE__,a,b)
 
#define test_is_server_listening2(a, b, c)   _test_is_server_listening2(__LINE__,a,b,c)
 

Enumerations

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

Functions

static void (WINAPI *pNDRSContextMarshall2)(RPC_BINDING_HANDLE
 
static NDR_SCONTEXT (WINAPI *pNDRSContextUnmarshall2)(RPC_BINDING_HANDLE
 
static RPC_STATUS (WINAPI *pRpcServerRegisterIfEx)(RPC_IF_HANDLE
 
static int (__cdecl *int_return)(void)
 
static signed char (__cdecl *sum_char)(signed char x
 
static short (__cdecl *sum_short)(short x
 
static hyper (__cdecl *sum_hyper)(hyper x
 
static void (__cdecl *square_out)(int x
 
static double (__cdecl *square_half)(double x
 
static float (__cdecl *square_half_float)(float x
 
static LONG (__cdecl *square_half_long)(LONG x
 
static unsigned (__cdecl *hash_bstr)(bstr_t s)
 
static s123_t *__cdeclget_s123 (void)
 
static str_t (__cdecl *get_filename)(void)
 
static rint_t (__cdecl *echo_ranged_int)(int i
 
static ctx_handle_t (__cdecl *get_handle)(void)
 
static void set_interp_interface (void)
 
static void set_mixed_interface (void)
 
static void InitFunctionPointers (void)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T n)
 
void __RPC_USER midl_user_free (void __RPC_FAR *p)
 
int __cdecl s_int_return (void)
 
int __cdecl s_square (int x)
 
int __cdecl s_sum (int x, int y)
 
signed char __cdecl s_sum_char (signed char x, signed char y)
 
short __cdecl s_sum_short (short x, short y)
 
int __cdecl s_sum_float (float x, float y)
 
int __cdecl s_sum_double_int (int x, double y)
 
hyper __cdecl s_sum_hyper (hyper x, hyper y)
 
int __cdecl s_sum_hyper_int (hyper x, hyper y)
 
int __cdecl s_sum_char_hyper (signed char x, hyper y)
 
int __cdecl s_sum_chars (int a, chars_t x, chars_t y)
 
int __cdecl s_sum_ints (int a, ints_t x, ints_t y)
 
int __cdecl s_sum_flts (int a, flts_t x, flts_t y)
 
int __cdecl s_sum_dbls (int a, dbls_t x, dbls_t y)
 
int __cdecl s_sum_iiff (int x0, int y0, float x1, float y1)
 
int __cdecl s_sum_ifif (int x0, float y0, int x1, float y1)
 
int __cdecl s_sum_iidd (int x0, int y0, double x1, double y1)
 
int __cdecl s_sum_idid (int x0, double y0, int x1, double y1)
 
int __cdecl s_sum_ififififififif (int x0, float y0, int x1, float y1, int x2, float y2, int x3, float y3, int x4, float y4, int x5, float y5, int x6, float y6)
 
int __cdecl s_sum_ididididididid (int x0, double y0, int x1, double y1, int x2, double y2, int x3, double y3, int x4, double y4, int x5, double y5, int x6, double y6)
 
int __cdecl s_sum_idfdifdfifdfidifdidf (int x0, double y0, float z0, double y1, int x1, float z1, double y2, float z2, int x2, float z3, double y3, float z4, int x3, double y4, int x4, float z5, double y5, int x5, double y6, float z6)
 
int __cdecl s_sum_ididididididididididid (int x0, double y0, int x1, double y1, int x2, double y2, int x3, double y3, int x4, double y4, int x5, double y5, int x6, double y6, int x7, double y7, int x8, double y8)
 
int __cdecl s_sum_iidiidiidiidiidiidiidiidiidiidiid (int x0, int x1, double y0, int x2, int x3, double y1, int x4, int x5, double y2, int x6, int x7, double y3, int x8, int x9, double y4, int x10, int x11, double y5, int x12, int x13, double y6, int x14, int x15, double y7, int x16, int x17, double y8)
 
int __cdecl s_sum_iyiy (int x0, hyper y0, int x1, hyper y1)
 
void __cdecl s_square_out (int x, int *y)
 
void __cdecl s_square_ref (int *x)
 
int __cdecl s_str_length (const char *s)
 
int __cdecl s_str_t_length (str_t s)
 
int __cdecl s_cstr_length (const char *s, int n)
 
int __cdecl s_dot_self (vector_t *v)
 
double __cdecl s_square_half (double x, double *y)
 
float __cdecl s_square_half_float (float x, float *y)
 
LONG __cdecl s_square_half_long (LONG x, LONG *y)
 
int __cdecl s_sum_fixed_array (int a[5])
 
int __cdecl s_pints_sum (pints_t *pints)
 
double __cdecl s_ptypes_sum (ptypes_t *pt)
 
int __cdecl s_dot_pvectors (pvectors_t *p)
 
int __cdecl s_sum_sp (sp_t *sp)
 
double __cdecl s_square_sun (sun_t *su)
 
int __cdecl s_test_list_length (test_list_t *list)
 
int __cdecl s_sum_fixed_int_3d (int m[2][3][4])
 
int __cdecl s_sum_conf_array (int x[], int n)
 
int __cdecl s_sum_conf_ptr_by_conf_ptr (int n1, int *n2_then_x1, int *x2)
 
int __cdecl s_sum_unique_conf_array (int x[], int n)
 
int __cdecl s_sum_unique_conf_ptr (int *x, int n)
 
int __cdecl s_sum_var_array (int x[20], int n)
 
int __cdecl s_sum_complex_array (int n, refpint_t pi[])
 
int __cdecl s_sum_blob (cs_blob_t *blob)
 
int __cdecl s_sum_data (cs_data_t *data)
 
int __cdecl s_sum_container (cs_container_t *container)
 
int __cdecl s_dot_two_vectors (vector_t vs[2])
 
void __cdecl s_get_number_array (int x[20], int *n)
 
int __cdecl s_sum_cs (cs_t *cs)
 
int __cdecl s_sum_cps (cps_t *cps)
 
int __cdecl s_sum_cpsc (cpsc_t *cpsc)
 
int __cdecl s_get_cpsc (int n, cpsc_t *cpsc)
 
int __cdecl s_square_puint (puint_t p)
 
int __cdecl s_sum_puints (puints_t *p)
 
int __cdecl s_sum_cpuints (cpuints_t *p)
 
int __cdecl s_dot_copy_vectors (vector_t u, vector_t v)
 
int __cdecl s_square_test_us (test_us_t *tus)
 
double __cdecl s_square_encu (encu_t *eu)
 
double __cdecl s_square_unencu (int t, unencu_t *eu)
 
void __cdecl s_check_se2 (se_t *s)
 
int __cdecl s_sum_parr (int *a[3])
 
int __cdecl s_sum_pcarr (int *a[], int n)
 
int __cdecl s_enum_ord (e_t e)
 
double __cdecl s_square_encue (encue_t *eue)
 
int __cdecl s_sum_toplev_conf_2n (int *x, int n)
 
int __cdecl s_sum_toplev_conf_cond (int *x, int a, int b, int c)
 
double __cdecl s_sum_aligns (aligns_t *a)
 
int __cdecl s_sum_padded (padded_t *p)
 
int __cdecl s_sum_padded2 (padded_t ps[2])
 
int __cdecl s_sum_padded_conf (padded_t *ps, int n)
 
int __cdecl s_sum_bogus (bogus_t *b)
 
void __cdecl s_check_null (int *null)
 
int __cdecl s_str_struct_len (str_struct_t *s)
 
int __cdecl s_wstr_struct_len (wstr_struct_t *s)
 
int __cdecl s_sum_doub_carr (doub_carr_t *dc)
 
void __cdecl s_make_pyramid_doub_carr (unsigned char n, doub_carr_t **dc)
 
unsigned __cdecl s_hash_bstr (bstr_t b)
 
void __cdecl s_get_a_bstr (bstr_t *b)
 
void __cdecl s_get_name (name_t *name)
 
void __cdecl s_get_names (int *n, str_array_t *names)
 
void __cdecl s_get_namesw (int *n, wstr_array_t *names)
 
int __cdecl s_sum_pcarr2 (int n, int **pa)
 
int __cdecl s_sum_L1_norms (int n, vector_t *vs)
 
s123_t *__cdecl s_get_s123 (void)
 
str_t __cdecl s_get_filename (void)
 
int __cdecl s_echo_ranged_int (int i, int j, int k)
 
int __cdecl s_echo_ranged_int2 (int i)
 
void __cdecl s_get_ranged_enum (renum_t *re)
 
void __cdecl s_context_handle_test (void)
 
void __cdecl s_get_numbers (int length, int size, pints_t n[])
 
void __cdecl s_get_numbers_struct (numbers_struct_t **ns)
 
void __cdecl s_full_pointer_test (int *a, int *b)
 
void __cdecl s_full_pointer_null_test (int *a, int *b)
 
void __cdecl s_stop (void)
 
void __cdecl s_stop_autolisten (void)
 
void __cdecl s_ip_test (ipu_t *a)
 
int __cdecl s_sum_ptr_array (int *a[2])
 
int __cdecl s_sum_array_ptr (int(*a)[2])
 
ctx_handle_t __cdecl s_get_handle (void)
 
void __cdecl s_get_handle_by_ptr (ctx_handle_t *r)
 
void __cdecl s_test_handle (ctx_handle_t ctx_handle)
 
static DWORD CALLBACK test_I_RpcBindingInqLocalClientPID_thread_func (void *args)
 
void __cdecl s_test_I_RpcBindingInqLocalClientPID (unsigned int protseq, RPC_BINDING_HANDLE binding)
 
int __cdecl s_add (handle_t binding, int a, int b)
 
int __cdecl s_getNum (int a, handle_t binding)
 
void __cdecl s_Shutdown (handle_t binding)
 
void __RPC_USER ctx_handle_t_rundown (ctx_handle_t ctx_handle)
 
static void make_cmdline (char buffer[MAX_PATH], const char *test)
 
static void run_client (const char *test)
 
static void basic_tests (void)
 
static void union_tests (void)
 
static test_list_t * null_list (void)
 
static test_list_t * make_list (test_list_t *tail)
 
static void free_list (test_list_t *list)
 
ULONG __RPC_USER puint_t_UserSize (ULONG *flags, ULONG start, puint_t *p)
 
unsigned char *__RPC_USER puint_t_UserMarshal (ULONG *flags, unsigned char *buffer, puint_t *p)
 
unsigned char *__RPC_USER puint_t_UserUnmarshal (ULONG *flags, unsigned char *buffer, puint_t *p)
 
void __RPC_USER puint_t_UserFree (ULONG *flags, puint_t *p)
 
ULONG __RPC_USER us_t_UserSize (ULONG *flags, ULONG start, us_t *pus)
 
unsigned char *__RPC_USER us_t_UserMarshal (ULONG *flags, unsigned char *buffer, us_t *pus)
 
unsigned char *__RPC_USER us_t_UserUnmarshal (ULONG *flags, unsigned char *buffer, us_t *pus)
 
void __RPC_USER us_t_UserFree (ULONG *flags, us_t *pus)
 
ULONG __RPC_USER bstr_t_UserSize (ULONG *flags, ULONG start, bstr_t *b)
 
unsigned char *__RPC_USER bstr_t_UserMarshal (ULONG *flags, unsigned char *buffer, bstr_t *b)
 
unsigned char *__RPC_USER bstr_t_UserUnmarshal (ULONG *flags, unsigned char *buffer, bstr_t *b)
 
void __RPC_USER bstr_t_UserFree (ULONG *flags, bstr_t *b)
 
static void pointer_tests (void)
 
static int check_pyramid_doub_carr (doub_carr_t *dc)
 
static void free_pyramid_doub_carr (doub_carr_t *dc)
 
static void array_tests (void)
 
void __cdecl s_authinfo_test (unsigned int protseq, int secure)
 
static void test_handle_return (void)
 
static void run_tests (void)
 
static void set_auth_info (RPC_BINDING_HANDLE handle)
 
static void _test_is_server_listening (unsigned line, RPC_BINDING_HANDLE binding, RPC_STATUS expected_status)
 
static void _test_is_server_listening2 (unsigned line, RPC_BINDING_HANDLE binding, RPC_STATUS expected_status, RPC_STATUS expected_status2)
 
static void client (const char *test)
 
static void server (void)
 
static DWORD WINAPI listen_test_client_thread (void *binding)
 
static DWORD WINAPI wait_listen_proc (void *arg)
 
static void test_stop_wait_for_call (unsigned char *binding)
 
static void test_server_listening (void)
 
static HANDLE create_server_process (void)
 
static void run_server (HANDLE ready_event)
 
static DWORD WINAPI basic_tests_thread (void *arg)
 
static void test_reconnect (void)
 
static BOOL is_process_elevated (void)
 
static BOOL is_firewall_enabled (void)
 
static HRESULT set_firewall (enum firewall_op op)
 
 START_TEST (server)
 

Variables

static const charprogname
 
static const charclient_test_name
 
static BOOL old_windows_version
 
static HANDLE stop_event
 
static HANDLE stop_wait_event
 
static PROCESS_INFORMATION client_info
 
static NDR_SCONTEXT
 
static void NDR_RUNDOWN
 
static void void ULONG
 
static UUID RPC_MGR_EPV unsigned int
 
static UUID RPC_MGR_EPV unsigned unsigned RPC_IF_CALLBACK_FN *static RPC_CSTR
 
static UUID RPC_MGR_EPV unsigned unsigned RPC_IF_CALLBACK_FN *static RPC_AUTH_IDENTITY_HANDLE
 
static UUID RPC_MGR_EPV unsigned unsigned RPC_IF_CALLBACK_FN *static RPC_SECURITY_QOS *static RPC_AUTH_KEY_RETRIEVAL_FN
 
static UUID RPC_MGR_EPV unsigned unsigned RPC_IF_CALLBACK_FN *static RPC_SECURITY_QOS *static LPVOID
 
static chardomain_and_user
 
static int y
 
static chars_t x
 
static int y0
 
static int float x1
 
static int float float y1
 
static float int float int x2
 
static float int float int float y2
 
static float int float int float int x3
 
static float int float int float int float y3
 
static float int float int float int float int x4
 
static float int float int float int float int float y4
 
static float int float int float int float int float int x5
 
static float int float int float int float int float int float y5
 
static float int float int float int float int float int float int x6
 
static float int float int float int float int float int float int float y6
 
static double float z0
 
static double float double int float z1
 
static double float double int float double float z2
 
static double float double int float double float int float z3
 
static double float double int float double float int float double float z4
 
static double float double int float double float int float double float int double int float z5
 
static double float double int float double float int float double float int double int float double int double float z6
 
static double int double int double int double int double int double int double int x7
 
static double int double int double int double int double int double int double int double y7
 
static double int double int double int double int double int double int double int double int x8
 
static double int double int double int double int double int double int double int double int double y8
 
static int double int int double int int double int int double int int x9
 
static int double int int double int int double int int double int int double int x10
 
static int double int int double int int double int int double int int double int int x11
 
static int double int int double int int double int int double int int double int int double int x12
 
static int double int int double int int double int int double int int double int int double int int x13
 
static int double int int double int int double int int double int int double int int double int int double int x14
 
static int double int int double int int double int int double int int double int int double int int double int int x15
 
static int double int int double int int double int int double int int double int int double int int double int int double int x16
 
static int double int int double int int double int int double int int double int int double int int double int int double int int x17
 
static int n
 
static intn2_then_x1
 
static cpsc_t * cpsc
 
static refpint_t pi []
 
static vector_t v
 
static unencu_t * eu
 
static int a
 
static int int b
 
static int int int c
 
static doub_carr_t ** dc
 
static str_array_t * names
 
static int ** pa
 
static vector_tvs
 
static int size
 
static int pints_t pn []
 
static int j
 
static int int k
 
static int secure
 
static RPC_BINDING_HANDLE binding
 
fnprintfp_printf = printf
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file server.c.

◆ INT_CODE

#define INT_CODE   4198

Definition at line 42 of file server.c.

◆ PIPE

#define PIPE   "\\pipe\\wine_rpcrt4_test"

Definition at line 40 of file server.c.

◆ PORT

#define PORT   "4114"

Definition at line 39 of file server.c.

◆ SERVER_FUNCTIONS

#define SERVER_FUNCTIONS

Definition at line 168 of file server.c.

◆ SKIP_TYPE_DECLS

#define SKIP_TYPE_DECLS

Definition at line 30 of file server.c.

◆ test_is_server_listening

#define test_is_server_listening (   a,
  b 
)    _test_is_server_listening(__LINE__,a,b)

Definition at line 2147 of file server.c.

◆ test_is_server_listening2

#define test_is_server_listening2 (   a,
  b,
  c 
)    _test_is_server_listening2(__LINE__,a,b,c)

Definition at line 2156 of file server.c.

◆ X [1/2]

#define X (   name)    name = interp_##name;

◆ X [2/2]

#define X (   name)    name = mixed_##name;

Enumeration Type Documentation

◆ firewall_op

Enumerator
APP_ADD 
APP_REMOVE 
APP_ADD 
APP_REMOVE 
APP_ADD 
APP_REMOVE 

Definition at line 2746 of file server.c.

2747{
2748 APP_ADD,
2750};
@ APP_REMOVE
Definition: server.c:2749
@ APP_ADD
Definition: server.c:2748

Function Documentation

◆ _test_is_server_listening()

static void _test_is_server_listening ( unsigned  line,
RPC_BINDING_HANDLE  binding,
RPC_STATUS  expected_status 
)
static

Definition at line 2148 of file server.c.

2149{
2152 ok_(__FILE__,line)(status == expected_status, "RpcMgmtIsServerListening returned %lu, expected %lu\n",
2153 status, expected_status);
2154}
#define ok_(x1, x2)
Definition: atltest.h:61
static RPC_BINDING_HANDLE binding
Definition: server.c:166
RPC_STATUS WINAPI RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1704
long RPC_STATUS
Definition: rpc.h:48
Definition: parser.c:49
Definition: ps.c:97

◆ _test_is_server_listening2()

static void _test_is_server_listening2 ( unsigned  line,
RPC_BINDING_HANDLE  binding,
RPC_STATUS  expected_status,
RPC_STATUS  expected_status2 
)
static

Definition at line 2157 of file server.c.

2159{
2162 ok_(__FILE__,line)(status == expected_status || status == expected_status2,
2163 "RpcMgmtIsServerListening returned %lu, expected %lu or %lu\n",
2164 status, expected_status, expected_status2);
2165}

◆ array_tests()

static void array_tests ( void  )
static

Definition at line 1862 of file server.c.

1863{
1864 int m[2][3][4] =
1865 {
1866 {{1, 2, 3, 4}, {-1, -3, -5, -7}, {0, 2, 4, 6}},
1867 {{1, -2, 3, -4}, {2, 3, 5, 7}, {-4, -1, -14, 4114}}
1868 };
1869 int c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
1870 int c2[] = {10, 100, 200};
1871 int c3[20];
1872 vector_t vs[2] = {{1, -2, 3}, {4, -5, -6}};
1873 cps_t cps;
1874 cpsc_t cpsc;
1875 cs_blob_t blob;
1876 cs_data_t data;
1877 cs_container_t container;
1878 cs_t *cs;
1879 int n;
1880 int ca[5] = {1, -2, 3, -4, 5};
1881 int tmp[10];
1882 doub_carr_t *dc;
1883 int *pi;
1884 pints_t api[5];
1885 numbers_struct_t *ns;
1886 refpint_t rpi[5];
1887 int i0 = 1, i1 = 2, *ptr_array[2] = {&i0, &i1}, array[2] = {3, 4};
1888
1890 {
1891 const char str1[25] = "Hello";
1892 ok(cstr_length(str1, sizeof str1) == strlen(str1), "RPC cstr_length\n");
1893 }
1894
1895 ok(sum_fixed_int_3d(m) == 4116, "RPC sum_fixed_int_3d\n");
1896
1897 ok(sum_conf_array(c, 10) == 45, "RPC sum_conf_array\n");
1898 ok(sum_conf_array(&c[5], 2) == 11, "RPC sum_conf_array\n");
1899 ok(sum_conf_array(&c[7], 1) == 7, "RPC sum_conf_array\n");
1900 ok(sum_conf_array(&c[2], 0) == 0, "RPC sum_conf_array\n");
1901
1902 ok(sum_conf_ptr_by_conf_ptr(1, c2, c) == 45, "RPC sum_conf_ptr_by_conf_ptr\n");
1903 ok(sum_conf_ptr_by_conf_ptr(3, c2, c) == 345, "RPC sum_conf_ptr_by_conf_ptr\n");
1904 c2[0] = 0;
1905 ok(sum_conf_ptr_by_conf_ptr(3, c2, c) == 300, "RPC sum_conf_ptr_by_conf_ptr\n");
1906
1907 ok(sum_unique_conf_array(ca, 4) == -2, "RPC sum_unique_conf_array\n");
1908 ok(sum_unique_conf_ptr(ca, 5) == 3, "RPC sum_unique_conf_array\n");
1909 ok(sum_unique_conf_ptr(NULL, 10) == 0, "RPC sum_unique_conf_array\n");
1910
1911 get_number_array(c3, &n);
1912 ok(n == 10, "RPC get_num_array\n");
1913 for (; n > 0; n--)
1914 ok(c3[n-1] == c[n-1], "get_num_array returned wrong value %d @ %d\n",
1915 c3[n-1], n);
1916 ok(sum_var_array(c, 10) == 45, "RPC sum_conf_array\n");
1917 ok(sum_var_array(&c[5], 2) == 11, "RPC sum_conf_array\n");
1918 ok(sum_var_array(&c[7], 1) == 7, "RPC sum_conf_array\n");
1919 ok(sum_var_array(&c[2], 0) == 0, "RPC sum_conf_array\n");
1920
1921 ok(dot_two_vectors(vs) == -4, "RPC dot_two_vectors\n");
1922 cs = malloc(FIELD_OFFSET(cs_t, ca[5]));
1923 cs->n = 5;
1924 cs->ca[0] = 3;
1925 cs->ca[1] = 5;
1926 cs->ca[2] = -2;
1927 cs->ca[3] = -1;
1928 cs->ca[4] = -4;
1929 ok(sum_cs(cs) == 1, "RPC sum_cs\n");
1930 free(cs);
1931
1932 n = 5;
1933 cps.pn = &n;
1934 cps.ca1 = &c[2];
1935 cps.n = 3;
1936 cps.ca2 = &c[3];
1937 ok(sum_cps(&cps) == 53, "RPC sum_cps\n");
1938
1939 cpsc.a = 4;
1940 cpsc.b = 5;
1941 cpsc.c = 1;
1942 cpsc.ca = c;
1943 ok(sum_cpsc(&cpsc) == 6, "RPC sum_cpsc\n");
1944 cpsc.a = 4;
1945 cpsc.b = 5;
1946 cpsc.c = 0;
1947 cpsc.ca = c;
1948 ok(sum_cpsc(&cpsc) == 10, "RPC sum_cpsc\n");
1949
1950 cpsc.ca = NULL;
1951 ok(get_cpsc(5, &cpsc) == 45, "RPC sum_cpsc\n");
1952 ok( cpsc.a == 10, "RPC get_cpsc %u\n", cpsc.a );
1953 for (n = 0; n < 10; n++) ok( cpsc.ca[n] == n, "RPC get_cpsc[%d] = %d\n", n, cpsc.ca[n] );
1954
1955 memset( tmp, 0x33, sizeof(tmp) );
1956 cpsc.ca = tmp;
1957 ok(get_cpsc(4, &cpsc) == 28, "RPC sum_cpsc\n");
1958 ok( cpsc.a == 8, "RPC get_cpsc %u\n", cpsc.a );
1959 ok( cpsc.ca == tmp, "RPC get_cpsc %p/%p\n", cpsc.ca, tmp );
1960 for (n = 0; n < 8; n++) ok( cpsc.ca[n] == n, "RPC get_cpsc[%d] = %d\n", n, cpsc.ca[n] );
1961
1962 ok(sum_toplev_conf_2n(c, 3) == 15, "RPC sum_toplev_conf_2n\n");
1963 ok(sum_toplev_conf_cond(c, 5, 6, 1) == 10, "RPC sum_toplev_conf_cond\n");
1964 ok(sum_toplev_conf_cond(c, 5, 6, 0) == 15, "RPC sum_toplev_conf_cond\n");
1965
1966 dc = malloc(FIELD_OFFSET(doub_carr_t, a[2]));
1967 dc->n = 2;
1968 dc->a[0] = malloc(sizeof(doub_carr_1_t) + 3);
1969 dc->a[0]->n = 3;
1970 dc->a[0]->a[0] = 5;
1971 dc->a[0]->a[1] = 1;
1972 dc->a[0]->a[2] = 8;
1973 dc->a[1] = malloc(sizeof(doub_carr_1_t) + 2);
1974 dc->a[1]->n = 2;
1975 dc->a[1]->a[0] = 2;
1976 dc->a[1]->a[1] = 3;
1977 ok(sum_doub_carr(dc) == 19, "RPC sum_doub_carr\n");
1978 free(dc->a[0]);
1979 free(dc->a[1]);
1980 free(dc);
1981
1982 dc = NULL;
1983 make_pyramid_doub_carr(4, &dc);
1984 ok(check_pyramid_doub_carr(dc), "RPC make_pyramid_doub_carr\n");
1986
1987 ok(sum_L1_norms(2, vs) == 21, "RPC sum_L1_norms\n");
1988
1989 memset(api, 0, sizeof(api));
1990 pi = malloc(sizeof(*pi));
1991 *pi = -1;
1992 api[0].pi = pi;
1993 get_numbers(1, 1, api);
1994 ok(api[0].pi == pi, "RPC conformant varying array [out] pointer changed from %p to %p\n", pi, api[0].pi);
1995 ok(*api[0].pi == 0, "pi unmarshalled incorrectly %d\n", *api[0].pi);
1996
1998 {
1999 ns = calloc(1, FIELD_OFFSET(numbers_struct_t, numbers[5]));
2000 ns->length = 5;
2001 ns->size = 5;
2002 ns->numbers[0].pi = pi;
2003 get_numbers_struct(&ns);
2004 ok(ns->numbers[0].pi == pi, "RPC conformant varying struct embedded pointer changed from %p to %p\n", pi, ns->numbers[0].pi);
2005 ok(*ns->numbers[0].pi == 5, "pi unmarshalled incorrectly %d\n", *ns->numbers[0].pi);
2006 free(ns);
2007 }
2008 free(pi);
2009
2010 pi = malloc(5 * sizeof(*pi));
2011 pi[0] = 3; rpi[0] = &pi[0];
2012 pi[1] = 5; rpi[1] = &pi[1];
2013 pi[2] = -2; rpi[2] = &pi[2];
2014 pi[3] = -1; rpi[3] = &pi[3];
2015 pi[4] = -4; rpi[4] = &pi[4];
2016 ok(sum_complex_array(5, rpi) == 1, "RPC sum_complex_array\n");
2017 free(pi);
2018
2019 ok(sum_ptr_array(ptr_array) == 3, "RPC sum_ptr_array\n");
2020 ok(sum_array_ptr(&array) == 7, "RPC sum_array_ptr\n");
2021
2022 blob.n = ARRAY_SIZE(c);
2023 blob.ca = c;
2024 n = sum_blob(&blob);
2025 ok(n == 45, "RPC sum_blob = %d\n", n);
2026
2027 data.blob.n = ARRAY_SIZE(c);
2028 data.blob.ca = c;
2029 n = sum_data(&data);
2030 ok(n == 45, "RPC sum_data = %d\n", n);
2031
2032 container.data.blob.n = ARRAY_SIZE(c);
2033 container.data.blob.ca = c;
2034 n = sum_container(&container);
2035 ok(n == 45, "RPC sum_container = %d\n", n);
2036}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ok(value,...)
Definition: atltest.h:57
#define ARRAY_SIZE(A)
Definition: main.h:20
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
static const WCHAR ca[]
Definition: main.c:457
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
const GLfloat * m
Definition: glext.h:10848
#define cs
Definition: i386-dis.c:442
static doub_carr_t ** dc
Definition: server.c:139
static cpsc_t * cpsc
Definition: server.c:111
static int n
Definition: server.c:88
static void free_pyramid_doub_carr(doub_carr_t *dc)
Definition: server.c:1853
static BOOL old_windows_version
Definition: server.c:45
static vector_t * vs
Definition: server.c:146
static int int int c
Definition: server.c:128
static refpint_t pi[]
Definition: server.c:112
static int check_pyramid_doub_carr(doub_carr_t *dc)
Definition: server.c:1842
api
Definition: notification.c:38
#define calloc
Definition: rosglue.h:14
#define memset(x, y, z)
Definition: compat.h:39
Definition: image.c:134
Definition: mxnamespace.c:45
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by run_tests().

◆ basic_tests()

static void basic_tests ( void  )
static

Definition at line 1343 of file server.c.

1344{
1345 char string[] = "I am a string";
1346 WCHAR wstring[] = L"I am a wstring";
1347 int f[5] = {1, 3, 0, -2, -4};
1348 vector_t a = {1, 3, 7};
1349 vector_t vec1 = {4, -2, 1}, vec2 = {-5, 2, 3}, *pvec2 = &vec2;
1350 pvectors_t pvecs = {&vec1, &pvec2};
1351 sp_inner_t spi = {42};
1352 sp_t sp = {-13, &spi};
1353 aligns_t aligns;
1354 pints_t pints;
1355 ptypes_t ptypes;
1356 padded_t padded;
1357 padded_t padded2[2];
1358 bogus_t bogus;
1359 int i1, i2, i3, *pi2, *pi3, **ppi3;
1360 double u, v;
1361 float s, t;
1362 LONG q, r;
1363 short h;
1364 char c;
1365 int x;
1366 hyper y;
1367 str_struct_t ss = {string};
1368 wstr_struct_t ws = {wstring};
1369 str_t str;
1370 se_t se;
1371 renum_t re;
1372 chars_t cs1 = { 2, 4, 6, 8, 10 }, cs2 = { -1, -2, -3, -4, -5 };
1373 ints_t is1 = { 2, 4 }, is2 = { 5, 8 };
1374 flts_t fs1 = { 3, 5.5 }, fs2 = { 8, 2.3 };
1375 dbls_t ds1 = { 9, -2.5 }, ds2 = { 2, -4.2 };
1376
1377 ok(int_return() == INT_CODE, "RPC int_return\n");
1378
1379 ok(square(7) == 49, "RPC square\n");
1380 x = sum(23, -4);
1381 ok(x == 19, "RPC sum got %d\n", x);
1382 c = sum_char(-23, 50);
1383 ok(c == 27, "RPC sum_char got %d\n", (int)c);
1384 h = sum_short(1122, -344);
1385 ok(h == 778, "RPC sum_short got %d\n", (int)h);
1386 x = sum_float(123.45, -32.2);
1387 ok(x == 91, "RPC sum_float got %d\n", x);
1388 x = sum_double_int(-78, 148.46);
1389 ok(x == 70, "RPC sum_double_int got %d\n", x);
1390 y = sum_hyper((hyper)0x12345678 << 16, (hyper)0x33557799 << 16);
1391 ok(y == (hyper)0x4589ce11 << 16, "RPC hyper got %s\n", wine_dbgstr_longlong(y));
1392 x = sum_hyper_int((hyper)0x24242424 << 16, -((hyper)0x24241212 << 16));
1393 ok(x == 0x12120000, "RPC hyper_int got 0x%x\n", x);
1394 x = sum_char_hyper( 12, ((hyper)0x42424242 << 32) | 0x33334444 );
1395 ok(x == 0x33334450, "RPC char_hyper got 0x%x\n", x);
1396 x = sum_chars( 4, cs1, cs2 );
1397 ok(x == 60, "got %d\n", x);
1398 x = sum_ints( 2, is1, is2 );
1399 ok(x == 38, "got %d\n", x);
1400 x = sum_flts( 3, fs1, fs2 );
1401 ok(x == 56, "got %d\n", x);
1402 x = sum_dbls( 7, ds1, ds2 );
1403 ok(x == 30, "got %d\n", x);
1404 x = sum_iiff( 12, 23, 3.4, 4.7 );
1405 ok(x == 43, "got %d\n", x);
1406 x = sum_ifif( 12, 11.2, 23, 34.5 );
1407 ok(x == 80, "got %d\n", x);
1408 x = sum_iidd( 6, 5, 4.3, 2.1 );
1409 ok(x == 17, "got %d\n", x);
1410 x = sum_idid( 55, 44.55, 33, 22.44 );
1411 ok(x == 154, "got %d\n", x);
1412 x = sum_ififififififif( 1, 2.1, 3, 4.2, 5, 6.3, 7, 8.4, 9, 10.5, 11, 12.2, 13, 14.9 );
1413 ok(x == 107, "got %d\n", x);
1414 x = sum_ididididididid( -1, -2.1, -3, -4, -5, -6.7, -8, -9.1, -11, -12.3, -13, -14.2, -15, -16.3 );
1415 ok(x == -120, "got %d\n", x);
1416 x = sum_idfdifdfifdfidifdidf( 2, 1.2, 2.1, 2.3, 4, 3.2, 4.5, 5.5, -3, -2.2, -4.4, -5.5, 6, 6.4, -3, 8.1, 9.2, 7, -10.3, 12.4 );
1417 ok(x == 45, "got %d\n", x);
1418 x = sum_ididididididididididid( 2, 3, 4, 5, 6, 7, 8, 9, -1, -2, -3, -4, -5, -6, -7, -8, -9, 5 );
1419 ok(x == 4, "got %d\n", x);
1420 x = sum_iidiidiidiidiidiidiidiidiidiidiid( 11, 22, 33.1, 44, 55, 66.1, 77, 88, 99.1, 111, 222, 333.1, 444,
1421 555, 666.1, 777, 888, 999.1, 1, 2, 3.1, 4, 5, 6.1, 7, 8, 9.1 );
1422 ok(x == 5535, "got %d\n", x);
1423 x = sum_iyiy( 1, 1234567890, 2, -1234567800 );
1424 ok(x == 93, "got %d\n", x);
1425
1426 x = 0;
1427 square_out(11, &x);
1428 ok(x == 121, "RPC square_out\n");
1429
1430 x = 5;
1431 square_ref(&x);
1432 ok(x == 25, "RPC square_ref\n");
1433
1434 ok(str_length(string) == strlen(string), "RPC str_length\n");
1435 ok(str_t_length(string) == strlen(string), "RPC str_length\n");
1436 ok(dot_self(&a) == 59, "RPC dot_self\n");
1437
1438 ok(str_struct_len(&ss) == lstrlenA(string), "RPC str_struct_len\n");
1439 ok(wstr_struct_len(&ws) == lstrlenW(wstring), "RPC str_struct_len\n");
1440
1441 v = 0.0;
1442 u = square_half(3.0, &v);
1443 ok(u == 9.0, "RPC square_half\n");
1444 ok(v == 1.5, "RPC square_half\n");
1445
1446 t = 0.0f;
1447 s = square_half_float(3.0f, &t);
1448 ok(s == 9.0f, "RPC square_half_float\n");
1449 ok(t == 1.5f, "RPC square_half_float\n");
1450
1451 r = 0;
1452 q = square_half_long(3, &r);
1453 ok(q == 9, "RPC square_half_long\n");
1454 ok(r == 1, "RPC square_half_long\n");
1455
1456 i1 = 19;
1457 i2 = -3;
1458 i3 = -29;
1459 pi2 = &i2;
1460 pi3 = &i3;
1461 ppi3 = &pi3;
1462 pints.pi = &i1;
1463 pints.ppi = &pi2;
1464 pints.pppi = &ppi3;
1465 ok(pints_sum(&pints) == -13, "RPC pints_sum\n");
1466
1467 c = 10;
1468 h = 3;
1469 q = 14;
1470 s = -5.0f;
1471 u = 11.0;
1472 ptypes.pc = &c;
1473 ptypes.ps = &h;
1474 ptypes.pl = &q;
1475 ptypes.pf = &s;
1476 ptypes.pd = &u;
1477 ok(ptypes_sum(&ptypes) == 33.0, "RPC ptypes_sum\n");
1478
1479 ok(dot_pvectors(&pvecs) == -21, "RPC dot_pvectors\n");
1480 ok(dot_copy_vectors(vec1, vec2) == -21, "RPC dot_copy_vectors\n");
1481 ok(sum_fixed_array(f) == -2, "RPC sum_fixed_array\n");
1482 ok(sum_sp(&sp) == 29, "RPC sum_sp\n");
1483
1484 ok(enum_ord(E1) == 1, "RPC enum_ord\n");
1485 ok(enum_ord(E2) == 2, "RPC enum_ord\n");
1486 ok(enum_ord(E3) == 3, "RPC enum_ord\n");
1487 ok(enum_ord(E4) == 4, "RPC enum_ord\n");
1488
1489 se.f = E2;
1490 check_se2(&se);
1491
1492 memset(&aligns, 0, sizeof(aligns));
1493 aligns.c = 3;
1494 aligns.i = 4;
1495 aligns.s = 5;
1496 aligns.d = 6.0;
1497 ok(sum_aligns(&aligns) == 18.0, "RPC sum_aligns\n");
1498
1499 padded.i = -3;
1500 padded.c = 8;
1501 ok(sum_padded(&padded) == 5, "RPC sum_padded\n");
1502 padded2[0].i = -5;
1503 padded2[0].c = 1;
1504 padded2[1].i = 3;
1505 padded2[1].c = 7;
1506 ok(sum_padded2(padded2) == 6, "RPC sum_padded2\n");
1507 padded2[0].i = -5;
1508 padded2[0].c = 1;
1509 padded2[1].i = 3;
1510 padded2[1].c = 7;
1511 ok(sum_padded_conf(padded2, 2) == 6, "RPC sum_padded_conf\n");
1512
1513 i1 = 14;
1514 i2 = -7;
1515 i3 = -4;
1516 bogus.h.p1 = &i1;
1517 bogus.p2 = &i2;
1518 bogus.p3 = &i3;
1519 bogus.c = 9;
1520 ok(sum_bogus(&bogus) == 12, "RPC sum_bogus\n");
1521
1522 check_null(NULL);
1523
1524 str = get_filename();
1525 ok(!strcmp(str, __FILE__), "get_filename() returned %s instead of %s\n", str, __FILE__);
1527
1528 x = echo_ranged_int(0,0,0);
1529 ok(x == 0, "echo_ranged_int() returned %d instead of 0\n", x);
1530 x = echo_ranged_int(10,20,100);
1531 ok(x == 100, "echo_ranged_int() returned %d instead of 100\n", x);
1532 x = echo_ranged_int2(40);
1533 ok(x == 40, "echo_ranged_int() returned %d instead of 40\n", x);
1534
1536 {
1537 re = 0xdeadbeef;
1538 get_ranged_enum(&re);
1539 ok(re == RE3 ||
1540 broken(re == MAKELONG(re, 0xdead)), /* Win 8, Win 10 */
1541 "get_ranged_enum() returned %x instead of RE3\n", re);
1542 }
1543}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define broken(x)
Definition: atltest.h:178
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
#define lstrlenW
Definition: compat.h:750
static const WCHAR * get_filename(const WCHAR *name, const WCHAR *endptr)
Definition: module.c:70
#define L(x)
Definition: resources.c:13
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat f
Definition: glext.h:7540
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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 * u
Definition: glfuncs.h:240
#define ss
Definition: i386-dis.c:441
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static const WCHAR sp[]
Definition: suminfo.c:287
#define INT_CODE
Definition: server.c:42
static vector_t v
Definition: server.c:119
static int y
Definition: server.c:62
static str_t(__cdecl *get_filename)(void)
static chars_t x
Definition: server.c:71
long LONG
Definition: pedump.c:60
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
const WCHAR * str
INT64 hyper
Definition: rpcndr.h:77
#define midl_user_free
Definition: rpc.h:41
const char * ws
Definition: skip_ws.cpp:7
__crt_unique_heap_ptr< wchar_t > const wstring(_malloc_crt_t(wchar_t, maxsize))
#define MAKELONG(a, b)
Definition: typedefs.h:249
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by basic_tests_thread(), run_tests(), and test_reconnect().

◆ basic_tests_thread()

static DWORD WINAPI basic_tests_thread ( void arg)
static

Definition at line 2644 of file server.c.

2645{
2646 basic_tests();
2647 return 0;
2648}
static void basic_tests(void)
Definition: server.c:1343

Referenced by test_reconnect().

◆ bstr_t_UserFree()

void __RPC_USER bstr_t_UserFree ( ULONG flags,
bstr_t b 
)

Definition at line 1719 of file server.c.

1720{
1721 free(&((*b)[-1]));
1722}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

◆ bstr_t_UserMarshal()

unsigned char *__RPC_USER bstr_t_UserMarshal ( ULONG flags,
unsigned char buffer,
bstr_t b 
)

Definition at line 1699 of file server.c.

1700{
1701 wire_bstr_t wb = (wire_bstr_t) buffer;
1702 wb->n = (*b)[-1];
1703 memcpy(&wb->data, *b, wb->n * sizeof wb->data[0]);
1704 return buffer + FIELD_OFFSET(user_bstr_t, data[wb->n]);
1705}
GLuint buffer
Definition: glext.h:5915
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

◆ bstr_t_UserSize()

ULONG __RPC_USER bstr_t_UserSize ( ULONG flags,
ULONG  start,
bstr_t b 
)

Definition at line 1693 of file server.c.

1694{
1695 return start + FIELD_OFFSET(user_bstr_t, data[(*b)[-1]]);
1696}
GLuint start
Definition: gl.h:1545

◆ bstr_t_UserUnmarshal()

unsigned char *__RPC_USER bstr_t_UserUnmarshal ( ULONG flags,
unsigned char buffer,
bstr_t b 
)

Definition at line 1708 of file server.c.

1709{
1710 wire_bstr_t wb = (wire_bstr_t) buffer;
1711 short *data = malloc((wb->n + 1) * sizeof *data);
1712 data[0] = wb->n;
1713 memcpy(&data[1], wb->data, wb->n * sizeof data[1]);
1714 *b = &data[1];
1715 return buffer + FIELD_OFFSET(user_bstr_t, data[wb->n]);
1716}

◆ char()

static signed char ( __cdecl sum_char)
static

◆ check_pyramid_doub_carr()

static int check_pyramid_doub_carr ( doub_carr_t *  dc)
static

Definition at line 1842 of file server.c.

1843{
1844 int i, j;
1845 for (i = 0; i < dc->n; ++i)
1846 for (j = 0; j < dc->a[i]->n; ++j)
1847 if (dc->a[i]->a[j] != j + 1)
1848 return FALSE;
1849 return TRUE;
1850}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
static int j
Definition: server.c:151

Referenced by array_tests().

◆ client()

static void client ( const char test)
static

Definition at line 2168 of file server.c.

2169{
2170 static unsigned char iptcp[] = "ncacn_ip_tcp";
2171 static unsigned char np[] = "ncacn_np";
2172 static unsigned char ncalrpc[] = "ncalrpc";
2173 static unsigned char address[] = "127.0.0.1";
2174 static unsigned char address_np[] = "\\\\.";
2175 static unsigned char port[] = PORT;
2176 static unsigned char pipe[] = PIPE;
2177 static unsigned char guid[] = "00000000-4114-0704-2301-000000000000";
2178 static unsigned char explicit_handle_guid[] = "00000000-4114-0704-2301-000000000002";
2179
2180 unsigned char *binding;
2181
2182 if (strcmp(test, "tcp_basic") == 0)
2183 {
2184 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
2185 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2186
2187 run_tests();
2188 authinfo_test(RPC_PROTSEQ_TCP, 0);
2189 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_TCP, IMixedServer_IfHandle);
2191
2192 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2193 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2194 }
2195 else if (strcmp(test, "tcp_secure") == 0)
2196 {
2197 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
2198 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2199
2200 set_auth_info(IMixedServer_IfHandle);
2201 authinfo_test(RPC_PROTSEQ_TCP, 1);
2202 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_TCP, IMixedServer_IfHandle);
2203 test_is_server_listening(IMixedServer_IfHandle, RPC_S_ACCESS_DENIED);
2204
2205 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2206 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2207 }
2208 else if (strcmp(test, "ncalrpc_basic") == 0)
2209 {
2210 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
2211 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2212
2213 run_tests(); /* can cause RPC_X_BAD_STUB_DATA exception */
2214 authinfo_test(RPC_PROTSEQ_LRPC, 0);
2215 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_LRPC, IMixedServer_IfHandle);
2216 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2217
2218 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2219 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2220 }
2221 else if (strcmp(test, "ncalrpc_autolisten") == 0)
2222 {
2223 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
2224 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2225
2226 run_tests();
2227 authinfo_test(RPC_PROTSEQ_LRPC, 0);
2228 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_LRPC, IMixedServer_IfHandle);
2229 todo_wine
2230 test_is_server_listening(IMixedServer_IfHandle, RPC_S_NOT_LISTENING);
2231
2232 stop_autolisten();
2233 ok(int_return() == INT_CODE, "RPC int_return\n");
2234
2235 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2236 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2237 }
2238 else if (strcmp(test, "ncalrpc_secure") == 0)
2239 {
2240 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
2241 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2242
2243 set_auth_info(IMixedServer_IfHandle);
2244 authinfo_test(RPC_PROTSEQ_LRPC, 1);
2245 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_LRPC, IMixedServer_IfHandle);
2246 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2247
2248 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2249 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2250 }
2251 else if (strcmp(test, "np_basic") == 0)
2252 {
2253 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
2254 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2255
2256 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2257 run_tests();
2258 authinfo_test(RPC_PROTSEQ_NMP, 0);
2259 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_NMP, IMixedServer_IfHandle);
2260 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2261 stop();
2262 test_is_server_listening(IMixedServer_IfHandle, RPC_S_NOT_LISTENING);
2263
2264 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2265 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2266 }
2267 else if (strcmp(test, "np_basic_interp") == 0)
2268 {
2270
2271 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
2272 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IInterpServer_IfHandle), "RpcBindingFromStringBinding\n");
2273
2274 test_is_server_listening(IInterpServer_IfHandle, RPC_S_OK);
2275 run_tests();
2276 authinfo_test(RPC_PROTSEQ_NMP, 0);
2277 test_I_RpcBindingInqLocalClientPID(RPC_PROTSEQ_NMP, IInterpServer_IfHandle);
2278 test_is_server_listening(IInterpServer_IfHandle, RPC_S_OK);
2279
2280 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2281 ok(RPC_S_OK == RpcBindingFree(&IInterpServer_IfHandle), "RpcBindingFree\n");
2282 }
2283 else if (strcmp(test, "explicit_handle") == 0)
2284 {
2285 IMixedServer_IfHandle = NULL;
2286 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, explicit_handle_guid, NULL, &binding), "RpcStringBindingCompose\n");
2287 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2288
2289 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2290
2291 ok(add(IMixedServer_IfHandle, 2, 3) == 5, "RPC add\n");
2292 ok(getNum(7, IMixedServer_IfHandle) == 9, "RPC getNum\n");
2293 Shutdown(IMixedServer_IfHandle);
2294
2295 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2296 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2297 }
2298}
GUID guid
Definition: version.c:147
USHORT port
Definition: uri.c:228
GLuint address
Definition: glext.h:9393
#define todo_wine
Definition: minitest.h:80
static void set_interp_interface(void)
Definition: server.c:280
#define PORT
Definition: server.c:39
#define PIPE
Definition: server.c:40
#define test_is_server_listening2(a, b, c)
Definition: server.c:2156
static void run_tests(void)
Definition: server.c:2121
#define test_is_server_listening(a, b)
Definition: server.c:2147
static void set_auth_info(RPC_BINDING_HANDLE handle)
Definition: server.c:2132
__forceinline bool __cdecl add(big_integer &x, uint32_t const value)
#define test
Definition: rosglue.h:37
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769
RPC_STATUS WINAPI RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:440
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:822
#define RPC_PROTSEQ_NMP
Definition: rpcdce.h:126
#define RPC_PROTSEQ_TCP
Definition: rpcdce.h:125
#define RPC_PROTSEQ_LRPC
Definition: rpcdce.h:127
#define RPC_S_OK
Definition: rpcnterr.h:22
#define RPC_S_ACCESS_DENIED
Definition: rpcnterr.h:29
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:164
@ Shutdown
Definition: sacdrv.h:267
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1382

◆ create_server_process()

static HANDLE create_server_process ( void  )
static

Definition at line 2585 of file server.c.

2586{
2587 SECURITY_ATTRIBUTES sec_attr = { sizeof(sec_attr), NULL, TRUE };
2588 HANDLE ready_event;
2589 char cmdline[MAX_PATH];
2592 DWORD ret;
2593
2594 memset(&startup, 0, sizeof startup);
2595 startup.cb = sizeof startup;
2596
2597 ready_event = CreateEventW(&sec_attr, TRUE, FALSE, NULL);
2598 ok(ready_event != NULL, "CreateEvent failed: %lu\n", GetLastError());
2599
2600 sprintf(cmdline, "%s server run %Ix", progname, (UINT_PTR)ready_event);
2601 trace("running server process...\n");
2602 ok(CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n");
2603 ret = WaitForSingleObject(ready_event, 10000);
2604 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2605
2606 ok(CloseHandle(info.hThread), "CloseHandle\n");
2607 ok(CloseHandle(ready_event), "CloseHandle\n");
2608 return info.hProcess;
2609}
static void startup(void)
#define trace
Definition: atltest.h:70
#define CloseHandle
Definition: compat.h:739
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4749
return ret
Definition: mutex.c:146
unsigned long DWORD
Definition: ntddk_ex.h:95
#define sprintf
Definition: sprintf.c:45
static const char * progname
Definition: server.c:44
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
TCHAR * cmdline
Definition: stretchblt.cpp:32
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:383

Referenced by test_reconnect().

◆ ctx_handle_t()

static ctx_handle_t ( __cdecl get_handle)
static

◆ ctx_handle_t_rundown()

void __RPC_USER ctx_handle_t_rundown ( ctx_handle_t  ctx_handle)

Definition at line 1314 of file server.c.

1315{
1316 ok(ctx_handle == (ctx_handle_t)0xdeadbeef, "Unexpected ctx_handle %p\n", ctx_handle);
1317}
static ctx_handle_t(__cdecl *get_handle)(void)

◆ double()

static double ( __cdecl square_half)
static

◆ float()

static float ( __cdecl square_half_float)
static

Referenced by __string_to_float(), alpha_test_arbfp(), AVISplitter_ProcessStreamList(), basetype_arg_size(), calc_wheel_change(), color_to_float(), ComplexMarshall(), ComplexUnmarshall(), conv_s16_to_f32(), convert_fixed_to_float(), d3drm_viewport2_Init(), d3dx9_sprite_Flush(), d3dx_set_shader_const_state(), D3DXCreateTextW(), dct64_altivec(), ddraw_surface_blt_clipped(), BtrfsRecv::do_recv(), DoLoadImageFile(), DrawBackgroundPreview(), EDIT_BuildLineDefs_ML(), EmbeddedComplexSize(), empty_image(), emptyImage3D(), extract1010102(), extract1555rev(), extract2101010rev(), extract233rev(), extract332(), extract4444(), extract4444rev(), extract5551(), extract565(), extract565rev(), extract8888(), extract8888rev(), fb_copy_to_texture_direct(), float_16_to_32(), float_24_to_32(), for(), format_size(), format_to_vec4(), fromfixedpoint(), audio_membuffer::fseconds_recorded(), audio_membuffer::fseconds_total(), get_flexible_vertex_size(), gl_Accum(), gl_clear_accum_buffer(), gluCylinder(), gluPartialDisk(), halve1Dimage_int(), halve1DimagePackedPixel(), halveImage_int(), halveImagePackedPixel(), halveImagePackedPixel3D(), halveImagePackedPixelSlice(), InitGL(), InitializeImage(), isInRefBlackWhiteRange(), linear_vari_process(), LISTBOX_HandleMouseWheel(), hashtable< _Val, _Key, _HF, _Traits, _ExK, _EqK, _All >::load_factor(), metafile_get_pen_brush_data_offset(), METAFILE_PlaybackObject(), modff(), NdrBaseTypeMemorySize(), normalize(), number_from_string(), number_with_units(), audio_resampler_acm::open(), pack_strided_data(), CAppScrnshotPreview::PaintOnDC(), parse_new_id3(), process_comment(), process_extra(), __crt_stdio_input::input_processor< Character, InputAdapter >::process_floating_point_specifier(), process_vertices_strided(), BtrfsScrub::RefreshScrubDlg(), render(), CWineTest::RunTest(), audio_format::samples_in_seconds(), scale_internal(), scale_internal_byte(), scale_internal_float(), scale_internal_int(), scale_internal_short(), scale_internal_ubyte(), scale_internal_uint(), scale_internal_ushort(), scaleInternal3D(), scaleInternalPackedPixel(), ScreenSaverProc(), ScriptCPtoX(), ScriptXtoCP(), BtrfsPropSheet::set_size_on_disk(), shader_arb_ps_local_constants(), shader_arb_vs_local_constants(), shader_glsl_load_constants(), sinc_mono_vari_process(), src_int_to_float_array(), src_short_to_float_array(), START_TEST(), state_alpha_test(), state_depthbias(), synth_1to1_altivec(), synth_1to1_fltst_altivec(), synth_1to1_real_altivec(), synth_1to1_s32_altivec(), synth_1to1_s32_stereo_altivec(), synth_1to1_stereo_altivec(), test_buffer(), test_buffer8(), test_compute_normals(), test_createtext(), test_D3DXFillTexture(), test_EnumForms(), Test_exceptions(), test_propertybag_write(), test_ScCountProps(), test_UlPropSize(), texture2d_get_blt_info(), texture_init(), TIFFCIELabToRGBInit(), TIFFCIELabToXYZ(), TIFFDefaultRefBlackWhite(), TIFFReadDirEntryFloat(), TIFFReadDirEntryFloatArray(), __crt_stdio_input::to_floating_point_length(), UlPropSize(), units_to_twips(), update_filter(), update_preview_sizes(), BtrfsScrub::UpdateTextBox(), VarFix(), VARIANT_DataSize(), VarInt(), VMR9_SurfaceAllocator_UpdateDeviceReset(), wave_generate_la(), wglUseFontOutlines_common(), wine_glFogi(), wine_glFogiv(), wined3d_clip_blit(), wined3d_device_set_light(), wined3d_shader_set_local_constants_float(), wmain(), and xsltParseStylesheetTemplate().

◆ free_list()

static void free_list ( test_list_t *  list)
static

Definition at line 1624 of file server.c.

1625{
1626 if (list->t == TL_LIST)
1627 free_list(list->u.tail);
1628 free(list);
1629}
Definition: list.h:37
static void free_list(test_list_t *list)
Definition: server.c:1624
#define TL_LIST

Referenced by free_list(), and pointer_tests().

◆ free_pyramid_doub_carr()

static void free_pyramid_doub_carr ( doub_carr_t *  dc)
static

Definition at line 1853 of file server.c.

1854{
1855 int i;
1856 for (i = 0; i < dc->n; ++i)
1857 MIDL_user_free(dc->a[i]);
1859}
void __RPC_USER MIDL_user_free(void __RPC_FAR *ptr)
Definition: dhcpcsvc.c:30

Referenced by array_tests().

◆ get_s123()

static s123_t *__cdecl * get_s123 ( void  )
static

Referenced by pointer_tests().

◆ hyper()

static hyper ( __cdecl sum_hyper)
static

◆ InitFunctionPointers()

static void InitFunctionPointers ( void  )
static

Definition at line 294 of file server.c.

295{
296 HMODULE hrpcrt4 = GetModuleHandleA("rpcrt4.dll");
297
298 pNDRSContextMarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextMarshall2");
299 pNDRSContextUnmarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextUnmarshall2");
300 pRpcServerRegisterIfEx = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterIfEx");
301 pRpcBindingSetAuthInfoExA = (void *)GetProcAddress(hrpcrt4, "RpcBindingSetAuthInfoExA");
302 pRpcServerRegisterAuthInfoA = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterAuthInfoA");
303
304 if (!pNDRSContextMarshall2) old_windows_version = TRUE;
305}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812

Referenced by START_TEST().

◆ int()

static int ( __cdecl int_return)
static

◆ is_firewall_enabled()

static BOOL is_firewall_enabled ( void  )
static

Definition at line 2713 of file server.c.

2714{
2715 HRESULT hr, init;
2716 INetFwMgr *mgr = NULL;
2719 VARIANT_BOOL enabled = VARIANT_FALSE;
2720
2722
2723 hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
2724 (void **)&mgr );
2725 ok( hr == S_OK, "got %08lx\n", hr );
2726 if (hr != S_OK) goto done;
2727
2728 hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
2729 ok( hr == S_OK, "got %08lx\n", hr );
2730 if (hr != S_OK) goto done;
2731
2732 hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
2733 if (hr != S_OK) goto done;
2734
2735 hr = INetFwProfile_get_FirewallEnabled( profile, &enabled );
2736 ok( hr == S_OK, "got %08lx\n", hr );
2737
2738done:
2739 if (policy) INetFwPolicy_Release( policy );
2740 if (profile) INetFwProfile_Release( profile );
2741 if (mgr) INetFwMgr_Release( mgr );
2742 if (SUCCEEDED( init )) CoUninitialize();
2743 return (enabled == VARIANT_TRUE);
2744}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:73
short VARIANT_BOOL
Definition: compat.h:2290
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define profile
Definition: kernel32.h:12
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
HRESULT hr
Definition: shlfolder.c:183
static int init
Definition: wintirpc.c:33

Referenced by START_TEST().

◆ is_process_elevated()

static BOOL is_process_elevated ( void  )
static

Definition at line 2697 of file server.c.

2698{
2699 HANDLE token;
2701 {
2703 DWORD size;
2704 BOOL ret;
2705
2707 CloseHandle( token );
2708 return (ret && type == TokenElevationTypeFull);
2709 }
2710 return FALSE;
2711}
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define GetCurrentProcess()
Definition: compat.h:759
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
static int size
Definition: server.c:148
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeFull
Definition: winnt_old.h:2700
#define TOKEN_QUERY
Definition: setypes.h:940
@ TokenElevationType
Definition: setypes.h:995

Referenced by START_TEST().

◆ listen_test_client_thread()

static DWORD WINAPI listen_test_client_thread ( void binding)
static

Definition at line 2456 of file server.c.

2457{
2459
2460 status = RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle);
2461 ok(status == RPC_S_OK, "RpcBindingFromStringBinding\n");
2462
2463 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2464 stop();
2465 trace("stopped\n");
2466
2467 status = RpcBindingFree(&IMixedServer_IfHandle);
2468 ok(status == RPC_S_OK, "RpcBindingFree\n");
2469 return 0;
2470}

Referenced by test_stop_wait_for_call().

◆ LONG()

static LONG ( __cdecl square_half_long)
static

◆ make_cmdline()

static void make_cmdline ( char  buffer[MAX_PATH],
const char test 
)
static

Definition at line 1320 of file server.c.

1321{
1322 sprintf(buffer, "%s server %s", progname, test);
1323}

Referenced by run_client().

◆ make_list()

static test_list_t * make_list ( test_list_t *  tail)
static

Definition at line 1615 of file server.c.

1616{
1617 test_list_t *n = malloc(sizeof *n);
1618 n->t = TL_LIST;
1619 n->u.tail = tail;
1620 return n;
1621}
struct outqueuenode * tail
Definition: adnsresfilter.c:66

Referenced by pointer_tests().

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  n)

Definition at line 308 of file server.c.

309{
310 return malloc(n);
311}

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR p)

Definition at line 314 of file server.c.

315{
316 free(p);
317}
GLfloat GLfloat p
Definition: glext.h:8902

◆ NDR_SCONTEXT()

static NDR_SCONTEXT ( WINAPI pNDRSContextUnmarshall2)
static

◆ null_list()

static test_list_t * null_list ( void  )
static

Definition at line 1606 of file server.c.

1607{
1608 test_list_t *n = malloc(sizeof *n);
1609 n->t = TL_NULL;
1610 n->u.x = 0;
1611 return n;
1612}
#define TL_NULL

Referenced by pointer_tests().

◆ pointer_tests()

static void pointer_tests ( void  )
static

Definition at line 1725 of file server.c.

1726{
1727 int a[] = {1, 2, 3, 4};
1728 char p1[] = "11";
1729 test_list_t *list = make_list(make_list(make_list(null_list())));
1730 test_us_t tus = {{p1}};
1731 int *pa[4];
1732 puints_t pus;
1733 cpuints_t cpus;
1734 short bstr_data[] = { 5, 'H', 'e', 'l', 'l', 'o' };
1735 bstr_t bstr = &bstr_data[1], bstr2;
1736 name_t name;
1737 void *buffer;
1738 int *pa2;
1739 s123_t *s123;
1740 int val = 42;
1741
1742 ok(test_list_length(list) == 3, "RPC test_list_length\n");
1743 ok(square_puint(p1) == 121, "RPC square_puint\n");
1744 pus.n = 4;
1745 pus.ps = malloc(pus.n * sizeof pus.ps[0]);
1746 pus.ps[0] = strdup("5");
1747 pus.ps[1] = strdup("6");
1748 pus.ps[2] = strdup("7");
1749 pus.ps[3] = strdup("8");
1750 ok(sum_puints(&pus) == 26, "RPC sum_puints\n");
1751 free(pus.ps[0]);
1752 free(pus.ps[1]);
1753 free(pus.ps[2]);
1754 free(pus.ps[3]);
1755 free(pus.ps);
1756 cpus.n = 4;
1757 cpus.ps = malloc(cpus.n * sizeof cpus.ps[0]);
1758 cpus.ps[0] = strdup("5");
1759 cpus.ps[1] = strdup("6");
1760 cpus.ps[2] = strdup("7");
1761 cpus.ps[3] = strdup("8");
1762 ok(sum_cpuints(&cpus) == 26, "RPC sum_puints\n");
1763 free(cpus.ps[0]);
1764 free(cpus.ps[1]);
1765 free(cpus.ps[2]);
1766 free(cpus.ps[3]);
1767 free(cpus.ps);
1768 ok(square_test_us(&tus) == 121, "RPC square_test_us\n");
1769
1770 pa[0] = &a[0];
1771 pa[1] = &a[1];
1772 pa[2] = &a[2];
1773 ok(sum_parr(pa) == 6, "RPC sum_parr\n");
1774
1775 pa[0] = &a[0];
1776 pa[1] = &a[1];
1777 pa[2] = &a[2];
1778 pa[3] = &a[3];
1779 ok(sum_pcarr(pa, 4) == 10, "RPC sum_pcarr\n");
1780
1781 ok(hash_bstr(bstr) == s_hash_bstr(bstr), "RPC hash_bstr_data\n");
1782
1783 get_a_bstr(&bstr);
1784 s_get_a_bstr(&bstr2);
1785 ok(!lstrcmpW((LPCWSTR)bstr, (LPCWSTR)bstr2), "bstr mismatch\n");
1786 free(bstr - 1);
1787 free(bstr2 - 1);
1788
1789 free_list(list);
1790
1792 {
1793 int n;
1794 str_array_t names;
1795 wstr_array_t namesw;
1796
1797 name.size = 10;
1798 name.name = buffer = calloc(1, name.size);
1799 get_name(&name);
1800 ok(name.name == buffer, "[in,out] pointer should have stayed as %p but instead changed to %p\n", name.name, buffer);
1801 ok(!strcmp(name.name, "Jeremy Wh"), "name didn't unmarshall properly, expected \"Jeremy Wh\", but got \"%s\"\n", name.name);
1802 free(name.name);
1803
1804 n = -1;
1805 names = NULL;
1806 get_names(&n, &names);
1807 ok(n == 2, "expected 2, got %d\n", n);
1809 ok(!strcmp(names[0], "Hello"), "expected Hello, got %s\n", names[0]);
1811 ok(!strcmp(names[1], "World!"), "expected World!, got %s\n", names[1]);
1815
1816 n = -1;
1817 namesw = NULL;
1818 get_namesw(&n, &namesw);
1819 ok(n == 2, "expected 2, got %d\n", n);
1821 ok(!lstrcmpW(namesw[0], L"Hello"), "expected Hello, got %s\n", wine_dbgstr_w(namesw[0]));
1823 ok(!lstrcmpW(namesw[1], L"World!"), "expected World!, got %s\n", wine_dbgstr_w(namesw[1]));
1824 MIDL_user_free(namesw[0]);
1825 MIDL_user_free(namesw[1]);
1826 MIDL_user_free(namesw);
1827 }
1828
1829 pa2 = a;
1831 ok(sum_pcarr2(4, &pa2) == 10, "RPC sum_pcarr2\n");
1832
1833 s123 = get_s123();
1834 ok(s123->f1 == 1 && s123->f2 == 2 && s123->f3 == 3, "RPC get_s123\n");
1835 MIDL_user_free(s123);
1836
1837 full_pointer_test(&val, &val);
1838 full_pointer_null_test(&val, NULL);
1839}
int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
Definition: util.c:55
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4246
GLuint GLuint * names
Definition: glext.h:11545
GLuint GLfloat * val
Definition: glext.h:7180
#define wine_dbgstr_w
Definition: kernel32.h:34
#define ros_skip_flaky
Definition: minitest.h:84
void __cdecl s_get_a_bstr(bstr_t *b)
Definition: server.c:884
static str_array_t * names
Definition: server.c:143
static test_list_t * null_list(void)
Definition: server.c:1606
static s123_t *__cdecl * get_s123(void)
static int a
Definition: server.c:128
static int ** pa
Definition: server.c:145
static test_list_t * make_list(test_list_t *tail)
Definition: server.c:1615
unsigned __cdecl s_hash_bstr(bstr_t b)
Definition: server.c:873
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
Definition: oleaut.c:84
Definition: name.c:39
WCHAR * name
Definition: name.c:42
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by run_tests().

◆ puint_t_UserFree()

void __RPC_USER puint_t_UserFree ( ULONG flags,
puint_t *  p 
)

Definition at line 1656 of file server.c.

1657{
1658 free(*p);
1659}

◆ puint_t_UserMarshal()

unsigned char *__RPC_USER puint_t_UserMarshal ( ULONG flags,
unsigned char buffer,
puint_t *  p 
)

Definition at line 1638 of file server.c.

1639{
1640 int n = atoi(*p);
1641 memcpy(buffer, &n, sizeof n);
1642 return buffer + sizeof n;
1643}
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)

◆ puint_t_UserSize()

ULONG __RPC_USER puint_t_UserSize ( ULONG flags,
ULONG  start,
puint_t *  p 
)

Definition at line 1632 of file server.c.

1633{
1634 return start + sizeof(int);
1635}
static UUID RPC_MGR_EPV unsigned int
Definition: server.c:52

◆ puint_t_UserUnmarshal()

unsigned char *__RPC_USER puint_t_UserUnmarshal ( ULONG flags,
unsigned char buffer,
puint_t *  p 
)

Definition at line 1646 of file server.c.

1647{
1648 int n;
1649 memcpy(&n, buffer, sizeof n);
1650 *p = malloc(10);
1651 sprintf(*p, "%d", n);
1652 return buffer + sizeof n;
1653}

◆ rint_t()

static rint_t ( __cdecl echo_ranged_int)
static

◆ RPC_STATUS()

static RPC_STATUS ( WINAPI pRpcServerRegisterIfEx)
static

◆ run_client()

static void run_client ( const char test)
static

Definition at line 1326 of file server.c.

1327{
1328 char cmdline[MAX_PATH];
1330
1331 memset(&startup, 0, sizeof startup);
1332 startup.cb = sizeof startup;
1333
1336 ok(CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &client_info), "CreateProcess\n");
1338 ok(CloseHandle(client_info.hProcess), "CloseHandle\n");
1339 ok(CloseHandle(client_info.hThread), "CloseHandle\n");
1340}
static const char * client_test_name
Definition: server.c:44
static void make_cmdline(char buffer[MAX_PATH], const char *test)
Definition: server.c:1320
#define wait_child_process
Definition: test.h:177

Referenced by server(), and START_TEST().

◆ run_server()

static void run_server ( HANDLE  ready_event)
static

Definition at line 2611 of file server.c.

2612{
2613 static unsigned char np[] = "ncacn_np";
2614 static unsigned char pipe[] = PIPE "term_test";
2616 BOOL ret;
2617
2618 status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
2619 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", status);
2620
2621 status = RpcServerRegisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, NULL);
2622 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status);
2623
2626 ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status);
2627
2629 ok(stop_event != NULL, "CreateEvent failed with error %ld\n", GetLastError());
2630
2631 ret = SetEvent(ready_event);
2632 ok(ret, "SetEvent failed: %lu\n", GetLastError());
2633
2635 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2636
2638 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status);
2639
2641 stop_event = NULL;
2642}
static HANDLE stop_event
Definition: server.c:47
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
RPC_STATUS WINAPI RpcMgmtWaitServerListen(void)
Definition: rpc_server.c:1539
RPC_STATUS WINAPI RpcServerUseProtseqEpA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:910
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
_Must_inspect_result_ _In_ WDFUSBPIPE PIPE
Definition: wdfusb.h:2237

Referenced by START_TEST().

◆ run_tests()

static void run_tests ( void  )
static

Definition at line 2121 of file server.c.

2122{
2123 basic_tests();
2124 union_tests();
2125 pointer_tests();
2126 array_tests();
2127 context_handle_test();
2129}
static void test_handle_return(void)
Definition: server.c:2110
static void pointer_tests(void)
Definition: server.c:1725
static void array_tests(void)
Definition: server.c:1862
static void union_tests(void)
Definition: server.c:1546

Referenced by client().

◆ s_add()

int __cdecl s_add ( handle_t  binding,
int  a,
int  b 
)

Definition at line 1290 of file server.c.

1291{
1292 ok(binding != NULL, "explicit handle is NULL\n");
1293 return a + b;
1294}
static int int b
Definition: server.c:128

◆ s_authinfo_test()

void __cdecl s_authinfo_test ( unsigned int  protseq,
int  secure 
)

Definition at line 2038 of file server.c.

2039{
2042 ULONG level, authnsvc;
2043 RPC_AUTHZ_HANDLE privs;
2044 unsigned char *principal;
2045
2047 ok(binding != NULL, "I_RpcGetCurrentCallHandle returned NULL\n");
2048
2049 level = authnsvc = 0xdeadbeef;
2050 privs = (RPC_AUTHZ_HANDLE)0xdeadbeef;
2051 principal = (unsigned char *)0xdeadbeef;
2052
2053 if (secure || protseq == RPC_PROTSEQ_LRPC)
2054 {
2055 status = RpcBindingInqAuthClientA(binding, &privs, &principal, &level, &authnsvc, NULL);
2057 {
2058 win_skip("RpcBindingInqAuthClientA not supported\n");
2059 return;
2060 }
2061 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
2062 ok(privs != (RPC_AUTHZ_HANDLE)0xdeadbeef, "privs unchanged\n");
2063 ok(principal != (unsigned char *)0xdeadbeef, "principal unchanged\n");
2064 if (protseq != RPC_PROTSEQ_LRPC)
2065 {
2066 todo_wine
2067 ok(principal != NULL, "NULL principal\n");
2068 }
2069 if (protseq == RPC_PROTSEQ_LRPC && principal)
2070 {
2071 int len;
2072 char *spn;
2073
2074 len = WideCharToMultiByte(CP_ACP, 0, (const WCHAR *)privs, -1, NULL, 0, NULL, NULL);
2075 spn = malloc(len);
2076 WideCharToMultiByte(CP_ACP, 0, (const WCHAR *)privs, -1, spn, len, NULL, NULL);
2077
2078 ok(!strcmp(domain_and_user, spn), "expected %s got %s\n", domain_and_user, spn);
2079 free(spn);
2080 }
2081 ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "level unchanged\n");
2082 ok(authnsvc == RPC_C_AUTHN_WINNT, "authnsvc unchanged\n");
2083 RpcStringFreeA(&principal);
2084
2085 status = RpcBindingInqAuthClientA(NULL, &privs, &principal, &level, &authnsvc, NULL);
2086 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
2087 RpcStringFreeA(&principal);
2088
2089 status = RpcBindingInqAuthClientExA(NULL, &privs, &principal, &level, &authnsvc, NULL, 0);
2090 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
2091 RpcStringFreeA(&principal);
2092
2094 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
2096 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
2097
2098 }
2099 else
2100 {
2101 status = RpcBindingInqAuthClientA(binding, &privs, &principal, &level, &authnsvc, NULL);
2102 ok(status == RPC_S_BINDING_HAS_NO_AUTH, "expected RPC_S_BINDING_HAS_NO_AUTH got %lu\n", status);
2103 ok(privs == (RPC_AUTHZ_HANDLE)0xdeadbeef, "got %p\n", privs);
2104 ok(principal == (unsigned char *)0xdeadbeef, "got %s\n", principal);
2105 ok(level == 0xdeadbeef, "got %lu\n", level);
2106 ok(authnsvc == 0xdeadbeef, "got %lu\n", authnsvc);
2107 }
2108}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
GLint level
Definition: gl.h:1546
GLenum GLsizei len
Definition: glext.h:6722
#define win_skip
Definition: minitest.h:67
static char * domain_and_user
Definition: server.c:58
static int secure
Definition: server.c:157
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1445
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
Definition: rpc_binding.c:1578
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1038
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc)
Definition: rpc_binding.c:1554
RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle(void)
Definition: rpc_server.c:1743
void * RPC_AUTHZ_HANDLE
Definition: rpcdce.h:48
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
Definition: rpcdce.h:151
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
uint32_t ULONG
Definition: typedefs.h:59
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1411
#define RPC_S_CANNOT_SUPPORT
Definition: winerror.h:1429

◆ s_check_null()

void __cdecl s_check_null ( int null)

Definition at line 831 of file server.c.

832{
833 ok(!null, "RPC check_null\n");
834}
int null(void)
Definition: ftp.c:1794

◆ s_check_se2()

void __cdecl s_check_se2 ( se_t *  s)

Definition at line 741 of file server.c.

742{
743 ok(s->f == E2, "check_se2\n");
744}

◆ s_context_handle_test()

void __cdecl s_context_handle_test ( void  )

Definition at line 975 of file server.c.

976{
980 unsigned char buf[20];
981 static RPC_SERVER_INTERFACE server_if =
982 {
983 sizeof(RPC_SERVER_INTERFACE),
984 {{0x00000000,0x4114,0x0704,{0x23,0x01,0x00,0x00,0x00,0x00,0x00,0x00}},{1,0}},
985 {{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
986 NULL,
987 0,
988 0,
989 0,
990 0,
991 0,
992 };
993
995 ok(binding != NULL, "I_RpcGetCurrentCallHandle returned NULL\n");
996
997 if (!pNDRSContextMarshall2 || !pNDRSContextUnmarshall2)
998 {
999 win_skip("NDRSContextMarshall2 or NDRSContextUnmarshall2 not exported from rpcrt4.dll\n");
1000 return;
1001 }
1002
1003 h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
1004 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
1005
1006 /* marshal a context handle with NULL userContext */
1007 memset(buf, 0xcc, sizeof(buf));
1008 pNDRSContextMarshall2(binding, h, buf, NULL, NULL, 0);
1009 ok(*(ULONG *)buf == 0, "attributes should have been set to 0 instead of 0x%lx\n", *(ULONG *)buf);
1010 ok(UuidIsNil((UUID *)&buf[4], &status), "uuid should have been nil\n");
1011
1012 h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
1013 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
1014
1015 /* marshal a context handle with non-NULL userContext */
1016 memset(buf, 0xcc, sizeof(buf));
1017 h->userContext = (void *)0xdeadbeef;
1018 pNDRSContextMarshall2(binding, h, buf, NULL, NULL, 0);
1019 ok(*(ULONG *)buf == 0, "attributes should have been set to 0 instead of 0x%lx\n", *(ULONG *)buf);
1020 ok(!UuidIsNil((UUID *)&buf[4], &status), "uuid should not have been nil\n");
1021
1022 /* raises ERROR_INVALID_HANDLE exception on Vista upwards */
1023 if (0)
1024 {
1025 h = pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
1026 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
1027 ok(h->userContext == (void *)0xdeadbeef, "userContext of interface didn't unmarshal properly: %p\n", h->userContext);
1028
1029 /* marshal a context handle with an interface specified */
1030 h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, &server_if.InterfaceId, 0);
1031 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
1032
1033 memset(buf, 0xcc, sizeof(buf));
1034 h->userContext = (void *)0xcafebabe;
1035 pNDRSContextMarshall2(binding, h, buf, NULL, &server_if.InterfaceId, 0);
1036 ok(*(ULONG *)buf == 0, "attributes should have been set to 0 instead of 0x%lx\n", *(ULONG *)buf);
1037 ok(!UuidIsNil((UUID *)&buf[4], &status), "uuid should not have been nil\n");
1038
1039 h = pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if.InterfaceId, 0);
1040 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
1041 ok(h->userContext == (void *)0xcafebabe, "userContext of interface didn't unmarshal properly: %p\n", h->userContext);
1042 }
1043
1044 /* test same interface data, but different pointer */
1045 /* raises ERROR_INVALID_HANDLE exception */
1046 if (0)
1047 {
1048 RPC_SERVER_INTERFACE server_if_clone = server_if;
1049
1050 pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if_clone.InterfaceId, 0);
1051 }
1052
1053 /* test different interface data, but different pointer */
1054 /* raises ERROR_INVALID_HANDLE exception */
1055 if (0)
1056 {
1057 static RPC_SERVER_INTERFACE server_if2 =
1058 {
1059 sizeof(RPC_SERVER_INTERFACE),
1060 {{0x00000000,0x4114,0x0704,{0x23,0x01,0x00,0x00,0x00,0x00,0x00,0x00}},{1,0}},
1061 {{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
1062 NULL,
1063 0,
1064 0,
1065 0,
1066 0,
1067 0,
1068 };
1069 pNDRSContextMarshall2(binding, h, buf, NULL, &server_if.InterfaceId, 0);
1070
1071 pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if2.InterfaceId, 0);
1072 }
1073
1074 binding = NULL;
1076
1077 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
1078 ok(binding != NULL, "binding is NULL\n");
1079
1080 if (status == RPC_S_OK && binding != NULL)
1081 {
1082 unsigned char* string_binding = NULL;
1083 unsigned char* object_uuid = NULL;
1084 unsigned char* protseq = NULL;
1085 unsigned char* network_address = NULL;
1086 unsigned char* endpoint = NULL;
1087 unsigned char* network_options = NULL;
1088
1089 status = RpcBindingToStringBindingA(binding, &string_binding);
1090 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
1091 ok(string_binding != NULL, "string_binding is NULL\n");
1092
1093 status = RpcStringBindingParseA(string_binding, &object_uuid, &protseq, &network_address, &endpoint, &network_options);
1094 ok(status == RPC_S_OK, "expected RPC_S_OK got %lu\n", status);
1095 ok(protseq != NULL && *protseq != '\0', "protseq is %s\n", protseq);
1096 ok(network_address != NULL && *network_address != '\0', "network_address is %s\n", network_address);
1097
1098 todo_wine
1099 {
1100 ok(object_uuid != NULL && *object_uuid == '\0', "object_uuid is %s\n", object_uuid);
1101 ok(endpoint != NULL && *endpoint == '\0', "endpoint is %s\n", endpoint);
1102 ok(network_options != NULL && *network_options == '\0', "network_options is %s\n", network_options);
1103 }
1104
1105 RpcStringFreeA(&string_binding);
1106 RpcStringFreeA(&object_uuid);
1107 RpcStringFreeA(&protseq);
1108 RpcStringFreeA(&network_address);
1110 RpcStringFreeA(&network_options);
1112 }
1113}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingServerFromClient(RPC_BINDING_HANDLE ClientBinding, RPC_BINDING_HANDLE *ServerBinding)
Definition: rpc_binding.c:1628
RPC_STATUS WINAPI RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR *Options)
Definition: rpc_binding.c:547
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:902
struct _RPC_SERVER_INTERFACE RPC_SERVER_INTERFACE
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:68
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:293
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:104
Definition: nis.h:10

◆ s_cstr_length()

int __cdecl s_cstr_length ( const char s,
int  n 
)

Definition at line 459 of file server.c.

460{
461 int len = 0;
462 while (0 < n-- && *s++)
463 ++len;
464 return len;
465}

◆ s_dot_copy_vectors()

int __cdecl s_dot_copy_vectors ( vector_t  u,
vector_t  v 
)

Definition at line 708 of file server.c.

709{
710 return u.x * v.x + u.y * v.y + u.z * v.z;
711}

◆ s_dot_pvectors()

int __cdecl s_dot_pvectors ( pvectors_t *  p)

Definition at line 505 of file server.c.

506{
507 return p->pu->x * (*p->pv)->x + p->pu->y * (*p->pv)->y + p->pu->z * (*p->pv)->z;
508}
GLdouble GLdouble z
Definition: glext.h:5874

◆ s_dot_self()

int __cdecl s_dot_self ( vector_t v)

Definition at line 467 of file server.c.

468{
469 return s_square(v->x) + s_square(v->y) + s_square(v->z);
470}
int __cdecl s_square(int x)
Definition: server.c:324

◆ s_dot_two_vectors()

int __cdecl s_dot_two_vectors ( vector_t  vs[2])

Definition at line 631 of file server.c.

632{
633 return vs[0].x * vs[1].x + vs[0].y * vs[1].y + vs[0].z * vs[1].z;
634}

◆ s_echo_ranged_int()

int __cdecl s_echo_ranged_int ( int  i,
int  j,
int  k 
)

Definition at line 960 of file server.c.

961{
962 return min( 100, i + j + k );
963}
static int int k
Definition: server.c:151
#define min(a, b)
Definition: monoChain.cc:55

◆ s_echo_ranged_int2()

int __cdecl s_echo_ranged_int2 ( int  i)

Definition at line 965 of file server.c.

966{
967 return i;
968}

◆ s_enum_ord()

int __cdecl s_enum_ord ( e_t  e)

Definition at line 759 of file server.c.

760{
761 switch (e)
762 {
763 case E1: return 1;
764 case E2: return 2;
765 case E3: return 3;
766 case E4: return 4;
767 default:
768 return 0;
769 }
770}
#define e
Definition: ke_i.h:82

◆ s_full_pointer_null_test()

void __cdecl s_full_pointer_null_test ( int a,
int b 
)

Definition at line 1151 of file server.c.

1152{
1153 ok(*a == 42, "Expected *a to be 42 instead of %d\n", *a);
1154 ok(b == NULL, "Expected b to be NULL instead of %p\n", b);
1155}

◆ s_full_pointer_test()

void __cdecl s_full_pointer_test ( int a,
int b 
)

Definition at line 1144 of file server.c.

1145{
1146 ok(*a == 42, "Expected *a to be 42 instead of %d\n", *a);
1147 ok(*b == 42, "Expected *b to be 42 instead of %d\n", *a);
1148 ok(a == b, "Expected a (%p) to point to the same memory as b (%p)\n", a, b);
1149}

◆ s_get_a_bstr()

void __cdecl s_get_a_bstr ( bstr_t b)

Definition at line 884 of file server.c.

885{
886 bstr_t bstr;
887 short str[] = {5, 'W', 'i', 'n', 'e', 0};
888 bstr = malloc(sizeof(str));
889 memcpy(bstr, str, sizeof(str));
890 *b = bstr + 1;
891}

Referenced by pointer_tests().

◆ s_get_cpsc()

int __cdecl s_get_cpsc ( int  n,
cpsc_t *  cpsc 
)

Definition at line 671 of file server.c.

672{
673 int i, ret;
674
675 cpsc->a = 2 * n;
676 cpsc->b = 2;
677 cpsc->c = 1;
678 cpsc->ca = MIDL_user_allocate( cpsc->a * sizeof(int) );
679 for (i = ret = 0; i < cpsc->a; i++) cpsc->ca[i] = i;
680 for (i = ret = 0; i < cpsc->a; i++) ret += cpsc->ca[i];
681 return ret;
682}
void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T len)
Definition: dhcpcsvc.c:25
#define for
Definition: utility.h:88

◆ s_get_filename()

str_t __cdecl s_get_filename ( void  )

Definition at line 953 of file server.c.

954{
955 void *ptr = MIDL_user_allocate(strlen(__FILE__) + 1);
956 strcpy(ptr, __FILE__);
957 return (char *)ptr;
958}
static PVOID ptr
Definition: dispmode.c:27
strcpy
Definition: string.h:131

◆ s_get_handle()

ctx_handle_t __cdecl s_get_handle ( void  )

Definition at line 1200 of file server.c.

1201{
1202 return (ctx_handle_t)0xdeadbeef;
1203}

◆ s_get_handle_by_ptr()

void __cdecl s_get_handle_by_ptr ( ctx_handle_t r)

Definition at line 1205 of file server.c.

1206{
1207 *r = (ctx_handle_t)0xdeadbeef;
1208}

◆ s_get_name()

void __cdecl s_get_name ( name_t *  name)

Definition at line 893 of file server.c.

894{
895 const char bossman[] = "Jeremy White";
896 memcpy(name->name, bossman, min(name->size, sizeof(bossman)));
897 /* ensure nul-termination */
898 if (name->size < sizeof(bossman))
899 name->name[name->size - 1] = 0;
900}

◆ s_get_names()

void __cdecl s_get_names ( int n,
str_array_t *  names 
)

Definition at line 902 of file server.c.

903{
904 str_array_t list;
905
906 list = MIDL_user_allocate(2 * sizeof(list[0]));
907 list[0] = MIDL_user_allocate(6);
908 strcpy(list[0], "Hello");
909 list[1] = MIDL_user_allocate(7);
910 strcpy(list[1], "World!");
911
912 *names = list;
913 *n = 2;
914}
#define list
Definition: rosglue.h:35

◆ s_get_namesw()

void __cdecl s_get_namesw ( int n,
wstr_array_t *  names 
)

Definition at line 916 of file server.c.

917{
918 wstr_array_t list;
919
920 list = MIDL_user_allocate(2 * sizeof(list[0]));
921 list[0] = MIDL_user_allocate(sizeof(L"Hello"));
922 lstrcpyW(list[0], L"Hello");
923 list[1] = MIDL_user_allocate(sizeof(L"World!"));
924 lstrcpyW(list[1], L"World!");
925
926 *names = list;
927 *n = 2;
928}
#define lstrcpyW
Definition: compat.h:749

◆ s_get_number_array()

void __cdecl s_get_number_array ( int  x[20],
int n 
)

Definition at line 636 of file server.c.

637{
638 int c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
639 memcpy(x, c, sizeof(c));
640 *n = ARRAY_SIZE(c);
641}

◆ s_get_numbers()

void __cdecl s_get_numbers ( int  length,
int  size,
pints_t  n[] 
)

Definition at line 1115 of file server.c.

1116{
1117 int i;
1118 for (i = 0; i < length; i++)
1119 {
1120 n[i].pi = midl_user_allocate(sizeof(*n[i].pi));
1121 *n[i].pi = i;
1122 n[i].ppi = NULL;
1123 n[i].pppi = NULL;
1124 }
1125}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define midl_user_allocate
Definition: rpc.h:40

◆ s_get_numbers_struct()

void __cdecl s_get_numbers_struct ( numbers_struct_t **  ns)

Definition at line 1127 of file server.c.

1128{
1129 int i;
1130 *ns = midl_user_allocate(FIELD_OFFSET(numbers_struct_t, numbers[5]));
1131 if (!*ns) return;
1132 (*ns)->length = 5;
1133 (*ns)->size = 5;
1134 for (i = 0; i < (*ns)->length; i++)
1135 {
1136 (*ns)->numbers[i].pi = NULL;
1137 (*ns)->numbers[i].ppi = NULL;
1138 (*ns)->numbers[i].pppi = NULL;
1139 }
1140 (*ns)->numbers[0].pi = midl_user_allocate(sizeof(*(*ns)->numbers[i].pi));
1141 *(*ns)->numbers[0].pi = 5;
1142}

◆ s_get_ranged_enum()

void __cdecl s_get_ranged_enum ( renum_t *  re)

Definition at line 970 of file server.c.

971{
972 *re = RE3;
973}

◆ s_get_s123()

s123_t *__cdecl s_get_s123 ( void  )

Definition at line 944 of file server.c.

945{
946 s123_t *s = MIDL_user_allocate(sizeof *s);
947 s->f1 = 1;
948 s->f2 = 2;
949 s->f3 = 3;
950 return s;
951}

◆ s_getNum()

int __cdecl s_getNum ( int  a,
handle_t  binding 
)

Definition at line 1296 of file server.c.

1297{
1298 ok(binding != NULL, "explicit handle is NULL\n");
1299 return a + 2;
1300}

◆ s_hash_bstr()

unsigned __cdecl s_hash_bstr ( bstr_t  b)

Definition at line 873 of file server.c.

874{
875 short n = b[-1];
876 short *s = b;
877 unsigned hash = 0;
878 short i;
879 for (i = 0; i < n; ++i)
880 hash = 5 * hash + (unsigned) s[i];
881 return hash;
882}
Definition: _hash_fun.h:40

Referenced by pointer_tests().

◆ s_int_return()

int __cdecl s_int_return ( void  )

Definition at line 319 of file server.c.

320{
321 return INT_CODE;
322}

◆ s_ip_test()

void __cdecl s_ip_test ( ipu_t *  a)

Definition at line 1181 of file server.c.

1182{
1183 STATSTG st;
1184 HRESULT hr;
1185
1186 hr = IStream_Stat(a->tagged_union.stream, &st, STATFLAG_NONAME);
1187 ok(hr == S_OK, "got %#lx\n", hr);
1188}

◆ s_make_pyramid_doub_carr()

void __cdecl s_make_pyramid_doub_carr ( unsigned char  n,
doub_carr_t **  dc 
)

Definition at line 856 of file server.c.

857{
858 doub_carr_t *t;
859 int i, j;
860 t = MIDL_user_allocate(FIELD_OFFSET(doub_carr_t, a[n]));
861 t->n = n;
862 for (i = 0; i < n; ++i)
863 {
864 int v = i + 1;
865 t->a[i] = MIDL_user_allocate(FIELD_OFFSET(doub_carr_1_t, a[v]));
866 t->a[i]->n = v;
867 for (j = 0; j < v; ++j)
868 t->a[i]->a[j] = j + 1;
869 }
870 *dc = t;
871}

◆ s_pints_sum()

int __cdecl s_pints_sum ( pints_t *  pints)

Definition at line 495 of file server.c.

496{
497 return *pints->pi + **pints->ppi + ***pints->pppi;
498}

◆ s_ptypes_sum()

double __cdecl s_ptypes_sum ( ptypes_t *  pt)

Definition at line 500 of file server.c.

501{
502 return *pt->pc + *pt->ps + *pt->pl + *pt->pf + *pt->pd;
503}
#define pt(x, y)
Definition: drawing.c:79

◆ s_Shutdown()

void __cdecl s_Shutdown ( handle_t  binding)

Definition at line 1302 of file server.c.

1303{
1305 ULONG pid = 0;
1306 ok(binding != NULL, "explicit handle is NULL\n");
1307
1309 ok(status == RPC_S_OK, "Got unexpected %ld.\n", status);
1310 ok(pid == client_info.dwProcessId, "Got unexpected pid: %ld client pid: %ld.\n", pid, client_info.dwProcessId);
1311 ok(SetEvent(stop_event), "SetEvent\n");
1312}
RPC_STATUS WINAPI I_RpcBindingInqLocalClientPID(RPC_BINDING_HANDLE ClientBinding, ULONG *ClientPID)
Definition: rpc_binding.c:1969
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837

◆ s_square()

int __cdecl s_square ( int  x)

Definition at line 324 of file server.c.

325{
326 return x * x;
327}

Referenced by s_dot_self(), s_square_out(), and s_square_ref().

◆ s_square_encu()

double __cdecl s_square_encu ( encu_t *  eu)

Definition at line 719 of file server.c.

720{
721 switch (eu->t)
722 {
723 case ENCU_I: return eu->tagged_union.i * eu->tagged_union.i;
724 case ENCU_F: return eu->tagged_union.f * eu->tagged_union.f;
725 default:
726 return 0.0;
727 }
728}
static unencu_t * eu
Definition: server.c:121
#define ENCU_F
#define ENCU_I

◆ s_square_encue()

double __cdecl s_square_encue ( encue_t *  eue)

Definition at line 772 of file server.c.

773{
774 switch (eue->t)
775 {
776 case E1: return eue->tagged_union.i1 * eue->tagged_union.i1;
777 case E2: return eue->tagged_union.f2 * eue->tagged_union.f2;
778 default:
779 return 0.0;
780 }
781}

◆ s_square_half()

double __cdecl s_square_half ( double  x,
double y 
)

Definition at line 472 of file server.c.

473{
474 *y = x / 2.0;
475 return x * x;
476}

◆ s_square_half_float()

float __cdecl s_square_half_float ( float  x,
float y 
)

Definition at line 478 of file server.c.

479{
480 *y = x / 2.0f;
481 return x * x;
482}

◆ s_square_half_long()

LONG __cdecl s_square_half_long ( LONG  x,
LONG y 
)

Definition at line 484 of file server.c.

485{
486 *y = x / 2;
487 return x * x;
488}

◆ s_square_out()

void __cdecl s_square_out ( int  x,
int y 
)

Definition at line 439 of file server.c.

440{
441 *y = s_square(x);
442}

◆ s_square_puint()

int __cdecl s_square_puint ( puint_t  p)

Definition at line 684 of file server.c.

685{
686 int n = atoi(p);
687 return n * n;
688}

◆ s_square_ref()

void __cdecl s_square_ref ( int x)

Definition at line 444 of file server.c.

445{
446 *x = s_square(*x);
447}

◆ s_square_sun()

double __cdecl s_square_sun ( sun_t *  su)

Definition at line 515 of file server.c.

516{
517 switch (su->s)
518 {
519 case SUN_I: return su->u.i * su->u.i;
520 case SUN_F1:
521 case SUN_F2: return su->u.f * su->u.f;
522 case SUN_PI: return (*su->u.pi) * (*su->u.pi);
523 default:
524 return 0.0;
525 }
526}
#define SUN_I
#define SUN_PI
#define SUN_F2
#define SUN_F1

◆ s_square_test_us()

int __cdecl s_square_test_us ( test_us_t *  tus)

Definition at line 713 of file server.c.

714{
715 int n = atoi(tus->us.x);
716 return n * n;
717}

◆ s_square_unencu()

double __cdecl s_square_unencu ( int  t,
unencu_t *  eu 
)

Definition at line 730 of file server.c.

731{
732 switch (t)
733 {
734 case ENCU_I: return eu->i * eu->i;
735 case ENCU_F: return eu->f * eu->f;
736 default:
737 return 0.0;
738 }
739}

◆ s_stop()

void __cdecl s_stop ( void  )

Definition at line 1157 of file server.c.

1158{
1159 if (!stop_wait_event)
1160 {
1161 ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n");
1162 ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n");
1163 }
1164 ok(SetEvent(stop_event), "SetEvent\n");
1165 if (stop_wait_event)
1166 {
1167 DWORD ret;
1169 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
1170 }
1171}
static HANDLE stop_wait_event
Definition: server.c:47
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1596

◆ s_stop_autolisten()

void __cdecl s_stop_autolisten ( void  )

Definition at line 1173 of file server.c.

1174{
1177 todo_wine
1178 ok(status == RPC_S_UNKNOWN_MGR_TYPE, "got %lu\n", status);
1179}
#define RPC_S_UNKNOWN_MGR_TYPE
Definition: winerror.h:1383

◆ s_str_length()

int __cdecl s_str_length ( const char s)

Definition at line 449 of file server.c.

450{
451 return strlen(s);
452}

◆ s_str_struct_len()

int __cdecl s_str_struct_len ( str_struct_t *  s)

Definition at line 836 of file server.c.

837{
838 return lstrlenA(s->s);
839}

◆ s_str_t_length()

int __cdecl s_str_t_length ( str_t  s)

Definition at line 454 of file server.c.

455{
456 return strlen(s);
457}

◆ s_sum()

int __cdecl s_sum ( int  x,
int  y 
)

Definition at line 329 of file server.c.

330{
331 return x + y;
332}

◆ s_sum_aligns()

double __cdecl s_sum_aligns ( aligns_t *  a)

Definition at line 802 of file server.c.

803{
804 return a->c + a->i + a->s + a->d;
805}

◆ s_sum_array_ptr()

int __cdecl s_sum_array_ptr ( int(*)  a[2])

Definition at line 1195 of file server.c.

1196{
1197 return (*a)[0] + (*a)[1];
1198}

◆ s_sum_blob()

int __cdecl s_sum_blob ( cs_blob_t *  blob)

Definition at line 601 of file server.c.

602{
603 int i, total = 0;
604
605 for (i = 0; i < blob->n; i++)
606 total += blob->ca[i];
607
608 return total;
609}
size_t total

◆ s_sum_bogus()

int __cdecl s_sum_bogus ( bogus_t *  b)

Definition at line 826 of file server.c.

827{
828 return *b->h.p1 + *b->p2 + *b->p3 + b->c;
829}

◆ s_sum_char()

signed char __cdecl s_sum_char ( signed char  x,
signed char  y 
)

Definition at line 334 of file server.c.

335{
336 return x + y;
337}

◆ s_sum_char_hyper()

int __cdecl s_sum_char_hyper ( signed char  x,
hyper  y 
)

Definition at line 364 of file server.c.

365{
366 return x + y;
367}

◆ s_sum_chars()

int __cdecl s_sum_chars ( int  a,
chars_t  x,
chars_t  y 
)

Definition at line 369 of file server.c.

370{
371 return a * (x.a + x.b + x.c + x.d + x.e + y.a + y.b + y.c + y.d + y.e);
372}

◆ s_sum_complex_array()

int __cdecl s_sum_complex_array ( int  n,
refpint_t  pi[] 
)

Definition at line 593 of file server.c.

594{
595 int total = 0;
596 for (; n > 0; n--)
597 total += *pi[n - 1];
598 return total;
599}

◆ s_sum_conf_array()

int __cdecl s_sum_conf_array ( int  x[],
int  n 
)

Definition at line 548 of file server.c.

549{
550 int *p = x, *end = p + n;
551 int sum = 0;
552
553 while (p < end)
554 sum += *p++;
555
556 return sum;
557}
GLuint GLuint end
Definition: gl.h:1545

Referenced by s_sum_cs(), s_sum_pcarr2(), s_sum_unique_conf_array(), s_sum_unique_conf_ptr(), and s_sum_var_array().

◆ s_sum_conf_ptr_by_conf_ptr()

int __cdecl s_sum_conf_ptr_by_conf_ptr ( int  n1,
int n2_then_x1,
int x2 
)

Definition at line 559 of file server.c.

560{
561 int i;
562 int sum = 0;
563 if(n1 == 0)
564 return 0;
565
566 for(i = 1; i < n1; ++i)
567 sum += n2_then_x1[i];
568
569 for(i = 0; i < *n2_then_x1; ++i)
570 sum += x2[i];
571
572 return sum;
573}
static int * n2_then_x1
Definition: server.c:102
int n1
Definition: dwarfget.c:147
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710

◆ s_sum_container()

int __cdecl s_sum_container ( cs_container_t *  container)

Definition at line 621 of file server.c.

622{
623 int i, total = 0;
624
625 for (i = 0; i < container->data.blob.n; i++)
626 total += container->data.blob.ca[i];
627
628 return total;
629}

◆ s_sum_cps()

int __cdecl s_sum_cps ( cps_t *  cps)

Definition at line 648 of file server.c.

649{
650 int sum = 0;
651 int i;
652
653 for (i = 0; i < *cps->pn; ++i)
654 sum += cps->ca1[i];
655
656 for (i = 0; i < 2 * cps->n; ++i)
657 sum += cps->ca2[i];
658
659 return sum;
660}

◆ s_sum_cpsc()

int __cdecl s_sum_cpsc ( cpsc_t *  cpsc)

Definition at line 662 of file server.c.

663{
664 int sum = 0;
665 int i;
666 for (i = 0; i < (cpsc->c ? cpsc->a : cpsc->b); ++i)
667 sum += cpsc->ca[i];
668 return sum;
669}

◆ s_sum_cpuints()

int __cdecl s_sum_cpuints ( cpuints_t *  p)

Definition at line 699 of file server.c.

700{
701 int sum = 0;
702 int i;
703 for (i = 0; i < p->n; ++i)
704 sum += atoi(p->ps[i]);
705 return sum;
706}

◆ s_sum_cs()

int __cdecl s_sum_cs ( cs_t *  cs)

Definition at line 643 of file server.c.

644{
645 return s_sum_conf_array(cs->ca, cs->n);
646}
int __cdecl s_sum_conf_array(int x[], int n)
Definition: server.c:548

◆ s_sum_data()

int __cdecl s_sum_data ( cs_data_t *  data)

Definition at line 611 of file server.c.

612{
613 int i, total = 0;
614
615 for (i = 0; i < data->blob.n; i++)
616 total += data->blob.ca[i];
617
618 return total;
619}

◆ s_sum_dbls()

int __cdecl s_sum_dbls ( int  a,
dbls_t  x,
dbls_t  y 
)

Definition at line 384 of file server.c.

385{
386 return a * (x.i + x.d + y.i + y.d);
387}

◆ s_sum_doub_carr()

int __cdecl s_sum_doub_carr ( doub_carr_t *  dc)

Definition at line 846 of file server.c.

847{
848 int i, j;
849 int sum = 0;
850 for (i = 0; i < dc->n; ++i)
851 for (j = 0; j < dc->a[i]->n; ++j)
852 sum += dc->a[i]->a[j];
853 return sum;
854}

◆ s_sum_double_int()

int __cdecl s_sum_double_int ( int  x,
double  y 
)

Definition at line 349 of file server.c.

350{
351 return x + y;
352}

◆ s_sum_fixed_array()

int __cdecl s_sum_fixed_array ( int  a[5])

Definition at line 490 of file server.c.

491{
492 return a[0] + a[1] + a[2] + a[3] + a[4];
493}

◆ s_sum_fixed_int_3d()

int __cdecl s_sum_fixed_int_3d ( int  m[2][3][4])

Definition at line 535 of file server.c.

536{
537 int i, j, k;
538 int sum = 0;
539
540 for (i = 0; i < 2; ++i)
541 for (j = 0; j < 3; ++j)
542 for (k = 0; k < 4; ++k)
543 sum += m[i][j][k];
544
545 return sum;
546}

◆ s_sum_float()

int __cdecl s_sum_float ( float  x,
float  y 
)

Definition at line 344 of file server.c.

345{
346 return x + y;
347}

◆ s_sum_flts()

int __cdecl s_sum_flts ( int  a,
flts_t  x,
flts_t  y 
)

Definition at line 379 of file server.c.

380{
381 return a * (x.i + x.f + y.i + y.f);
382}

◆ s_sum_hyper()

hyper __cdecl s_sum_hyper ( hyper  x,
hyper  y 
)

Definition at line 354 of file server.c.

355{
356 return x + y;
357}

◆ s_sum_hyper_int()

int __cdecl s_sum_hyper_int ( hyper  x,
hyper  y 
)

Definition at line 359 of file server.c.

360{
361 return x + y;
362}

◆ s_sum_idfdifdfifdfidifdidf()

int __cdecl s_sum_idfdifdfifdfidifdidf ( int  x0,
double  y0,
float  z0,
double  y1,
int  x1,
float  z1,
double  y2,
float  z2,
int  x2,
float  z3,
double  y3,
float  z4,
int  x3,
double  y4,
int  x4,
float  z5,
double  y5,
int  x5,
double  y6,
float  z6 
)

Definition at line 419 of file server.c.

420{
421 return x0 + y0 + z0 + x1 + y1 + z1 + x2 + y2 + z2 + x3 + y3 + z3 + x4 + y4 + z4 + x5 + y5 + z5 + y6 + z6;
422}
GLint x0
Definition: linetemp.h:95
static float int float int float int x3
Definition: server.c:79
static float int float int float int float int x4
Definition: server.c:79
static int y0
Definition: server.c:75
static float int float int float int float int float int x5
Definition: server.c:79
static double float double int float double float int float double float int double int float z5
Definition: server.c:81
static float int float int float int float int float int float int float y6
Definition: server.c:79
static double float double int float double float int float double float z4
Definition: server.c:81
static float int float int float int float int float int float y5
Definition: server.c:79
static float int float int float int float y3
Definition: server.c:79
static double float double int float z1
Definition: server.c:81
static double float double int float double float int float z3
Definition: server.c:81
static double float double int float double float z2
Definition: server.c:81
static float int float int float int float int float y4
Definition: server.c:79
static double float double int float double float int float double float int double int float double int double float z6
Definition: server.c:81
static double float z0
Definition: server.c:81
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711

◆ s_sum_idid()

int __cdecl s_sum_idid ( int  x0,
double  y0,
int  x1,
double  y1 
)

Definition at line 404 of file server.c.

405{
406 return x0 + y0 + x1 + y1;
407}
static int float float y1
Definition: server.c:75

◆ s_sum_ididididididid()

int __cdecl s_sum_ididididididid ( int  x0,
double  y0,
int  x1,
double  y1,
int  x2,
double  y2,
int  x3,
double  y3,
int  x4,
double  y4,
int  x5,
double  y5,
int  x6,
double  y6 
)

Definition at line 414 of file server.c.

415{
416 return x0 + y0 + x1 + y1 + x2 + y2 + x3 + y3 + x4 + y4 + x5 + y5 + x6 + y6;
417}
static float int float int float int float int float int float int x6
Definition: server.c:79

◆ s_sum_ididididididididididid()

int __cdecl s_sum_ididididididididididid ( int  x0,
double  y0,
int  x1,
double  y1,
int  x2,
double  y2,
int  x3,
double  y3,
int  x4,
double  y4,
int  x5,
double  y5,
int  x6,
double  y6,
int  x7,
double  y7,
int  x8,
double  y8 
)

Definition at line 424 of file server.c.

425{
426 return x0 + y0 + x1 + y1 + x2 + y2 + x3 + y3 + x4 + y4 + x5 + y5 + x6 + y6 + x7 + y7 + x8 + y8;
427}
static double int double int double int double int double int double int double int double int double y8
Definition: server.c:82
static double int double int double int double int double int double int double int double y7
Definition: server.c:82
static double int double int double int double int double int double int double int double int x8
Definition: server.c:82
static double int double int double int double int double int double int double int x7
Definition: server.c:82

◆ s_sum_ifif()

int __cdecl s_sum_ifif ( int  x0,
float  y0,
int  x1,
float  y1 
)

Definition at line 394 of file server.c.

395{
396 return x0 + y0 + x1 + y1;
397}

◆ s_sum_ififififififif()

int __cdecl s_sum_ififififififif ( int  x0,
float  y0,
int  x1,
float  y1,
int  x2,
float  y2,
int  x3,
float  y3,
int  x4,
float  y4,
int  x5,
float  y5,
int  x6,
float  y6 
)

Definition at line 409 of file server.c.

410{
411 return x0 + y0 + x1 + y1 + x2 + y2 + x3 + y3 + x4 + y4 + x5 + y5 + x6 + y6;
412}

◆ s_sum_iidd()

int __cdecl s_sum_iidd ( int  x0,
int  y0,
double  x1,
double  y1 
)

Definition at line 399 of file server.c.

400{
401 return x0 + y0 + x1 + y1;
402}

◆ s_sum_iidiidiidiidiidiidiidiidiidiidiid()

int __cdecl s_sum_iidiidiidiidiidiidiidiidiidiidiid ( int  x0,
int  x1,
double  y0,
int  x2,
int  x3,
double  y1,
int  x4,
int  x5,
double  y2,
int  x6,
int  x7,
double  y3,
int  x8,
int  x9,
double  y4,
int  x10,
int  x11,
double  y5,
int  x12,
int  x13,
double  y6,
int  x14,
int  x15,
double  y7,
int  x16,
int  x17,
double  y8 
)

Definition at line 429 of file server.c.

430{
431 return x0 + x1 + y0 + x2 + x3 + y1 + x4 + x5 + y2 + x6 + x7 + y3 + x8 + x9 + y4 + x10 + x11 + y5 + x12 + x13 + y6 + x14 + x15 + y7 + x16 + x17 + y8;
432}
static int double int int double int int double int int double int int double int int double int int double int int double int int x17
Definition: server.c:83
static int double int int double int int double int int double int int double int int double int int double int int x15
Definition: server.c:83
static int double int int double int int double int int double int int double int int double int int x13
Definition: server.c:83
static int double int int double int int double int int double int int double int int x11
Definition: server.c:83
static int double int int double int int double int int double int int x9
Definition: server.c:83
static int double int int double int int double int int double int int double int int double int int double int x14
Definition: server.c:83
static int double int int double int int double int int double int int double int x10
Definition: server.c:83
static int double int int double int int double int int double int int double int int double int x12
Definition: server.c:83
static int double int int double int int double int int double int int double int int double int int double int int double int x16
Definition: server.c:83

◆ s_sum_iiff()

int __cdecl s_sum_iiff ( int  x0,
int  y0,
float  x1,
float  y1 
)

Definition at line 389 of file server.c.

390{
391 return x0 + y0 + x1 + y1;
392}

◆ s_sum_ints()

int __cdecl s_sum_ints ( int  a,
ints_t  x,
ints_t  y 
)

Definition at line 374 of file server.c.

375{
376 return a * (x.i + x.j + y.i + y.j);
377}

◆ s_sum_iyiy()

int __cdecl s_sum_iyiy ( int  x0,
hyper  y0,
int  x1,
hyper  y1 
)

Definition at line 434 of file server.c.

435{
436 return x0 + y0 + x1 + y1;
437}

◆ s_sum_L1_norms()

int __cdecl s_sum_L1_norms ( int  n,
vector_t vs 
)

Definition at line 935 of file server.c.

936{
937 int i;
938 int sum = 0;
939 for (i = 0; i < n; ++i)
940 sum += abs(vs[i].x) + abs(vs[i].y) + abs(vs[i].z);
941 return sum;
942}
#define abs(i)
Definition: fconv.c:206

◆ s_sum_padded()

int __cdecl s_sum_padded ( padded_t *  p)

Definition at line 807 of file server.c.

808{
809 return p->i + p->c;
810}

Referenced by s_sum_padded2(), and s_sum_padded_conf().

◆ s_sum_padded2()

int __cdecl s_sum_padded2 ( padded_t  ps[2])

Definition at line 812 of file server.c.

813{
814 return s_sum_padded(&ps[0]) + s_sum_padded(&ps[1]);
815}
int __cdecl s_sum_padded(padded_t *p)
Definition: server.c:807

◆ s_sum_padded_conf()

int __cdecl s_sum_padded_conf ( padded_t *  ps,
int  n 
)

Definition at line 817 of file server.c.

818{
819 int sum = 0;
820 int i;
821 for (i = 0; i < n; ++i)
822 sum += s_sum_padded(&ps[i]);
823 return sum;
824}

◆ s_sum_parr()

int __cdecl s_sum_parr ( int a[3])

Definition at line 746 of file server.c.

747{
748 return s_sum_pcarr(a, 3);
749}
int __cdecl s_sum_pcarr(int *a[], int n)
Definition: server.c:751

◆ s_sum_pcarr()

int __cdecl s_sum_pcarr ( int a[],
int  n 
)

Definition at line 751 of file server.c.

752{
753 int i, s = 0;
754 for (i = 0; i < n; ++i)
755 s += *a[i];
756 return s;
757}

Referenced by s_sum_parr().

◆ s_sum_pcarr2()

int __cdecl s_sum_pcarr2 ( int  n,
int **  pa 
)

Definition at line 930 of file server.c.

931{
932 return s_sum_conf_array(*pa, n);
933}

◆ s_sum_ptr_array()

int __cdecl s_sum_ptr_array ( int a[2])

Definition at line 1190 of file server.c.

1191{
1192 return *a[0] + *a[1];
1193}

◆ s_sum_puints()

int __cdecl s_sum_puints ( puints_t *  p)

Definition at line 690 of file server.c.

691{
692 int sum = 0;
693 int i;
694 for (i = 0; i < p->n; ++i)
695 sum += atoi(p->ps[i]);
696 return sum;
697}

◆ s_sum_short()

short __cdecl s_sum_short ( short  x,
short  y 
)

Definition at line 339 of file server.c.

340{
341 return x + y;
342}

◆ s_sum_sp()

int __cdecl s_sum_sp ( sp_t *  sp)

Definition at line 510 of file server.c.

511{
512 return sp->x + sp->s->x;
513}

◆ s_sum_toplev_conf_2n()

int __cdecl s_sum_toplev_conf_2n ( int x,
int  n 
)

Definition at line 783 of file server.c.

784{
785 int sum = 0;
786 int i;
787 for (i = 0; i < 2 * n; ++i)
788 sum += x[i];
789 return sum;
790}

◆ s_sum_toplev_conf_cond()

int __cdecl s_sum_toplev_conf_cond ( int x,
int  a,
int  b,
int  c 
)

Definition at line 792 of file server.c.

793{
794 int sum = 0;
795 int n = c ? a : b;
796 int i;
797 for (i = 0; i < n; ++i)
798 sum += x[i];
799 return sum;
800}

◆ s_sum_unique_conf_array()

int __cdecl s_sum_unique_conf_array ( int  x[],
int  n 
)

Definition at line 575 of file server.c.

576{
577 return s_sum_conf_array(x, n);
578}

◆ s_sum_unique_conf_ptr()

int __cdecl s_sum_unique_conf_ptr ( int x,
int  n 
)

Definition at line 580 of file server.c.

581{
582 return x ? s_sum_conf_array(x, n) : 0;
583}

◆ s_sum_var_array()

int __cdecl s_sum_var_array ( int  x[20],
int  n 
)

Definition at line 585 of file server.c.

586{
587 ok(0 <= n, "RPC sum_var_array\n");
588 ok(n <= 20, "RPC sum_var_array\n");
589
590 return s_sum_conf_array(x, n);
591}

◆ s_test_handle()

void __cdecl s_test_handle ( ctx_handle_t  ctx_handle)

Definition at line 1210 of file server.c.

1211{
1212 ok(ctx_handle == (ctx_handle_t)0xdeadbeef, "Unexpected ctx_handle %p\n", ctx_handle);
1213}

◆ s_test_I_RpcBindingInqLocalClientPID()

void __cdecl s_test_I_RpcBindingInqLocalClientPID ( unsigned int  protseq,
RPC_BINDING_HANDLE  binding 
)

Definition at line 1244 of file server.c.

1245{
1248 HANDLE thread;
1249 ULONG pid;
1250
1252
1253 /* Crash on Windows */
1254 if (0)
1255 {
1257 ok(status == RPC_S_INVALID_ARG, "Got unexpected %ld.\n", status);
1258
1260 ok(status == RPC_S_INVALID_ARG, "Got unexpected %ld.\n", status);
1261 }
1262
1265 {
1266 ok(status == RPC_S_OK, "Got unexpected %ld.\n", status);
1267 ok(pid == client_info.dwProcessId, "Got unexpected pid.\n");
1268 }
1269 else
1270 {
1271 ok(status == RPC_S_INVALID_BINDING, "Got unexpected %ld.\n", status);
1272 }
1273
1274 if (protseq == RPC_PROTSEQ_LRPC) /* Other protocol sequences throw exceptions */
1275 {
1277 ok(status == RPC_S_OK, "Got unexpected %ld.\n", status);
1278 ok(pid == client_info.dwProcessId, "Got unexpected pid.\n");
1279 }
1280
1281 params.protseq = protseq;
1282 params.binding = binding;
1286
1288}
static HANDLE thread
Definition: service.c:33
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define INFINITE
Definition: serial.h:102
GLenum const GLfloat * params
Definition: glext.h:5645
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
static DWORD CALLBACK test_I_RpcBindingInqLocalClientPID_thread_func(void *args)
Definition: server.c:1221
#define RPC_S_INVALID_ARG
Definition: rpcnterr.h:23
unsigned int protseq
Definition: server.c:1217
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1369

◆ s_test_list_length()

int __cdecl s_test_list_length ( test_list_t *  list)

Definition at line 528 of file server.c.

529{
530 return (list->t == TL_LIST
531 ? 1 + s_test_list_length(list->u.tail)
532 : 0);
533}
int __cdecl s_test_list_length(test_list_t *list)
Definition: server.c:528

Referenced by s_test_list_length().

◆ s_wstr_struct_len()

int __cdecl s_wstr_struct_len ( wstr_struct_t *  s)

Definition at line 841 of file server.c.

842{
843 return lstrlenW(s->s);
844}

◆ server()

static void server ( void  )
static

Definition at line 2301 of file server.c.

2302{
2303 static unsigned char iptcp[] = "ncacn_ip_tcp";
2304 static unsigned char port[] = PORT;
2305 static unsigned char np[] = "ncacn_np";
2306 static unsigned char pipe[] = PIPE;
2307 static unsigned char ncalrpc[] = "ncalrpc";
2308 static unsigned char guid[] = "00000000-4114-0704-2301-000000000000";
2309 static unsigned char explicit_handle_guid[] = "00000000-4114-0704-2301-000000000002";
2310 RPC_STATUS status, iptcp_status, np_status, ncalrpc_status;
2311 DWORD ret;
2312
2313 /* needed for tests involving interface pointers */
2315
2316 iptcp_status = RpcServerUseProtseqEpA(iptcp, 20, port, NULL);
2317 ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %ld\n", iptcp_status);
2318
2319 ncalrpc_status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL);
2320 ok(ncalrpc_status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %ld\n", ncalrpc_status);
2321
2322 np_status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
2323 if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED)
2324 skip("Protocol sequence ncacn_np is not supported\n");
2325 else
2326 ok(np_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", np_status);
2327
2328 if (pRpcServerRegisterIfEx)
2329 {
2330 trace("Using RpcServerRegisterIfEx\n");
2331 status = pRpcServerRegisterIfEx(s_IMixedServer_v0_0_s_ifspec, NULL, NULL,
2334 ok(status == RPC_S_OK, "RpcServerRegisterIfEx failed with status %ld\n", status);
2335 status = pRpcServerRegisterIfEx(s_IInterpServer_v0_0_s_ifspec, NULL, NULL,
2338 ok(status == RPC_S_OK, "RpcServerRegisterIfEx failed with status %ld\n", status);
2339 }
2340 else
2341 {
2342 status = RpcServerRegisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, NULL);
2343 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status);
2344 status = RpcServerRegisterIf(s_IInterpServer_v0_0_s_ifspec, NULL, NULL);
2345 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status);
2346 }
2349 ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status);
2352 ok(stop_event != NULL, "CreateEvent failed with error %ld\n", GetLastError());
2353
2354 if (iptcp_status == RPC_S_OK)
2355 run_client("tcp_basic");
2356 else
2357 skip("tcp tests skipped due to earlier failure\n");
2358
2359 if (ncalrpc_status == RPC_S_OK)
2360 {
2361 run_client("ncalrpc_basic");
2362
2363 /* we don't need to register RPC_C_AUTHN_WINNT for ncalrpc */
2364 run_client("ncalrpc_secure");
2365 }
2366 else
2367 skip("lrpc tests skipped due to earlier failure\n");
2368
2369 if (np_status == RPC_S_OK)
2370 {
2371 run_client("np_basic_interp");
2372 run_client("np_basic");
2373 }
2374 else
2375 {
2376 skip("np_basic tests skipped due to earlier failure\n");
2377 /* np client is what signals stop_event, so bail out if we didn't run do it */
2378 return;
2379 }
2380
2382 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2383
2384 /* if the stop event didn't fire then RpcMgmtWaitServerListen will wait
2385 * forever, so don't bother calling it in this case */
2386 if (ret == WAIT_OBJECT_0)
2387 {
2389 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status);
2390 }
2391
2393 stop_event = NULL;
2394
2395 if (pRpcServerRegisterIfEx)
2396 {
2397 status = pRpcServerRegisterIfEx(s_IMixedServer_v0_0_s_ifspec, NULL, NULL,
2400 ok(status == RPC_S_OK, "RpcServerRegisterIf() failed: %lu\n", status);
2401
2402 run_client("ncalrpc_autolisten");
2403
2404 status = RpcServerUnregisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, TRUE);
2405 ok(status == RPC_S_OK, "RpcServerUnregisterIf() failed: %lu\n", status);
2406 }
2407
2408 /* explicit handle */
2410 ok(stop_event != NULL, "CreateEvent failed with error %ld\n", GetLastError());
2411
2412 ncalrpc_status = RpcServerUseProtseqEpA(ncalrpc, 0, explicit_handle_guid, NULL);
2413 if (ncalrpc_status == RPC_S_PROTSEQ_NOT_SUPPORTED)
2414 skip("Protocol sequence ncacn_np is not supported\n");
2415 else
2416 ok(ncalrpc_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", ncalrpc_status);
2417
2418 if (pRpcServerRegisterIfEx)
2419 {
2420 trace("Using RpcServerRegisterIfEx\n");
2421 status = pRpcServerRegisterIfEx(s_RPCExplicitHandle_v0_0_s_ifspec, NULL, NULL,
2424 ok(status == RPC_S_OK, "RpcServerRegisterIfEx failed with status %ld\n", status);
2427 ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status);
2428 }
2429 else
2430 {
2431 status = RpcServerRegisterIf(s_RPCExplicitHandle_v0_0_s_ifspec, NULL, NULL);
2432 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status);
2434 ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status);
2435 }
2436
2438
2439 run_client("explicit_handle");
2440
2442 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2443
2444 if (pRpcServerRegisterIfEx)
2445 {
2446 status = RpcServerUnregisterIf(s_RPCExplicitHandle_v0_0_s_ifspec, NULL, TRUE);
2447 ok(status == RPC_S_OK, "RpcServerUnregisterIf() failed: %lu\n", status);
2448 }
2449
2451 stop_event = NULL;
2452
2454}
#define skip(...)
Definition: atltest.h:64
static void run_client(const char *test)
Definition: server.c:1326
@ COINIT_MULTITHREADED
Definition: objbase.h:279
#define RPC_IF_AUTOLISTEN
Definition: rpcdce.h:313
#define RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH
Definition: rpcdce.h:317
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1370

Referenced by init_server(), print_server(), START_TEST(), write_dispatchtable(), write_function_stub(), write_rundown_routines(), write_server(), write_server_routines(), write_server_stmts(), write_serverinterfacedecl(), write_stubdescdecl(), and write_stubdescriptor().

◆ set_auth_info()

static void set_auth_info ( RPC_BINDING_HANDLE  handle)
static

Definition at line 2132 of file server.c.

2133{
2135 RPC_SECURITY_QOS qos;
2136
2137 qos.Version = 1;
2141
2143 RPC_C_AUTHN_WINNT, NULL, 0, &qos);
2144 ok(status == RPC_S_OK, "RpcBindingSetAuthInfoExA failed %ld\n", status);
2145}
#define RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH
Definition: rpcdce.h:185
#define RPC_C_QOS_IDENTITY_STATIC
Definition: rpcdce.h:180
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
#define RPC_C_IMP_LEVEL_IMPERSONATE
Definition: rpcdce.h:176
ULONG ImpersonationType
Definition: rpcdce.h:267
ULONG Capabilities
Definition: rpcdce.h:265
ULONG IdentityTracking
Definition: rpcdce.h:266

Referenced by client().

◆ set_firewall()

static HRESULT set_firewall ( enum firewall_op  op)
static

Definition at line 2752 of file server.c.

2753{
2754 HRESULT hr, init;
2755 INetFwMgr *mgr = NULL;
2761
2763 {
2765 return E_FAIL;
2766 }
2768
2769 hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
2770 (void **)&mgr );
2771 ok( hr == S_OK, "got %08lx\n", hr );
2772 if (hr != S_OK) goto done;
2773
2774 hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
2775 ok( hr == S_OK, "got %08lx\n", hr );
2776 if (hr != S_OK) goto done;
2777
2778 hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
2779 if (hr != S_OK) goto done;
2780
2781 hr = INetFwProfile_get_AuthorizedApplications( profile, &apps );
2782 ok( hr == S_OK, "got %08lx\n", hr );
2783 if (hr != S_OK) goto done;
2784
2785 hr = CoCreateInstance( &CLSID_NetFwAuthorizedApplication, NULL, CLSCTX_INPROC_SERVER,
2786 &IID_INetFwAuthorizedApplication, (void **)&app );
2787 ok( hr == S_OK, "got %08lx\n", hr );
2788 if (hr != S_OK) goto done;
2789
2790 hr = INetFwAuthorizedApplication_put_ProcessImageFileName( app, image );
2791 if (hr != S_OK) goto done;
2792
2793 name = SysAllocString( L"rpcrt4_test" );
2794 hr = INetFwAuthorizedApplication_put_Name( app, name );
2796 ok( hr == S_OK, "got %08lx\n", hr );
2797 if (hr != S_OK) goto done;
2798
2799 if (op == APP_ADD)
2800 hr = INetFwAuthorizedApplications_Add( apps, app );
2801 else if (op == APP_REMOVE)
2802 hr = INetFwAuthorizedApplications_Remove( apps, image );
2803 else
2804 hr = E_INVALIDARG;
2805
2806done:
2807 if (app) INetFwAuthorizedApplication_Release( app );
2808 if (apps) INetFwAuthorizedApplications_Release( apps );
2809 if (policy) INetFwPolicy_Release( policy );
2810 if (profile) INetFwProfile_Release( profile );
2811 if (mgr) INetFwMgr_Release( mgr );
2812 if (SUCCEEDED( init )) CoUninitialize();
2814 return hr;
2815}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
UINT op
Definition: effect.c:236
OLECHAR * BSTR
Definition: compat.h:2293
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339

Referenced by START_TEST().

◆ set_interp_interface()

static void set_interp_interface ( void  )
static

Definition at line 280 of file server.c.

281{
282#define X(name) name = interp_##name;
284#undef X
285}
#define SERVER_FUNCTIONS
Definition: server.c:168

Referenced by client().

◆ set_mixed_interface()

static void set_mixed_interface ( void  )
static

Definition at line 287 of file server.c.

288{
289#define X(name) name = mixed_##name;
291#undef X
292}

Referenced by START_TEST().

◆ short()

static short ( __cdecl sum_short)
static

◆ START_TEST()

START_TEST ( server  )

Definition at line 2817 of file server.c.

2818{
2819 ULONG size = 0;
2820 int argc;
2821 char **argv;
2822 BOOL firewall_enabled = is_firewall_enabled(), firewall_disabled = FALSE;
2823
2826
2827 ok(!GetUserNameExA(NameSamCompatible, NULL, &size), "GetUserNameExA\n");
2829 ok(GetUserNameExA(NameSamCompatible, domain_and_user, &size), "GetUserNameExA\n");
2830
2832 progname = argv[0];
2833
2834 if (argc == 3)
2835 {
2837 {
2838 client(argv[2]);
2839 }
2841 {
2842 trace("Exception %d\n", RpcExceptionCode());
2843 }
2845 }
2846 else if (argc == 4)
2847 {
2848 if (!strcmp(argv[3], "listen"))
2849 {
2851 }
2852 else if(!strcmp(argv[2], "run"))
2853 {
2854 ULONG event;
2855 sscanf(argv[3], "%lx", &event);
2857 }
2858 }
2859 else
2860 {
2861 if (firewall_enabled)
2862 {
2863 if (is_process_elevated())
2864 {
2866 if (hr == S_OK)
2867 {
2868 firewall_enabled = FALSE;
2869 firewall_disabled = TRUE;
2870 }
2871 else
2872 {
2873 skip("can't authorize app in firewall %08lx\n", hr);
2874 }
2875 }
2876 else
2877 {
2878 trace("no privileges, skipping tests to avoid firewall dialog\n");
2879 }
2880 }
2881
2882 if (!firewall_enabled) server();
2883
2884 /* Those tests cause occasional crashes on winxp and win2k3 */
2885 if (GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "RpcExceptionFilter"))
2887 else
2888 win_skip("Skipping reconnect tests on too old Windows version\n");
2889
2890 run_client("test listen");
2891 if (firewall_disabled) set_firewall(APP_REMOVE);
2892 }
2893
2895}
static int argc
Definition: ServiceArgs.c:12
#define ULongToHandle(h)
Definition: basetsd.h:75
struct _cl_event * event
Definition: glext.h:7739
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
static void test_server_listening(void)
Definition: server.c:2529
static HRESULT set_firewall(enum firewall_op op)
Definition: server.c:2752
static void run_server(HANDLE ready_event)
Definition: server.c:2611
static void test_reconnect(void)
Definition: server.c:2650
static void set_mixed_interface(void)
Definition: server.c:287
static BOOL is_process_elevated(void)
Definition: server.c:2697
static void server(void)
Definition: server.c:2301
static BOOL is_firewall_enabled(void)
Definition: server.c:2713
static void InitFunctionPointers(void)
Definition: server.c:294
#define argv
Definition: mplay32.c:18
#define RpcEndExcept
Definition: rpc.h:123
#define RpcTryExcept
Definition: rpc.h:121
#define RpcExcept(expr)
Definition: rpc.h:122
#define RpcExceptionCode()
Definition: rpc.h:127
int winetest_get_mainargs(char ***pargv)
static FILE * client
Definition: client.c:37
BOOLEAN WINAPI GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG nSize)
Definition: sspi.c:1044

◆ str_t()

static str_t ( __cdecl get_filename)
static

Referenced by basic_tests().

◆ test_handle_return()

static void test_handle_return ( void  )
static

Definition at line 2110 of file server.c.

2111{
2112 ctx_handle_t handle, handle2;
2113
2114 handle = get_handle();
2115 test_handle(handle);
2116 get_handle_by_ptr(&handle2);
2117 test_handle(handle2);
2118}

Referenced by run_tests().

◆ test_I_RpcBindingInqLocalClientPID_thread_func()

static DWORD CALLBACK test_I_RpcBindingInqLocalClientPID_thread_func ( void args)
static

Definition at line 1221 of file server.c.

1222{
1225 ULONG pid;
1226
1228
1230 ok(status == RPC_S_NO_CALL_ACTIVE, "Got unexpected %ld.\n", status);
1231
1232 /* Other protocol sequences throw exceptions */
1233 if (params->protseq == RPC_PROTSEQ_LRPC)
1234 {
1236 ok(status == RPC_S_OK, "Got unexpected %ld.\n", status);
1237 ok(pid == client_info.dwProcessId, "Got unexpected pid.\n");
1238 }
1239
1241 return 0;
1242}
Definition: match.c:390
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1392

Referenced by s_test_I_RpcBindingInqLocalClientPID().

◆ test_reconnect()

static void test_reconnect ( void  )
static

Definition at line 2650 of file server.c.

2651{
2652 static unsigned char np[] = "ncacn_np";
2653 static unsigned char address_np[] = "\\\\.";
2654 static unsigned char pipe[] = PIPE "term_test";
2655 unsigned char *binding;
2656 HANDLE threads[32];
2657 HANDLE server_process;
2658 unsigned i;
2659 DWORD ret;
2660
2661 server_process = create_server_process();
2662
2663 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
2664 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2665
2666 for (i = 0; i < ARRAY_SIZE(threads); i++)
2667 {
2669 ok(threads[i] != NULL, "CreateThread failed: %lu\n", GetLastError());
2670 }
2671
2672 for (i = 0; i < ARRAY_SIZE(threads); i++)
2673 {
2674 ret = WaitForSingleObject(threads[i], 10000);
2675 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2677 }
2678
2679 stop();
2680
2681 wait_child_process(server_process);
2682 ok(CloseHandle(server_process), "CloseHandle\n");
2683
2684 /* create new server, rpcrt4 will connect to it once sending to existing connection fails
2685 * that current connection is broken. */
2686 server_process = create_server_process();
2687 basic_tests();
2688 stop();
2689
2690 wait_child_process(server_process);
2691 ok(CloseHandle(server_process), "CloseHandle\n");
2692
2693 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2694 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2695}
static HANDLE ULONG_PTR DWORD threads
Definition: process.c:81
static DWORD WINAPI basic_tests_thread(void *arg)
Definition: server.c:2644
static HANDLE create_server_process(void)
Definition: server.c:2585

Referenced by START_TEST().

◆ test_server_listening()

static void test_server_listening ( void  )
static

Definition at line 2529 of file server.c.

2530{
2531 static unsigned char np[] = "ncacn_np";
2532 static unsigned char address_np[] = "\\\\.";
2533 static unsigned char pipe[] = PIPE "listen_test";
2534 static unsigned char ncalrpc[] = "ncalrpc";
2535 static unsigned char guid[] = "00000000-4114-0704-2302-000000000000";
2536 unsigned char *binding;
2538
2539 status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
2540 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", status);
2541
2542 status = RpcServerRegisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, NULL);
2543 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status);
2544
2547 ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status);
2549
2551 ok(status == RPC_S_ALREADY_LISTENING, "RpcServerListen failed with status %ld\n", status);
2552
2554 ok(status == RPC_S_OK, "RpcMgmtStopServerListening\n");
2556
2558 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status);
2559
2561 ok(status == RPC_S_NOT_LISTENING, "RpcMgmtWaitServerListening failed with status %ld\n", status);
2562
2563 /* test that server stop waits for a call in progress */
2564 status = RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding);
2565 ok(status == RPC_S_OK, "RpcStringBindingCompose\n");
2566
2568
2570 ok(status == RPC_S_OK, "RpcStringFree\n");
2571
2572 /* repeat the test using ncalrpc */
2573 status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL);
2574 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %ld\n", status);
2575
2577 ok(status == RPC_S_OK, "RpcStringBindingCompose\n");
2578
2580
2582 ok(status == RPC_S_OK, "RpcStringFree\n");
2583}
static void test_stop_wait_for_call(unsigned char *binding)
Definition: server.c:2484
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1380

Referenced by START_TEST().

◆ test_stop_wait_for_call()

static void test_stop_wait_for_call ( unsigned char binding)
static

Definition at line 2484 of file server.c.

2485{
2486 HANDLE client_thread, wait_listen_thread;
2488 DWORD ret;
2489
2491 ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status);
2493
2495 ok(stop_wait_event != NULL, "CreateEvent failed with error %ld\n", GetLastError());
2497 ok(stop_event != NULL, "CreateEvent failed with error %ld\n", GetLastError());
2498
2499 wait_listen_thread = CreateThread(NULL, 0, wait_listen_proc, 0, 0, NULL);
2500 ok(wait_listen_thread != NULL, "CreateThread failed\n");
2501
2502 client_thread = CreateThread(NULL, 0, listen_test_client_thread, binding, 0, NULL);
2503 ok(client_thread != NULL, "CreateThread failed\n");
2504 CloseHandle(client_thread);
2505
2507 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2508
2510 ok(status == RPC_S_OK, "RpcMgmtStopServerListening\n");
2512
2513 ret = WaitForSingleObject(wait_listen_thread, 500);
2514 ok(WAIT_TIMEOUT == ret, "WaitForSingleObject\n");
2515
2517
2518 ret = WaitForSingleObject(wait_listen_thread, 10000);
2519 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject returned %lu\n", ret);
2520
2521 CloseHandle(wait_listen_thread);
2522
2526 stop_event = NULL;
2527}
#define WAIT_TIMEOUT
Definition: dderror.h:14
static DWORD WINAPI listen_test_client_thread(void *binding)
Definition: server.c:2456
static DWORD WINAPI wait_listen_proc(void *arg)
Definition: server.c:2472

Referenced by test_server_listening().

◆ union_tests()

static void union_tests ( void  )
static

Definition at line 1546 of file server.c.

1547{
1548 encue_t eue;
1549 encu_t eu;
1550 unencu_t uneu;
1551 sun_t su;
1552 ipu_t ipu;
1553 LONG ref;
1554 int i;
1555
1556 su.s = SUN_I;
1557 su.u.i = 9;
1558 ok(square_sun(&su) == 81.0, "RPC square_sun\n");
1559
1560 su.s = SUN_F1;
1561 su.u.f = 5.0;
1562 ok(square_sun(&su) == 25.0, "RPC square_sun\n");
1563
1564 su.s = SUN_F2;
1565 su.u.f = -2.0;
1566 ok(square_sun(&su) == 4.0, "RPC square_sun\n");
1567
1568 su.s = SUN_PI;
1569 su.u.pi = &i;
1570 i = 11;
1571 ok(square_sun(&su) == 121.0, "RPC square_sun\n");
1572
1573 eu.t = ENCU_I;
1574 eu.tagged_union.i = 7;
1575 ok(square_encu(&eu) == 49.0, "RPC square_encu\n");
1576
1577 eu.t = ENCU_F;
1578 eu.tagged_union.f = 3.0;
1579 ok(square_encu(&eu) == 9.0, "RPC square_encu\n");
1580
1581 uneu.i = 4;
1582 ok(square_unencu(ENCU_I, &uneu) == 16.0, "RPC square_unencu\n");
1583
1584 uneu.f = 5.0;
1585 ok(square_unencu(ENCU_F, &uneu) == 25.0, "RPC square_unencu\n");
1586
1587 eue.t = E1;
1588 eue.tagged_union.i1 = 8;
1589 ok(square_encue(&eue) == 64.0, "RPC square_encue\n");
1590
1591 eue.t = E2;
1592 eue.tagged_union.f2 = 10.0;
1593 ok(square_encue(&eue) == 100.0, "RPC square_encue\n");
1594
1596
1597 CreateStreamOnHGlobal(NULL, TRUE, &ipu.tagged_union.stream);
1598 ip_test(&ipu);
1599 ref = IStream_Release(ipu.tagged_union.stream);
1600 ok(!ref, "got %lu refs\n", ref);
1601
1603}
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
Definition: send.c:48

Referenced by run_tests().

◆ unsigned()

◆ us_t_UserFree()

void __RPC_USER us_t_UserFree ( ULONG flags,
us_t *  pus 
)

Definition at line 1687 of file server.c.

1688{
1689 free(pus->x);
1690}

◆ us_t_UserMarshal()

unsigned char *__RPC_USER us_t_UserMarshal ( ULONG flags,
unsigned char buffer,
us_t *  pus 
)

Definition at line 1668 of file server.c.

1669{
1670 struct wire_us wus;
1671 wus.x = atoi(pus->x);
1672 memcpy(buffer, &wus, sizeof wus);
1673 return buffer + sizeof wus;
1674}

◆ us_t_UserSize()

ULONG __RPC_USER us_t_UserSize ( ULONG flags,
ULONG  start,
us_t *  pus 
)

Definition at line 1662 of file server.c.

1663{
1664 return start + sizeof(struct wire_us);
1665}

◆ us_t_UserUnmarshal()

unsigned char *__RPC_USER us_t_UserUnmarshal ( ULONG flags,
unsigned char buffer,
us_t *  pus 
)

Definition at line 1677 of file server.c.

1678{
1679 struct wire_us wus;
1680 memcpy(&wus, buffer, sizeof wus);
1681 pus->x = malloc(10);
1682 sprintf(pus->x, "%d", wus.x);
1683 return buffer + sizeof wus;
1684}

◆ void() [1/2]

static void ( __cdecl square_out)
static

◆ void() [2/2]

static void ( WINAPI pNDRSContextMarshall2)
static

◆ wait_listen_proc()

static DWORD WINAPI wait_listen_proc ( void arg)
static

Definition at line 2472 of file server.c.

2473{
2475
2476 trace("waiting\n");
2478 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status);
2479 trace("done\n");
2480
2481 return 0;
2482}

Referenced by test_stop_wait_for_call().

Variable Documentation

◆ a

int a

Definition at line 128 of file server.c.

Referenced by pointer_tests(), and s_sum_toplev_conf_cond().

◆ b

int* b

Definition at line 128 of file server.c.

Referenced by s_add(), s_hash_bstr(), and s_sum_toplev_conf_cond().

◆ binding

◆ c

Definition at line 128 of file server.c.

Referenced by array_tests(), and basic_tests().

◆ client_info

Definition at line 48 of file server.c.

◆ client_test_name

const char * client_test_name
static

◆ cpsc

cpsc_t* cpsc

Definition at line 111 of file server.c.

Referenced by array_tests(), s_get_cpsc(), and s_sum_cpsc().

◆ dc

◆ domain_and_user

char* domain_and_user
static

Definition at line 58 of file server.c.

Referenced by s_authinfo_test(), set_auth_info(), and START_TEST().

◆ eu

unencu_t* eu

Definition at line 121 of file server.c.

Referenced by s_square_encu(), s_square_unencu(), and union_tests().

◆ int

Definition at line 52 of file server.c.

Referenced by puint_t_UserSize().

◆ j

◆ k

int int k

Definition at line 151 of file server.c.

Referenced by s_echo_ranged_int(), and s_sum_fixed_int_3d().

◆ LPVOID

Definition at line 56 of file server.c.

◆ n

◆ n2_then_x1

int* n2_then_x1

Definition at line 102 of file server.c.

Referenced by s_sum_conf_ptr_by_conf_ptr().

◆ names

wstr_array_t* names

Definition at line 143 of file server.c.

Referenced by pointer_tests().

◆ NDR_RUNDOWN

void NDR_RUNDOWN

Definition at line 50 of file server.c.

◆ NDR_SCONTEXT

Definition at line 50 of file server.c.

◆ old_windows_version

BOOL old_windows_version
static

Definition at line 45 of file server.c.

Referenced by array_tests(), basic_tests(), InitFunctionPointers(), and pointer_tests().

◆ p_printf

fnprintf* p_printf = printf

Definition at line 278 of file server.c.

◆ pa

◆ pi

refpint_t pi[]

Definition at line 112 of file server.c.

Referenced by _create_process(), _ILCreatePrinterItem(), _tWinMain(), acos(), acosf(), alloc_console(), apc_deadlock_thread(), APPINFO_QueryOption(), array_tests(), atan2(), atan2f(), AudioDlgProc(), CallUninstall(), CheckX64System(), Close(), cmd_available(), Compress(), CompressBegin(), CompressEnd(), CompressGetFormat(), CompressGetSize(), CompressQuery(), computeInternalFrame(), Configure(), create_proc(), create_process(), create_pseudo_console(), create_target_process(), CreateCallProc(), CreateClientProcess(), CPrintersEnum::CreatePrintersEnumList(), CreateTipText(), custom_start_server(), Decompress(), DecompressBegin(), DecompressEnd(), DecompressGetFormat(), DecompressGetPalette(), DecompressQuery(), DestroyProcessClasses(), doChildren(), DosCreateProcess(), DoTestEntry(), find_installed_ports(), find_portinfo2(), fork_helper(), FullPathExec(), GetInfo(), HotkeyThread(), IDirectInputAImpl_RunControlPanel(), ImageListImpl_Add(), ImageListImpl_AddMasked(), ImageListImpl_GetImageCount(), ImageListImpl_ReplaceIcon(), install_wine_gecko(), IntCheckProcessDesktopClasses(), IntCreateClass(), IntDereferenceClass(), InternetSetOptionA(), InternetSetOptionW(), IntGetClassAtom(), IntNtUserSetClassLongPtr(), CNetConnectionPropertyUi::LANPropertiesUIDlg(), launch_exe(), LaunchProcess(), LocalAddPortEx(), LocalmonAddPortEx(), main(), MD_ListView_OnGetColumnOrderArray(), MD_ListView_OnSetColumnOrderArray(), MSRLE32_CompressRLE4(), MSRLE32_CompressRLE4Line(), MSRLE32_CompressRLE8(), MSRLE32_CompressRLE8Line(), MSRLE32_DecompressRLE4(), MSRLE32_DecompressRLE8(), MSRLE32_DriverProc(), CNewMenu::NewItemByCommand(), Telnet::NewProcess(), NtUserGetWOWClass(), Telnet::Open(), Open(), parse_patch_summary(), PrepAndLaunchRedirectedChild(), PRINTDLG_SetUpPrinterListComboA(), PRINTDLG_SetUpPrinterListComboW(), PRINTDLG_UpdatePrintDlgA(), PRINTDLG_UpdatePrintDlgW(), PRINTDLG_UpdatePrinterInfoTextsA(), PRINTDLG_UpdatePrinterInfoTextsW(), PrintDlgA(), PrintDlgW(), ProcessPage_OnDebug(), query_global_option(), read_reg_output_(), register_dll(), request_set_option(), restart_as_admin_elevated(), run_child_process(), run_cmd(), run_ex(), run_rapps(), run_reg_exe_(), run_regedit_exe_(), run_script_file(), run_winemenubuilder(), runcmd(), runscriptfile(), s_get_numbers(), s_sum_complex_array(), ScreenSaverConfig(), ScreenSaverPreview(), session_set_option(), SpawnProcess(), start_server(), START_TEST(), StartApplication(), StartProcess(), TaskManager_OnFileNew(), test_AddPortEx(), test_alloc_shared(), test_apc_deadlock(), test_authentication(), test_BreakawayOk(), test_child_env(), Test_CommandLine(), test_CompletionPort(), test_createProcessingInstruction(), test_CreateProcessWithDesktop(), test_debug_children(), test_debug_loop(), test_EnumProcessModules(), test_ExitProcess(), test_get_xml(), test_GetProcessVersion(), test_internet_features(), test_ip_pktinfo(), test_IsProcessInJob(), test_IsWow64Process(), test_jobInheritance(), test_KillOnJobClose(), test_marshal_basetypes(), test_marshal_struct(), test_nodeTypedValue(), test_NtQueryValueKey(), test_OpenPrinter_defaults(), test_process_access(), test_put_data(), test_query_process_debug_flags(), test_query_process_debug_object_handle(), test_query_process_debug_port(), test_QueryInformationJobObject(), test_section_access(), test_shared_memory(), test_shared_memory_ro(), test_TerminateJobObject(), test_TerminateProcess(), test_WaitForInputIdle(), test_WaitForJobObject(), testAuth(), TestStaticDestruct(), ToolsPageWndProc(), unz64local_getByte(), UserRegisterClass(), UserUnregisterClass(), xsltProcessingInstruction(), and zip64local_getByte().

◆ pn

◆ progname

const char* progname
static

Definition at line 44 of file server.c.

Referenced by create_server_process(), make_cmdline(), and START_TEST().

◆ RPC_AUTH_IDENTITY_HANDLE

◆ RPC_AUTH_KEY_RETRIEVAL_FN

UUID RPC_MGR_EPV unsigned unsigned RPC_IF_CALLBACK_FN *static RPC_SECURITY_QOS *static RPC_AUTH_KEY_RETRIEVAL_FN

Definition at line 56 of file server.c.

◆ RPC_CSTR

Definition at line 54 of file server.c.

◆ secure

◆ size

Definition at line 148 of file server.c.

Referenced by is_process_elevated().

◆ stop_event

HANDLE stop_event
static

Definition at line 47 of file server.c.

Referenced by run_server(), s_Shutdown(), s_stop(), server(), and test_stop_wait_for_call().

◆ stop_wait_event

HANDLE stop_wait_event
static

Definition at line 47 of file server.c.

Referenced by s_stop(), and test_stop_wait_for_call().

◆ ULONG

Definition at line 50 of file server.c.

◆ v

Definition at line 119 of file server.c.

Referenced by basic_tests(), and s_make_pyramid_doub_carr().

◆ vs

◆ x

◆ x1

Definition at line 75 of file server.c.

◆ x10

◆ x11

◆ x12

◆ x13

◆ x14

◆ x15

◆ x16

◆ x17

◆ x2

Definition at line 79 of file server.c.

◆ x3

◆ x4

◆ x5

◆ x6

◆ x7

◆ x8

◆ x9

◆ y

◆ y0

◆ y1

Definition at line 75 of file server.c.

Referenced by s_sum_idid(), s_sum_ifif(), s_sum_iidd(), s_sum_iiff(), and s_sum_iyiy().

◆ y2

Definition at line 79 of file server.c.

◆ y3

◆ y4

◆ y5

◆ y6

◆ y7

◆ y8

◆ z0

Definition at line 81 of file server.c.

Referenced by for(), and s_sum_idfdifdfifdfidifdidf().

◆ z1

◆ z2

◆ z3

Definition at line 81 of file server.c.

Referenced by s_sum_idfdifdfifdfidifdidf().

◆ z4

◆ z5

◆ z6