ReactOS 0.4.15-dev-8145-ga541a46
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 <stddef.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for server.c:

Go to the source code of this file.

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)
 
static charxstrdup (const char *s)
 
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)
 
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_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)
 
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 BOOL old_windows_version
 
static HANDLE stop_event
 
static HANDLE stop_wait_event
 
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 int n
 
static intn2_then_x1
 
static int intx2
 
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
 
fnprintfp_printf = printf
 
static const WCHAR helloW [] = { 'H','e','l','l','o',0 }
 
static const WCHAR worldW [] = { 'W','o','r','l','d','!',0 }
 
static BOOL is_interp
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file server.c.

◆ INT_CODE

#define INT_CODE   4198

Definition at line 41 of file server.c.

◆ PIPE

#define PIPE   "\\pipe\\wine_rpcrt4_test"

Definition at line 39 of file server.c.

◆ PORT

#define PORT   "4114"

Definition at line 38 of file server.c.

◆ SERVER_FUNCTIONS

#define SERVER_FUNCTIONS

Definition at line 148 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 1880 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 1889 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 2414 of file server.c.

2415{
2416 APP_ADD,
2418};
@ APP_REMOVE
Definition: server.c:2417
@ APP_ADD
Definition: server.c:2416

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 1881 of file server.c.

1882{
1885 ok_(__FILE__,line)(status == expected_status, "RpcMgmtIsServerListening returned %u, expected %u\n",
1886 status, expected_status);
1887}
#define ok_(x1, x2)
Definition: atltest.h:61
RPC_STATUS WINAPI RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding)
Definition: rpc_server.c:1704
long RPC_STATUS
Definition: rpc.h:52
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 1890 of file server.c.

1892{
1895 ok_(__FILE__,line)(status == expected_status || status == expected_status2,
1896 "RpcMgmtIsServerListening returned %u, expected %u or %u\n",
1897 status, expected_status, expected_status2);
1898}

◆ array_tests()

static void array_tests ( void  )
static

Definition at line 1613 of file server.c.

1614{
1615 int m[2][3][4] =
1616 {
1617 {{1, 2, 3, 4}, {-1, -3, -5, -7}, {0, 2, 4, 6}},
1618 {{1, -2, 3, -4}, {2, 3, 5, 7}, {-4, -1, -14, 4114}}
1619 };
1620 int c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
1621 int c2[] = {10, 100, 200};
1622 int c3[20];
1623 vector_t vs[2] = {{1, -2, 3}, {4, -5, -6}};
1624 cps_t cps;
1625 cpsc_t cpsc;
1626 cs_t *cs;
1627 int n;
1628 int ca[5] = {1, -2, 3, -4, 5};
1629 int tmp[10];
1630 doub_carr_t *dc;
1631 int *pi;
1632 pints_t api[5];
1633 numbers_struct_t *ns;
1634 refpint_t rpi[5];
1635 int i0 = 1, i1 = 2, *ptr_array[2] = {&i0, &i1}, array[2] = {3, 4};
1636
1638 {
1639 const char str1[25] = "Hello";
1640 ok(cstr_length(str1, sizeof str1) == strlen(str1), "RPC cstr_length\n");
1641 }
1642
1643 ok(sum_fixed_int_3d(m) == 4116, "RPC sum_fixed_int_3d\n");
1644
1645 ok(sum_conf_array(c, 10) == 45, "RPC sum_conf_array\n");
1646 ok(sum_conf_array(&c[5], 2) == 11, "RPC sum_conf_array\n");
1647 ok(sum_conf_array(&c[7], 1) == 7, "RPC sum_conf_array\n");
1648 ok(sum_conf_array(&c[2], 0) == 0, "RPC sum_conf_array\n");
1649
1650 ok(sum_conf_ptr_by_conf_ptr(1, c2, c) == 45, "RPC sum_conf_ptr_by_conf_ptr\n");
1651 ok(sum_conf_ptr_by_conf_ptr(3, c2, c) == 345, "RPC sum_conf_ptr_by_conf_ptr\n");
1652 c2[0] = 0;
1653 ok(sum_conf_ptr_by_conf_ptr(3, c2, c) == 300, "RPC sum_conf_ptr_by_conf_ptr\n");
1654
1655 ok(sum_unique_conf_array(ca, 4) == -2, "RPC sum_unique_conf_array\n");
1656 ok(sum_unique_conf_ptr(ca, 5) == 3, "RPC sum_unique_conf_array\n");
1657 ok(sum_unique_conf_ptr(NULL, 10) == 0, "RPC sum_unique_conf_array\n");
1658
1659 get_number_array(c3, &n);
1660 ok(n == 10, "RPC get_num_array\n");
1661 for (; n > 0; n--)
1662 ok(c3[n-1] == c[n-1], "get_num_array returned wrong value %d @ %d\n",
1663 c3[n-1], n);
1664 ok(sum_var_array(c, 10) == 45, "RPC sum_conf_array\n");
1665 ok(sum_var_array(&c[5], 2) == 11, "RPC sum_conf_array\n");
1666 ok(sum_var_array(&c[7], 1) == 7, "RPC sum_conf_array\n");
1667 ok(sum_var_array(&c[2], 0) == 0, "RPC sum_conf_array\n");
1668
1669 ok(dot_two_vectors(vs) == -4, "RPC dot_two_vectors\n");
1670 cs = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(cs_t, ca[5]));
1671 cs->n = 5;
1672 cs->ca[0] = 3;
1673 cs->ca[1] = 5;
1674 cs->ca[2] = -2;
1675 cs->ca[3] = -1;
1676 cs->ca[4] = -4;
1677 ok(sum_cs(cs) == 1, "RPC sum_cs\n");
1678 HeapFree(GetProcessHeap(), 0, cs);
1679
1680 n = 5;
1681 cps.pn = &n;
1682 cps.ca1 = &c[2];
1683 cps.n = 3;
1684 cps.ca2 = &c[3];
1685 ok(sum_cps(&cps) == 53, "RPC sum_cps\n");
1686
1687 cpsc.a = 4;
1688 cpsc.b = 5;
1689 cpsc.c = 1;
1690 cpsc.ca = c;
1691 ok(sum_cpsc(&cpsc) == 6, "RPC sum_cpsc\n");
1692 cpsc.a = 4;
1693 cpsc.b = 5;
1694 cpsc.c = 0;
1695 cpsc.ca = c;
1696 ok(sum_cpsc(&cpsc) == 10, "RPC sum_cpsc\n");
1697
1698 cpsc.ca = NULL;
1699 ok(get_cpsc(5, &cpsc) == 45, "RPC sum_cpsc\n");
1700 ok( cpsc.a == 10, "RPC get_cpsc %u\n", cpsc.a );
1701 for (n = 0; n < 10; n++) ok( cpsc.ca[n] == n, "RPC get_cpsc[%d] = %d\n", n, cpsc.ca[n] );
1702
1703 memset( tmp, 0x33, sizeof(tmp) );
1704 cpsc.ca = tmp;
1705 ok(get_cpsc(4, &cpsc) == 28, "RPC sum_cpsc\n");
1706 ok( cpsc.a == 8, "RPC get_cpsc %u\n", cpsc.a );
1707 ok( cpsc.ca == tmp, "RPC get_cpsc %p/%p\n", cpsc.ca, tmp );
1708 for (n = 0; n < 8; n++) ok( cpsc.ca[n] == n, "RPC get_cpsc[%d] = %d\n", n, cpsc.ca[n] );
1709
1710 ok(sum_toplev_conf_2n(c, 3) == 15, "RPC sum_toplev_conf_2n\n");
1711 ok(sum_toplev_conf_cond(c, 5, 6, 1) == 10, "RPC sum_toplev_conf_cond\n");
1712 ok(sum_toplev_conf_cond(c, 5, 6, 0) == 15, "RPC sum_toplev_conf_cond\n");
1713
1714 dc = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(doub_carr_t, a[2]));
1715 dc->n = 2;
1716 dc->a[0] = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(doub_carr_1_t, a[3]));
1717 dc->a[0]->n = 3;
1718 dc->a[0]->a[0] = 5;
1719 dc->a[0]->a[1] = 1;
1720 dc->a[0]->a[2] = 8;
1721 dc->a[1] = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(doub_carr_1_t, a[2]));
1722 dc->a[1]->n = 2;
1723 dc->a[1]->a[0] = 2;
1724 dc->a[1]->a[1] = 3;
1725 ok(sum_doub_carr(dc) == 19, "RPC sum_doub_carr\n");
1726 HeapFree(GetProcessHeap(), 0, dc->a[0]);
1727 HeapFree(GetProcessHeap(), 0, dc->a[1]);
1728 HeapFree(GetProcessHeap(), 0, dc);
1729
1730 dc = NULL;
1731 make_pyramid_doub_carr(4, &dc);
1732 ok(check_pyramid_doub_carr(dc), "RPC make_pyramid_doub_carr\n");
1734
1735 ok(sum_L1_norms(2, vs) == 21, "RPC sum_L1_norms\n");
1736
1737 memset(api, 0, sizeof(api));
1738 pi = HeapAlloc(GetProcessHeap(), 0, sizeof(*pi));
1739 *pi = -1;
1740 api[0].pi = pi;
1741 get_numbers(1, 1, api);
1742 ok(api[0].pi == pi, "RPC conformant varying array [out] pointer changed from %p to %p\n", pi, api[0].pi);
1743 ok(*api[0].pi == 0, "pi unmarshalled incorrectly %d\n", *api[0].pi);
1744
1746 {
1747 ns = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET(numbers_struct_t, numbers[5]));
1748 ns->length = 5;
1749 ns->size = 5;
1750 ns->numbers[0].pi = pi;
1751 get_numbers_struct(&ns);
1752 ok(ns->numbers[0].pi == pi, "RPC conformant varying struct embedded pointer changed from %p to %p\n", pi, ns->numbers[0].pi);
1753 ok(*ns->numbers[0].pi == 5, "pi unmarshalled incorrectly %d\n", *ns->numbers[0].pi);
1754 HeapFree(GetProcessHeap(), 0, ns);
1755 }
1756 HeapFree(GetProcessHeap(), 0, pi);
1757
1758 pi = HeapAlloc(GetProcessHeap(), 0, 5 * sizeof(*pi));
1759 pi[0] = 3; rpi[0] = &pi[0];
1760 pi[1] = 5; rpi[1] = &pi[1];
1761 pi[2] = -2; rpi[2] = &pi[2];
1762 pi[3] = -1; rpi[3] = &pi[3];
1763 pi[4] = -4; rpi[4] = &pi[4];
1764 ok(sum_complex_array(5, rpi) == 1, "RPC sum_complex_array\n");
1765 HeapFree(GetProcessHeap(), 0, pi);
1766
1767 ok(sum_ptr_array(ptr_array) == 3, "RPC sum_ptr_array\n");
1768 ok(sum_array_ptr(&array) == 7, "RPC sum_array_ptr\n");
1769}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static const WCHAR ca[]
Definition: main.c:455
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
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:120
static cpsc_t * cpsc
Definition: server.c:95
static int n
Definition: server.c:72
static void free_pyramid_doub_carr(doub_carr_t *dc)
Definition: server.c:1604
static BOOL old_windows_version
Definition: server.c:44
static vector_t * vs
Definition: server.c:127
static int int int c
Definition: server.c:109
static refpint_t pi[]
Definition: server.c:96
static int check_pyramid_doub_carr(doub_carr_t *dc)
Definition: server.c:1593
api
Definition: notification.c:38
#define memset(x, y, z)
Definition: compat.h:39
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 1121 of file server.c.

1122{
1123 char string[] = "I am a string";
1124 WCHAR wstring[] = {'I',' ','a','m',' ','a',' ','w','s','t','r','i','n','g', 0};
1125 int f[5] = {1, 3, 0, -2, -4};
1126 vector_t a = {1, 3, 7};
1127 vector_t vec1 = {4, -2, 1}, vec2 = {-5, 2, 3}, *pvec2 = &vec2;
1128 pvectors_t pvecs = {&vec1, &pvec2};
1129 sp_inner_t spi = {42};
1130 sp_t sp = {-13, &spi};
1131 aligns_t aligns;
1132 pints_t pints;
1133 ptypes_t ptypes;
1134 padded_t padded;
1135 padded_t padded2[2];
1136 bogus_t bogus;
1137 int i1, i2, i3, *pi2, *pi3, **ppi3;
1138 double u, v;
1139 float s, t;
1140 LONG q, r;
1141 short h;
1142 char c;
1143 int x;
1144 hyper y;
1145 str_struct_t ss = {string};
1146 wstr_struct_t ws = {wstring};
1147 str_t str;
1148 se_t se;
1149 renum_t re;
1150
1151 ok(int_return() == INT_CODE, "RPC int_return\n");
1152
1153 ok(square(7) == 49, "RPC square\n");
1154 x = sum(23, -4);
1155 ok(x == 19, "RPC sum got %d\n", x);
1156 c = sum_char(-23, 50);
1157 ok(c == 27, "RPC sum_char got %d\n", (int)c);
1158 h = sum_short(1122, -344);
1159 ok(h == 778, "RPC sum_short got %d\n", (int)h);
1160 x = sum_float(123.45, -32.2);
1161 ok(x == 91, "RPC sum_float got %d\n", x);
1162 x = sum_double_int(-78, 148.46);
1163 ok(x == 70, "RPC sum_double_int got %d\n", x);
1164 y = sum_hyper((hyper)0x12345678 << 16, (hyper)0x33557799 << 16);
1165 ok(y == (hyper)0x4589ce11 << 16, "RPC hyper got %s\n", wine_dbgstr_longlong(y));
1166 x = sum_hyper_int((hyper)0x24242424 << 16, -((hyper)0x24241212 << 16));
1167 ok(x == 0x12120000, "RPC hyper_int got 0x%x\n", x);
1168 x = sum_char_hyper( 12, ((hyper)0x42424242 << 32) | 0x33334444 );
1169 ok(x == 0x33334450, "RPC char_hyper got 0x%x\n", x);
1170
1171 x = 0;
1172 square_out(11, &x);
1173 ok(x == 121, "RPC square_out\n");
1174
1175 x = 5;
1176 square_ref(&x);
1177 ok(x == 25, "RPC square_ref\n");
1178
1179 ok(str_length(string) == strlen(string), "RPC str_length\n");
1180 ok(str_t_length(string) == strlen(string), "RPC str_length\n");
1181 ok(dot_self(&a) == 59, "RPC dot_self\n");
1182
1183 ok(str_struct_len(&ss) == lstrlenA(string), "RPC str_struct_len\n");
1184 ok(wstr_struct_len(&ws) == lstrlenW(wstring), "RPC str_struct_len\n");
1185
1186 v = 0.0;
1187 u = square_half(3.0, &v);
1188 ok(u == 9.0, "RPC square_half\n");
1189 ok(v == 1.5, "RPC square_half\n");
1190
1191 t = 0.0f;
1192 s = square_half_float(3.0f, &t);
1193 ok(s == 9.0f, "RPC square_half_float\n");
1194 ok(t == 1.5f, "RPC square_half_float\n");
1195
1196 r = 0;
1197 q = square_half_long(3, &r);
1198 ok(q == 9, "RPC square_half_long\n");
1199 ok(r == 1, "RPC square_half_long\n");
1200
1201 i1 = 19;
1202 i2 = -3;
1203 i3 = -29;
1204 pi2 = &i2;
1205 pi3 = &i3;
1206 ppi3 = &pi3;
1207 pints.pi = &i1;
1208 pints.ppi = &pi2;
1209 pints.pppi = &ppi3;
1210 ok(pints_sum(&pints) == -13, "RPC pints_sum\n");
1211
1212 c = 10;
1213 h = 3;
1214 q = 14;
1215 s = -5.0f;
1216 u = 11.0;
1217 ptypes.pc = &c;
1218 ptypes.ps = &h;
1219 ptypes.pl = &q;
1220 ptypes.pf = &s;
1221 ptypes.pd = &u;
1222 ok(ptypes_sum(&ptypes) == 33.0, "RPC ptypes_sum\n");
1223
1224 ok(dot_pvectors(&pvecs) == -21, "RPC dot_pvectors\n");
1225 ok(dot_copy_vectors(vec1, vec2) == -21, "RPC dot_copy_vectors\n");
1226 ok(sum_fixed_array(f) == -2, "RPC sum_fixed_array\n");
1227 ok(sum_sp(&sp) == 29, "RPC sum_sp\n");
1228
1229 ok(enum_ord(E1) == 1, "RPC enum_ord\n");
1230 ok(enum_ord(E2) == 2, "RPC enum_ord\n");
1231 ok(enum_ord(E3) == 3, "RPC enum_ord\n");
1232 ok(enum_ord(E4) == 4, "RPC enum_ord\n");
1233
1234 se.f = E2;
1235 check_se2(&se);
1236
1237 memset(&aligns, 0, sizeof(aligns));
1238 aligns.c = 3;
1239 aligns.i = 4;
1240 aligns.s = 5;
1241 aligns.d = 6.0;
1242 ok(sum_aligns(&aligns) == 18.0, "RPC sum_aligns\n");
1243
1244 padded.i = -3;
1245 padded.c = 8;
1246 ok(sum_padded(&padded) == 5, "RPC sum_padded\n");
1247 padded2[0].i = -5;
1248 padded2[0].c = 1;
1249 padded2[1].i = 3;
1250 padded2[1].c = 7;
1251 ok(sum_padded2(padded2) == 6, "RPC sum_padded2\n");
1252 padded2[0].i = -5;
1253 padded2[0].c = 1;
1254 padded2[1].i = 3;
1255 padded2[1].c = 7;
1256 ok(sum_padded_conf(padded2, 2) == 6, "RPC sum_padded_conf\n");
1257
1258 i1 = 14;
1259 i2 = -7;
1260 i3 = -4;
1261 bogus.h.p1 = &i1;
1262 bogus.p2 = &i2;
1263 bogus.p3 = &i3;
1264 bogus.c = 9;
1265 ok(sum_bogus(&bogus) == 12, "RPC sum_bogus\n");
1266
1267 check_null(NULL);
1268
1269 if (!is_interp || sizeof(void*) != 8) { /* broken in widl for win64 */
1270 str = get_filename();
1271 ok(!strcmp(str, __FILE__), "get_filename() returned %s instead of %s\n", str, __FILE__);
1273 }
1274
1275 x = echo_ranged_int(0,0,0);
1276 ok(x == 0, "echo_ranged_int() returned %d instead of 0\n", x);
1277 x = echo_ranged_int(10,20,100);
1278 ok(x == 100, "echo_ranged_int() returned %d instead of 100\n", x);
1279 x = echo_ranged_int2(40);
1280 ok(x == 40, "echo_ranged_int() returned %d instead of 40\n", x);
1281
1283 {
1284 re = 0xdeadbeef;
1285 get_ranged_enum(&re);
1286 ok(re == RE3 ||
1287 broken(re == MAKELONG(re, 0xdead)), /* Win 8, Win 10 */
1288 "get_ranged_enum() returned %x instead of RE3\n", re);
1289 }
1290}
#define broken(x)
Definition: _sntprintf.h:21
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
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
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:41
static vector_t v
Definition: server.c:100
static BOOL is_interp
Definition: server.c:245
static int y
Definition: server.c:60
static str_t(__cdecl *get_filename)(void)
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:117
#define midl_user_free
Definition: rpc.h:45
const char * ws
Definition: skip_ws.cpp:7
#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 2312 of file server.c.

2313{
2314 basic_tests();
2315 return 0;
2316}
static void basic_tests(void)
Definition: server.c:1121

Referenced by test_reconnect().

◆ bstr_t_UserFree()

void __RPC_USER bstr_t_UserFree ( ULONG flags,
bstr_t b 
)

Definition at line 1466 of file server.c.

1467{
1468 HeapFree(GetProcessHeap(), 0, &((*b)[-1]));
1469}
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 1446 of file server.c.

1447{
1448 wire_bstr_t wb = (wire_bstr_t) buffer;
1449 wb->n = (*b)[-1];
1450 memcpy(&wb->data, *b, wb->n * sizeof wb->data[0]);
1451 return buffer + FIELD_OFFSET(user_bstr_t, data[wb->n]);
1452}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
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 1440 of file server.c.

1441{
1442 return start + FIELD_OFFSET(user_bstr_t, data[(*b)[-1]]);
1443}
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 1455 of file server.c.

1456{
1457 wire_bstr_t wb = (wire_bstr_t) buffer;
1458 short *data = HeapAlloc(GetProcessHeap(), 0, (wb->n + 1) * sizeof *data);
1459 data[0] = wb->n;
1460 memcpy(&data[1], wb->data, wb->n * sizeof data[1]);
1461 *b = &data[1];
1462 return buffer + FIELD_OFFSET(user_bstr_t, data[wb->n]);
1463}

◆ 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 1593 of file server.c.

1594{
1595 int i, j;
1596 for (i = 0; i < dc->n; ++i)
1597 for (j = 0; j < dc->a[i]->n; ++j)
1598 if (dc->a[i]->a[j] != j + 1)
1599 return FALSE;
1600 return TRUE;
1601}
#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:132

Referenced by array_tests().

◆ client()

static void client ( const char test)
static

Definition at line 1901 of file server.c.

1902{
1903 static unsigned char iptcp[] = "ncacn_ip_tcp";
1904 static unsigned char np[] = "ncacn_np";
1905 static unsigned char ncalrpc[] = "ncalrpc";
1906 static unsigned char address[] = "127.0.0.1";
1907 static unsigned char address_np[] = "\\\\.";
1908 static unsigned char port[] = PORT;
1909 static unsigned char pipe[] = PIPE;
1910 static unsigned char guid[] = "00000000-4114-0704-2301-000000000000";
1911
1912 unsigned char *binding;
1913
1914 if (strcmp(test, "tcp_basic") == 0)
1915 {
1916 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
1917 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
1918
1919 run_tests();
1920 authinfo_test(RPC_PROTSEQ_TCP, 0);
1922
1923 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
1924 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
1925 }
1926 else if (strcmp(test, "tcp_secure") == 0)
1927 {
1928 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n");
1929 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
1930
1931 set_auth_info(IMixedServer_IfHandle);
1932 authinfo_test(RPC_PROTSEQ_TCP, 1);
1933 test_is_server_listening(IMixedServer_IfHandle, RPC_S_ACCESS_DENIED);
1934
1935 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
1936 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
1937 }
1938 else if (strcmp(test, "ncalrpc_basic") == 0)
1939 {
1940 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
1941 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
1942
1943 run_tests(); /* can cause RPC_X_BAD_STUB_DATA exception */
1944 authinfo_test(RPC_PROTSEQ_LRPC, 0);
1945 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
1946
1947 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
1948 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
1949 }
1950 else if (strcmp(test, "ncalrpc_autolisten") == 0)
1951 {
1952 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
1953 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
1954
1955 run_tests();
1956 authinfo_test(RPC_PROTSEQ_LRPC, 0);
1958 test_is_server_listening(IMixedServer_IfHandle, RPC_S_NOT_LISTENING);
1959
1960 stop_autolisten();
1961 ok(int_return() == INT_CODE, "RPC int_return\n");
1962
1963 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
1964 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
1965 }
1966 else if (strcmp(test, "ncalrpc_secure") == 0)
1967 {
1968 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
1969 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
1970
1971 set_auth_info(IMixedServer_IfHandle);
1972 authinfo_test(RPC_PROTSEQ_LRPC, 1);
1973 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
1974
1975 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
1976 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
1977 }
1978 else if (strcmp(test, "np_basic") == 0)
1979 {
1980 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
1981 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
1982
1983 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
1984 run_tests();
1985 authinfo_test(RPC_PROTSEQ_NMP, 0);
1986 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
1987 stop();
1988 test_is_server_listening(IMixedServer_IfHandle, RPC_S_NOT_LISTENING);
1989
1990 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
1991 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
1992 }
1993 else if (strcmp(test, "np_basic_interp") == 0)
1994 {
1996
1997 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
1998 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IInterpServer_IfHandle), "RpcBindingFromStringBinding\n");
1999
2000 test_is_server_listening(IInterpServer_IfHandle, RPC_S_OK);
2001 run_tests();
2002 authinfo_test(RPC_PROTSEQ_NMP, 0);
2003 test_is_server_listening(IInterpServer_IfHandle, RPC_S_OK);
2004
2005 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2006 ok(RPC_S_OK == RpcBindingFree(&IInterpServer_IfHandle), "RpcBindingFree\n");
2007 }
2008}
USHORT port
Definition: uri.c:228
GLuint address
Definition: glext.h:9393
const GUID * guid
#define todo_wine
Definition: custom.c:79
static void set_interp_interface(void)
Definition: server.c:247
#define PORT
Definition: server.c:38
#define PIPE
Definition: server.c:39
#define test_is_server_listening2(a, b, c)
Definition: server.c:1889
static void run_tests(void)
Definition: server.c:1854
#define test_is_server_listening(a, b)
Definition: server.c:1880
static void set_auth_info(RPC_BINDING_HANDLE handle)
Definition: server.c:1865
#define test
Definition: rosglue.h:37
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
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:457
RPC_STATUS WINAPI RpcBindingFromStringBindingA(RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:840
#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:158
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026

◆ create_server_process()

static HANDLE create_server_process ( void  )
static

Definition at line 2249 of file server.c.

2250{
2251 SECURITY_ATTRIBUTES sec_attr = { sizeof(sec_attr), NULL, TRUE };
2252 HANDLE ready_event;
2253 char cmdline[MAX_PATH];
2256 DWORD ret;
2257
2258 memset(&startup, 0, sizeof startup);
2259 startup.cb = sizeof startup;
2260
2261 ready_event = CreateEventW(&sec_attr, TRUE, FALSE, NULL);
2262 ok(ready_event != NULL, "CreateEvent failed: %u\n", GetLastError());
2263
2264#ifdef __REACTOS__
2265 sprintf(cmdline, "%s server run %Ix", progname, (UINT_PTR)ready_event);
2266#else
2267 sprintf(cmdline, "%s server run %lx", progname, (UINT_PTR)ready_event);
2268#endif
2269 trace("running server process...\n");
2270 ok(CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n");
2271 ret = WaitForSingleObject(ready_event, 10000);
2272 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2273
2274 ok(CloseHandle(info.hThread), "CloseHandle\n");
2275 ok(CloseHandle(ready_event), "CloseHandle\n");
2276 return info.hProcess;
2277}
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:4741
unsigned long DWORD
Definition: ntddk_ex.h:95
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static const char * progname
Definition: server.c:43
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define L(x)
Definition: ntvdm.h:50
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
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:406

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 1092 of file server.c.

1093{
1094 ok(ctx_handle == (ctx_handle_t)0xdeadbeef, "Unexpected ctx_handle %p\n", ctx_handle);
1095}
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(), EDIT_WindowProc(), 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(), 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(), TREEVIEW_MouseWheel(), 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 1371 of file server.c.

1372{
1373 if (list->t == TL_LIST)
1374 free_list(list->u.tail);
1376}
Definition: list.h:37
static void free_list(test_list_t *list)
Definition: server.c:1371
#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 1604 of file server.c.

1605{
1606 int i;
1607 for (i = 0; i < dc->n; ++i)
1608 MIDL_user_free(dc->a[i]);
1610}
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376

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 265 of file server.c.

266{
267 HMODULE hrpcrt4 = GetModuleHandleA("rpcrt4.dll");
268
269 pNDRSContextMarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextMarshall2");
270 pNDRSContextUnmarshall2 = (void *)GetProcAddress(hrpcrt4, "NDRSContextUnmarshall2");
271 pRpcServerRegisterIfEx = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterIfEx");
272 pRpcBindingSetAuthInfoExA = (void *)GetProcAddress(hrpcrt4, "RpcBindingSetAuthInfoExA");
273 pRpcServerRegisterAuthInfoA = (void *)GetProcAddress(hrpcrt4, "RpcServerRegisterAuthInfoA");
274
275 if (!pNDRSContextMarshall2) old_windows_version = TRUE;
276}
#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 2381 of file server.c.

2382{
2383 HRESULT hr, init;
2384 INetFwMgr *mgr = NULL;
2387 VARIANT_BOOL enabled = VARIANT_FALSE;
2388
2390
2391 hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
2392 (void **)&mgr );
2393 ok( hr == S_OK, "got %08x\n", hr );
2394 if (hr != S_OK) goto done;
2395
2396 hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
2397 ok( hr == S_OK, "got %08x\n", hr );
2398 if (hr != S_OK) goto done;
2399
2400 hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
2401 if (hr != S_OK) goto done;
2402
2403 hr = INetFwProfile_get_FirewallEnabled( profile, &enabled );
2404 ok( hr == S_OK, "got %08x\n", hr );
2405
2406done:
2407 if (policy) INetFwPolicy_Release( policy );
2408 if (profile) INetFwProfile_Release( profile );
2409 if (mgr) INetFwMgr_Release( mgr );
2410 if (SUCCEEDED( init )) CoUninitialize();
2411 return (enabled == VARIANT_TRUE);
2412}
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
WDF_INTERRUPT_POLICY policy
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 2365 of file server.c.

2366{
2367 HANDLE token;
2369 {
2371 DWORD size;
2372 BOOL ret;
2373
2375 CloseHandle( token );
2376 return (ret && type == TokenElevationTypeFull);
2377 }
2378 return FALSE;
2379}
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:129
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeFull
Definition: winnt_old.h:2487
#define TOKEN_QUERY
Definition: setypes.h:928
@ TokenElevationType
Definition: setypes.h:983

Referenced by START_TEST().

◆ listen_test_client_thread()

static DWORD WINAPI listen_test_client_thread ( void binding)
static

Definition at line 2120 of file server.c.

2121{
2123
2124 status = RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle);
2125 ok(status == RPC_S_OK, "RpcBindingFromStringBinding\n");
2126
2127 test_is_server_listening(IMixedServer_IfHandle, RPC_S_OK);
2128 stop();
2129 trace("stopped\n");
2130
2131 status = RpcBindingFree(&IMixedServer_IfHandle);
2132 ok(status == RPC_S_OK, "RpcBindingFree\n");
2133 return 0;
2134}

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 1098 of file server.c.

1099{
1100 sprintf(buffer, "%s server %s", progname, test);
1101}

Referenced by run_client().

◆ make_list()

static test_list_t * make_list ( test_list_t *  tail)
static

Definition at line 1362 of file server.c.

1363{
1364 test_list_t *n = HeapAlloc(GetProcessHeap(), 0, sizeof *n);
1365 n->t = TL_LIST;
1366 n->u.tail = tail;
1367 return n;
1368}
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 279 of file server.c.

280{
281 return HeapAlloc(GetProcessHeap(), 0, n);
282}

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR p)

Definition at line 285 of file server.c.

286{
288}
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 1353 of file server.c.

1354{
1355 test_list_t *n = HeapAlloc(GetProcessHeap(), 0, sizeof *n);
1356 n->t = TL_NULL;
1357 n->u.x = 0;
1358 return n;
1359}
#define TL_NULL

Referenced by pointer_tests().

◆ pointer_tests()

static void pointer_tests ( void  )
static

Definition at line 1472 of file server.c.

1473{
1474 int a[] = {1, 2, 3, 4};
1475 char p1[] = "11";
1476 test_list_t *list = make_list(make_list(make_list(null_list())));
1477 test_us_t tus = {{p1}};
1478 int *pa[4];
1479 puints_t pus;
1480 cpuints_t cpus;
1481 short bstr_data[] = { 5, 'H', 'e', 'l', 'l', 'o' };
1482 bstr_t bstr = &bstr_data[1], bstr2;
1483 name_t name;
1484 void *buffer;
1485 int *pa2;
1486 s123_t *s123;
1487 int val = 42;
1488
1489 ok(test_list_length(list) == 3, "RPC test_list_length\n");
1490 ok(square_puint(p1) == 121, "RPC square_puint\n");
1491 pus.n = 4;
1492 pus.ps = HeapAlloc(GetProcessHeap(), 0, pus.n * sizeof pus.ps[0]);
1493 pus.ps[0] = xstrdup("5");
1494 pus.ps[1] = xstrdup("6");
1495 pus.ps[2] = xstrdup("7");
1496 pus.ps[3] = xstrdup("8");
1497 ok(sum_puints(&pus) == 26, "RPC sum_puints\n");
1498 HeapFree(GetProcessHeap(), 0, pus.ps[0]);
1499 HeapFree(GetProcessHeap(), 0, pus.ps[1]);
1500 HeapFree(GetProcessHeap(), 0, pus.ps[2]);
1501 HeapFree(GetProcessHeap(), 0, pus.ps[3]);
1502 HeapFree(GetProcessHeap(), 0, pus.ps);
1503 cpus.n = 4;
1504 cpus.ps = HeapAlloc(GetProcessHeap(), 0, cpus.n * sizeof cpus.ps[0]);
1505 cpus.ps[0] = xstrdup("5");
1506 cpus.ps[1] = xstrdup("6");
1507 cpus.ps[2] = xstrdup("7");
1508 cpus.ps[3] = xstrdup("8");
1509 ok(sum_cpuints(&cpus) == 26, "RPC sum_puints\n");
1510 HeapFree(GetProcessHeap(), 0, cpus.ps[0]);
1511 HeapFree(GetProcessHeap(), 0, cpus.ps[1]);
1512 HeapFree(GetProcessHeap(), 0, cpus.ps[2]);
1513 HeapFree(GetProcessHeap(), 0, cpus.ps[3]);
1514 HeapFree(GetProcessHeap(), 0, cpus.ps);
1515 ok(square_test_us(&tus) == 121, "RPC square_test_us\n");
1516
1517 pa[0] = &a[0];
1518 pa[1] = &a[1];
1519 pa[2] = &a[2];
1520 ok(sum_parr(pa) == 6, "RPC sum_parr\n");
1521
1522 pa[0] = &a[0];
1523 pa[1] = &a[1];
1524 pa[2] = &a[2];
1525 pa[3] = &a[3];
1526 ok(sum_pcarr(pa, 4) == 10, "RPC sum_pcarr\n");
1527
1528 ok(hash_bstr(bstr) == s_hash_bstr(bstr), "RPC hash_bstr_data\n");
1529
1530 get_a_bstr(&bstr);
1531 s_get_a_bstr(&bstr2);
1532 ok(!lstrcmpW((LPCWSTR)bstr, (LPCWSTR)bstr2), "bstr mismatch\n");
1533 HeapFree(GetProcessHeap(), 0, bstr - 1);
1534 HeapFree(GetProcessHeap(), 0, bstr2 - 1);
1535
1536 free_list(list);
1537
1539 {
1540 int n;
1541 str_array_t names;
1542 wstr_array_t namesw;
1543
1544 name.size = 10;
1546 get_name(&name);
1547 ok(name.name == buffer, "[in,out] pointer should have stayed as %p but instead changed to %p\n", name.name, buffer);
1548 ok(!strcmp(name.name, "Jeremy Wh"), "name didn't unmarshall properly, expected \"Jeremy Wh\", but got \"%s\"\n", name.name);
1550
1551 if (!is_interp) { /* broken in widl */
1552 n = -1;
1553 names = NULL;
1554 get_names(&n, &names);
1555 ok(n == 2, "expected 2, got %d\n", n);
1557 ok(!strcmp(names[0], "Hello"), "expected Hello, got %s\n", names[0]);
1559 ok(!strcmp(names[1], "World!"), "expected World!, got %s\n", names[1]);
1563
1564 n = -1;
1565 namesw = NULL;
1566 get_namesw(&n, &namesw);
1567 ok(n == 2, "expected 2, got %d\n", n);
1569 ok(!lstrcmpW(namesw[0], helloW), "expected Hello, got %s\n", wine_dbgstr_w(namesw[0]));
1571 ok(!lstrcmpW(namesw[1], worldW), "expected World!, got %s\n", wine_dbgstr_w(namesw[1]));
1572 MIDL_user_free(namesw[0]);
1573 MIDL_user_free(namesw[1]);
1574 MIDL_user_free(namesw);
1575 }
1576 }
1577
1578 if (!is_interp) { /* broken in widl */
1579 pa2 = a;
1581 ok(sum_pcarr2(4, &pa2) == 10, "RPC sum_pcarr2\n");
1582 }
1583
1584 s123 = get_s123();
1585 ok(s123->f1 == 1 && s123->f2 == 2 && s123->f3 == 3, "RPC get_s123\n");
1586 MIDL_user_free(s123);
1587
1588 full_pointer_test(&val, &val);
1589 full_pointer_null_test(&val, NULL);
1590}
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:4242
GLuint GLuint * names
Definition: glext.h:11545
GLuint GLfloat * val
Definition: glext.h:7180
#define wine_dbgstr_w
Definition: kernel32.h:34
static const WCHAR helloW[]
Definition: server.c:242
void __cdecl s_get_a_bstr(bstr_t *b)
Definition: server.c:763
static str_array_t * names
Definition: server.c:124
static test_list_t * null_list(void)
Definition: server.c:1353
static s123_t *__cdecl * get_s123(void)
static int a
Definition: server.c:109
static int ** pa
Definition: server.c:126
static test_list_t * make_list(test_list_t *tail)
Definition: server.c:1362
unsigned __cdecl s_hash_bstr(bstr_t b)
Definition: server.c:752
static const WCHAR worldW[]
Definition: server.c:243
static char * xstrdup(const char *s)
Definition: server.c:291
#define ros_skip_flaky
Definition: test.h:180
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 1403 of file server.c.

1404{
1405 HeapFree(GetProcessHeap(), 0, *p);
1406}

◆ puint_t_UserMarshal()

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

Definition at line 1385 of file server.c.

1386{
1387 int n = atoi(*p);
1388 memcpy(buffer, &n, sizeof n);
1389 return buffer + sizeof n;
1390}
_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 1379 of file server.c.

1380{
1381 return start + sizeof(int);
1382}
static UUID RPC_MGR_EPV unsigned int
Definition: server.c:50

◆ puint_t_UserUnmarshal()

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

Definition at line 1393 of file server.c.

1394{
1395 int n;
1396 memcpy(&n, buffer, sizeof n);
1397 *p = HeapAlloc(GetProcessHeap(), 0, 10);
1398 sprintf(*p, "%d", n);
1399 return buffer + sizeof n;
1400}

◆ 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 1104 of file server.c.

1105{
1106 char cmdline[MAX_PATH];
1109
1110 memset(&startup, 0, sizeof startup);
1111 startup.cb = sizeof startup;
1112
1114 ok(CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n");
1116 ok(CloseHandle(info.hProcess), "CloseHandle\n");
1117 ok(CloseHandle(info.hThread), "CloseHandle\n");
1118}
static void make_cmdline(char buffer[MAX_PATH], const char *test)
Definition: server.c:1098
void winetest_wait_child_process(HANDLE process)

Referenced by server(), and START_TEST().

◆ run_server()

static void run_server ( HANDLE  ready_event)
static

Definition at line 2279 of file server.c.

2280{
2281 static unsigned char np[] = "ncacn_np";
2282 static unsigned char pipe[] = PIPE "term_test";
2284 BOOL ret;
2285
2286 status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
2287 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %d\n", status);
2288
2289 status = RpcServerRegisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, NULL);
2290 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status);
2291
2293 status = RpcServerListen(1, 20, TRUE);
2294 ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status);
2295
2297 ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
2298
2299 ret = SetEvent(ready_event);
2300 ok(ret, "SetEvent failed: %u\n", GetLastError());
2301
2303 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2304
2306 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %d\n", status);
2307
2309 stop_event = NULL;
2310}
static HANDLE stop_event
Definition: server.c:46
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
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 1854 of file server.c.

1855{
1856 basic_tests();
1857 union_tests();
1858 pointer_tests();
1859 array_tests();
1860 context_handle_test();
1862}
static void test_handle_return(void)
Definition: server.c:1843
static void pointer_tests(void)
Definition: server.c:1472
static void array_tests(void)
Definition: server.c:1613
static void union_tests(void)
Definition: server.c:1293

Referenced by client().

◆ s_authinfo_test()

void __cdecl s_authinfo_test ( unsigned int  protseq,
int  secure 
)

Definition at line 1771 of file server.c.

1772{
1773 RPC_BINDING_HANDLE binding;
1775 ULONG level, authnsvc;
1776 RPC_AUTHZ_HANDLE privs;
1777 unsigned char *principal;
1778
1779 binding = I_RpcGetCurrentCallHandle();
1780 ok(binding != NULL, "I_RpcGetCurrentCallHandle returned NULL\n");
1781
1782 level = authnsvc = 0xdeadbeef;
1783 privs = (RPC_AUTHZ_HANDLE)0xdeadbeef;
1784 principal = (unsigned char *)0xdeadbeef;
1785
1786 if (secure || protseq == RPC_PROTSEQ_LRPC)
1787 {
1788 status = RpcBindingInqAuthClientA(binding, &privs, &principal, &level, &authnsvc, NULL);
1790 {
1791 win_skip("RpcBindingInqAuthClientA not supported\n");
1792 return;
1793 }
1794 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
1795 ok(privs != (RPC_AUTHZ_HANDLE)0xdeadbeef, "privs unchanged\n");
1796 ok(principal != (unsigned char *)0xdeadbeef, "principal unchanged\n");
1797 if (protseq != RPC_PROTSEQ_LRPC)
1798 {
1799 todo_wine
1800 ok(principal != NULL, "NULL principal\n");
1801 }
1802 if (protseq == RPC_PROTSEQ_LRPC && principal)
1803 {
1804 int len;
1805 char *spn;
1806
1807 len = WideCharToMultiByte(CP_ACP, 0, (const WCHAR *)privs, -1, NULL, 0, NULL, NULL);
1808 spn = HeapAlloc( GetProcessHeap(), 0, len );
1809 WideCharToMultiByte(CP_ACP, 0, (const WCHAR *)privs, -1, spn, len, NULL, NULL);
1810
1811 ok(!strcmp(domain_and_user, spn), "expected %s got %s\n", domain_and_user, spn);
1812 HeapFree( GetProcessHeap(), 0, spn );
1813 }
1814 ok(level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY, "level unchanged\n");
1815 ok(authnsvc == RPC_C_AUTHN_WINNT, "authnsvc unchanged\n");
1816 RpcStringFreeA(&principal);
1817
1818 status = RpcBindingInqAuthClientA(NULL, &privs, &principal, &level, &authnsvc, NULL);
1819 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
1820 RpcStringFreeA(&principal);
1821
1822 status = RpcBindingInqAuthClientExA(NULL, &privs, &principal, &level, &authnsvc, NULL, 0);
1823 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
1824 RpcStringFreeA(&principal);
1825
1827 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
1829 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
1830
1831 }
1832 else
1833 {
1834 status = RpcBindingInqAuthClientA(binding, &privs, &principal, &level, &authnsvc, NULL);
1835 ok(status == RPC_S_BINDING_HAS_NO_AUTH, "expected RPC_S_BINDING_HAS_NO_AUTH got %u\n", status);
1836 ok(privs == (RPC_AUTHZ_HANDLE)0xdeadbeef, "got %p\n", privs);
1837 ok(principal == (unsigned char *)0xdeadbeef, "got %s\n", principal);
1838 ok(level == 0xdeadbeef, "got %u\n", level);
1839 ok(authnsvc == 0xdeadbeef, "got %u\n", authnsvc);
1840 }
1841}
#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
static char * domain_and_user
Definition: server.c:56
static int secure
Definition: server.c:138
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1463
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:1596
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1056
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:1572
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
#define win_skip
Definition: test.h:163
uint32_t ULONG
Definition: typedefs.h:59
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1054
#define RPC_S_CANNOT_SUPPORT
Definition: winerror.h:1072

◆ s_check_null()

void __cdecl s_check_null ( int null)

Definition at line 710 of file server.c.

711{
712 ok(!null, "RPC check_null\n");
713}
int null(void)
Definition: ftp.c:1794

◆ s_check_se2()

void __cdecl s_check_se2 ( se_t *  s)

Definition at line 620 of file server.c.

621{
622 ok(s->f == E2, "check_se2\n");
623}

◆ s_context_handle_test()

void __cdecl s_context_handle_test ( void  )

Definition at line 852 of file server.c.

853{
855 RPC_BINDING_HANDLE binding;
857 unsigned char buf[20];
858 static RPC_SERVER_INTERFACE server_if =
859 {
860 sizeof(RPC_SERVER_INTERFACE),
861 {{0x00000000,0x4114,0x0704,{0x23,0x01,0x00,0x00,0x00,0x00,0x00,0x00}},{1,0}},
862 {{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
863 NULL,
864 0,
865 0,
866 0,
867 0,
868 0,
869 };
870
871 binding = I_RpcGetCurrentCallHandle();
872 ok(binding != NULL, "I_RpcGetCurrentCallHandle returned NULL\n");
873
874 if (!pNDRSContextMarshall2 || !pNDRSContextUnmarshall2)
875 {
876 win_skip("NDRSContextMarshall2 or NDRSContextUnmarshall2 not exported from rpcrt4.dll\n");
877 return;
878 }
879
880 h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
881 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
882
883 /* marshal a context handle with NULL userContext */
884 memset(buf, 0xcc, sizeof(buf));
885 pNDRSContextMarshall2(binding, h, buf, NULL, NULL, 0);
886 ok(*(ULONG *)buf == 0, "attributes should have been set to 0 instead of 0x%x\n", *(ULONG *)buf);
887 ok(UuidIsNil((UUID *)&buf[4], &status), "uuid should have been nil\n");
888
889 h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
890 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
891
892 /* marshal a context handle with non-NULL userContext */
893 memset(buf, 0xcc, sizeof(buf));
894 h->userContext = (void *)0xdeadbeef;
895 pNDRSContextMarshall2(binding, h, buf, NULL, NULL, 0);
896 ok(*(ULONG *)buf == 0, "attributes should have been set to 0 instead of 0x%x\n", *(ULONG *)buf);
897 ok(!UuidIsNil((UUID *)&buf[4], &status), "uuid should not have been nil\n");
898
899 /* raises ERROR_INVALID_HANDLE exception on Vista upwards */
900 if (0)
901 {
902 h = pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, NULL, 0);
903 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
904 ok(h->userContext == (void *)0xdeadbeef, "userContext of interface didn't unmarshal properly: %p\n", h->userContext);
905
906 /* marshal a context handle with an interface specified */
907 h = pNDRSContextUnmarshall2(binding, NULL, NDR_LOCAL_DATA_REPRESENTATION, &server_if.InterfaceId, 0);
908 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
909
910 memset(buf, 0xcc, sizeof(buf));
911 h->userContext = (void *)0xcafebabe;
912 pNDRSContextMarshall2(binding, h, buf, NULL, &server_if.InterfaceId, 0);
913 ok(*(ULONG *)buf == 0, "attributes should have been set to 0 instead of 0x%x\n", *(ULONG *)buf);
914 ok(!UuidIsNil((UUID *)&buf[4], &status), "uuid should not have been nil\n");
915
916 h = pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if.InterfaceId, 0);
917 ok(h != NULL, "NDRSContextUnmarshall2 returned NULL\n");
918 ok(h->userContext == (void *)0xcafebabe, "userContext of interface didn't unmarshal properly: %p\n", h->userContext);
919 }
920
921 /* test same interface data, but different pointer */
922 /* raises ERROR_INVALID_HANDLE exception */
923 if (0)
924 {
925 RPC_SERVER_INTERFACE server_if_clone = server_if;
926
927 pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if_clone.InterfaceId, 0);
928 }
929
930 /* test different interface data, but different pointer */
931 /* raises ERROR_INVALID_HANDLE exception */
932 if (0)
933 {
934 static RPC_SERVER_INTERFACE server_if2 =
935 {
936 sizeof(RPC_SERVER_INTERFACE),
937 {{0x00000000,0x4114,0x0704,{0x23,0x01,0x00,0x00,0x00,0x00,0x00,0x00}},{1,0}},
938 {{0x8a885d04,0x1ceb,0x11c9,{0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60}},{2,0}},
939 NULL,
940 0,
941 0,
942 0,
943 0,
944 0,
945 };
946 pNDRSContextMarshall2(binding, h, buf, NULL, &server_if.InterfaceId, 0);
947
948 pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if2.InterfaceId, 0);
949 }
950
951 binding = NULL;
953
954 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
955 ok(binding != NULL, "binding is NULL\n");
956
957 if (status == RPC_S_OK && binding != NULL)
958 {
959 unsigned char* string_binding = NULL;
960 unsigned char* object_uuid = NULL;
961 unsigned char* protseq = NULL;
962 unsigned char* network_address = NULL;
963 unsigned char* endpoint = NULL;
964 unsigned char* network_options = NULL;
965
966 status = RpcBindingToStringBindingA(binding, &string_binding);
967 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
968 ok(string_binding != NULL, "string_binding is NULL\n");
969
970 status = RpcStringBindingParseA(string_binding, &object_uuid, &protseq, &network_address, &endpoint, &network_options);
971 ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
972 ok(protseq != NULL && *protseq != '\0', "protseq is %s\n", protseq);
973 ok(network_address != NULL && *network_address != '\0', "network_address is %s\n", network_address);
974
976 {
977 ok(object_uuid != NULL && *object_uuid == '\0', "object_uuid is %s\n", object_uuid);
978 ok(endpoint != NULL && *endpoint == '\0', "endpoint is %s\n", endpoint);
979 ok(network_options != NULL && *network_options == '\0', "network_options is %s\n", network_options);
980 }
981
982 RpcStringFreeA(&string_binding);
983 RpcStringFreeA(&object_uuid);
984 RpcStringFreeA(&protseq);
985 RpcStringFreeA(&network_address);
987 RpcStringFreeA(&network_options);
988 RpcBindingFree(&binding);
989 }
990}
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:1646
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:564
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:920
struct _RPC_SERVER_INTERFACE RPC_SERVER_INTERFACE
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:107
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:268
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 368 of file server.c.

369{
370 int len = 0;
371 while (0 < n-- && *s++)
372 ++len;
373 return len;
374}

◆ s_dot_copy_vectors()

int __cdecl s_dot_copy_vectors ( vector_t  u,
vector_t  v 
)

Definition at line 587 of file server.c.

588{
589 return u.x * v.x + u.y * v.y + u.z * v.z;
590}

◆ s_dot_pvectors()

int __cdecl s_dot_pvectors ( pvectors_t *  p)

Definition at line 414 of file server.c.

415{
416 return p->pu->x * (*p->pv)->x + p->pu->y * (*p->pv)->y + p->pu->z * (*p->pv)->z;
417}
GLdouble GLdouble z
Definition: glext.h:5874

◆ s_dot_self()

int __cdecl s_dot_self ( vector_t v)

Definition at line 376 of file server.c.

377{
378 return s_square(v->x) + s_square(v->y) + s_square(v->z);
379}
int __cdecl s_square(int x)
Definition: server.c:303

◆ s_dot_two_vectors()

int __cdecl s_dot_two_vectors ( vector_t  vs[2])

Definition at line 510 of file server.c.

511{
512 return vs[0].x * vs[1].x + vs[0].y * vs[1].y + vs[0].z * vs[1].z;
513}

◆ s_echo_ranged_int()

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

Definition at line 837 of file server.c.

838{
839 return min( 100, i + j + k );
840}
static int int k
Definition: server.c:132
#define min(a, b)
Definition: monoChain.cc:55

◆ s_echo_ranged_int2()

int __cdecl s_echo_ranged_int2 ( int  i)

Definition at line 842 of file server.c.

843{
844 return i;
845}

◆ s_enum_ord()

int __cdecl s_enum_ord ( e_t  e)

Definition at line 638 of file server.c.

639{
640 switch (e)
641 {
642 case E1: return 1;
643 case E2: return 2;
644 case E3: return 3;
645 case E4: return 4;
646 default:
647 return 0;
648 }
649}
#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 1028 of file server.c.

1029{
1030 ok(*a == 42, "Expected *a to be 42 instead of %d\n", *a);
1031 ok(b == NULL, "Expected b to be NULL instead of %p\n", b);
1032}

◆ s_full_pointer_test()

void __cdecl s_full_pointer_test ( int a,
int b 
)

Definition at line 1021 of file server.c.

1022{
1023 ok(*a == 42, "Expected *a to be 42 instead of %d\n", *a);
1024 ok(*b == 42, "Expected *b to be 42 instead of %d\n", *a);
1025 ok(a == b, "Expected a (%p) to point to the same memory as b (%p)\n", a, b);
1026}

◆ s_get_a_bstr()

void __cdecl s_get_a_bstr ( bstr_t b)

Definition at line 763 of file server.c.

764{
765 bstr_t bstr;
766 short str[] = {5, 'W', 'i', 'n', 'e', 0};
767 bstr = HeapAlloc(GetProcessHeap(), 0, sizeof(str));
768 memcpy(bstr, str, sizeof(str));
769 *b = bstr + 1;
770}

Referenced by pointer_tests().

◆ s_get_cpsc()

int __cdecl s_get_cpsc ( int  n,
cpsc_t *  cpsc 
)

Definition at line 550 of file server.c.

551{
552 int i, ret;
553
554 cpsc->a = 2 * n;
555 cpsc->b = 2;
556 cpsc->c = 1;
557 cpsc->ca = MIDL_user_allocate( cpsc->a * sizeof(int) );
558 for (i = ret = 0; i < cpsc->a; i++) cpsc->ca[i] = i;
559 for (i = ret = 0; i < cpsc->a; i++) ret += cpsc->ca[i];
560 return ret;
561}
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
Definition: irotp.c:371
#define for
Definition: utility.h:88

◆ s_get_filename()

str_t __cdecl s_get_filename ( void  )

Definition at line 832 of file server.c.

833{
834 return (char *)__FILE__;
835}

◆ s_get_handle()

ctx_handle_t __cdecl s_get_handle ( void  )

Definition at line 1077 of file server.c.

1078{
1079 return (ctx_handle_t)0xdeadbeef;
1080}

◆ s_get_handle_by_ptr()

void __cdecl s_get_handle_by_ptr ( ctx_handle_t r)

Definition at line 1082 of file server.c.

1083{
1084 *r = (ctx_handle_t)0xdeadbeef;
1085}

◆ s_get_name()

void __cdecl s_get_name ( name_t *  name)

Definition at line 772 of file server.c.

773{
774 const char bossman[] = "Jeremy White";
775 memcpy(name->name, bossman, min(name->size, sizeof(bossman)));
776 /* ensure nul-termination */
777 if (name->size < sizeof(bossman))
778 name->name[name->size - 1] = 0;
779}

◆ s_get_names()

void __cdecl s_get_names ( int n,
str_array_t *  names 
)

Definition at line 781 of file server.c.

782{
783 str_array_t list;
784
785 list = MIDL_user_allocate(2 * sizeof(list[0]));
786 list[0] = MIDL_user_allocate(6);
787 strcpy(list[0], "Hello");
788 list[1] = MIDL_user_allocate(7);
789 strcpy(list[1], "World!");
790
791 *names = list;
792 *n = 2;
793}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define list
Definition: rosglue.h:35

◆ s_get_namesw()

void __cdecl s_get_namesw ( int n,
wstr_array_t *  names 
)

Definition at line 795 of file server.c.

796{
797 wstr_array_t list;
798
799 list = MIDL_user_allocate(2 * sizeof(list[0]));
800 list[0] = MIDL_user_allocate(sizeof(helloW));
801 lstrcpyW(list[0], helloW);
802 list[1] = MIDL_user_allocate(sizeof(worldW));
803 lstrcpyW(list[1], worldW);
804
805 *names = list;
806 *n = 2;
807}
#define lstrcpyW
Definition: compat.h:749

◆ s_get_number_array()

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

Definition at line 515 of file server.c.

516{
517 int c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
518 memcpy(x, c, sizeof(c));
519 *n = ARRAY_SIZE(c);
520}
#define ARRAY_SIZE(A)
Definition: main.h:33

◆ s_get_numbers()

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

Definition at line 992 of file server.c.

993{
994 int i;
995 for (i = 0; i < length; i++)
996 {
997 n[i].pi = midl_user_allocate(sizeof(*n[i].pi));
998 *n[i].pi = i;
999 n[i].ppi = NULL;
1000 n[i].pppi = NULL;
1001 }
1002}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define midl_user_allocate
Definition: rpc.h:44

◆ s_get_numbers_struct()

void __cdecl s_get_numbers_struct ( numbers_struct_t **  ns)

Definition at line 1004 of file server.c.

1005{
1006 int i;
1007 *ns = midl_user_allocate(FIELD_OFFSET(numbers_struct_t, numbers[5]));
1008 if (!*ns) return;
1009 (*ns)->length = 5;
1010 (*ns)->size = 5;
1011 for (i = 0; i < (*ns)->length; i++)
1012 {
1013 (*ns)->numbers[i].pi = NULL;
1014 (*ns)->numbers[i].ppi = NULL;
1015 (*ns)->numbers[i].pppi = NULL;
1016 }
1017 (*ns)->numbers[0].pi = midl_user_allocate(sizeof(*(*ns)->numbers[i].pi));
1018 *(*ns)->numbers[0].pi = 5;
1019}

◆ s_get_ranged_enum()

void __cdecl s_get_ranged_enum ( renum_t *  re)

Definition at line 847 of file server.c.

848{
849 *re = RE3;
850}

◆ s_get_s123()

s123_t *__cdecl s_get_s123 ( void  )

Definition at line 823 of file server.c.

824{
825 s123_t *s = MIDL_user_allocate(sizeof *s);
826 s->f1 = 1;
827 s->f2 = 2;
828 s->f3 = 3;
829 return s;
830}

◆ s_hash_bstr()

unsigned __cdecl s_hash_bstr ( bstr_t  b)

Definition at line 752 of file server.c.

753{
754 short n = b[-1];
755 short *s = b;
756 unsigned hash = 0;
757 short i;
758 for (i = 0; i < n; ++i)
759 hash = 5 * hash + (unsigned) s[i];
760 return hash;
761}
static int int b
Definition: server.c:109
Definition: _hash_fun.h:40

Referenced by pointer_tests().

◆ s_int_return()

int __cdecl s_int_return ( void  )

Definition at line 298 of file server.c.

299{
300 return INT_CODE;
301}

◆ s_ip_test()

void __cdecl s_ip_test ( ipu_t *  a)

Definition at line 1058 of file server.c.

1059{
1060 STATSTG st;
1061 HRESULT hr;
1062
1063 hr = IStream_Stat(a->tagged_union.stream, &st, STATFLAG_NONAME);
1064 ok(hr == S_OK, "got %#x\n", hr);
1065}

◆ s_make_pyramid_doub_carr()

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

Definition at line 735 of file server.c.

736{
737 doub_carr_t *t;
738 int i, j;
739 t = MIDL_user_allocate(FIELD_OFFSET(doub_carr_t, a[n]));
740 t->n = n;
741 for (i = 0; i < n; ++i)
742 {
743 int v = i + 1;
744 t->a[i] = MIDL_user_allocate(FIELD_OFFSET(doub_carr_1_t, a[v]));
745 t->a[i]->n = v;
746 for (j = 0; j < v; ++j)
747 t->a[i]->a[j] = j + 1;
748 }
749 *dc = t;
750}

◆ s_pints_sum()

int __cdecl s_pints_sum ( pints_t *  pints)

Definition at line 404 of file server.c.

405{
406 return *pints->pi + **pints->ppi + ***pints->pppi;
407}

◆ s_ptypes_sum()

double __cdecl s_ptypes_sum ( ptypes_t *  pt)

Definition at line 409 of file server.c.

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

◆ s_square()

int __cdecl s_square ( int  x)

Definition at line 303 of file server.c.

304{
305 return x * x;
306}

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 598 of file server.c.

599{
600 switch (eu->t)
601 {
602 case ENCU_I: return eu->tagged_union.i * eu->tagged_union.i;
603 case ENCU_F: return eu->tagged_union.f * eu->tagged_union.f;
604 default:
605 return 0.0;
606 }
607}
static unencu_t * eu
Definition: server.c:102
#define ENCU_F
#define ENCU_I

◆ s_square_encue()

double __cdecl s_square_encue ( encue_t *  eue)

Definition at line 651 of file server.c.

652{
653 switch (eue->t)
654 {
655 case E1: return eue->tagged_union.i1 * eue->tagged_union.i1;
656 case E2: return eue->tagged_union.f2 * eue->tagged_union.f2;
657 default:
658 return 0.0;
659 }
660}

◆ s_square_half()

double __cdecl s_square_half ( double  x,
double y 
)

Definition at line 381 of file server.c.

382{
383 *y = x / 2.0;
384 return x * x;
385}

◆ s_square_half_float()

float __cdecl s_square_half_float ( float  x,
float y 
)

Definition at line 387 of file server.c.

388{
389 *y = x / 2.0f;
390 return x * x;
391}

◆ s_square_half_long()

LONG __cdecl s_square_half_long ( LONG  x,
LONG y 
)

Definition at line 393 of file server.c.

394{
395 *y = x / 2;
396 return x * x;
397}

◆ s_square_out()

void __cdecl s_square_out ( int  x,
int y 
)

Definition at line 348 of file server.c.

349{
350 *y = s_square(x);
351}

◆ s_square_puint()

int __cdecl s_square_puint ( puint_t  p)

Definition at line 563 of file server.c.

564{
565 int n = atoi(p);
566 return n * n;
567}

◆ s_square_ref()

void __cdecl s_square_ref ( int x)

Definition at line 353 of file server.c.

354{
355 *x = s_square(*x);
356}

◆ s_square_sun()

double __cdecl s_square_sun ( sun_t *  su)

Definition at line 424 of file server.c.

425{
426 switch (su->s)
427 {
428 case SUN_I: return su->u.i * su->u.i;
429 case SUN_F1:
430 case SUN_F2: return su->u.f * su->u.f;
431 case SUN_PI: return (*su->u.pi) * (*su->u.pi);
432 default:
433 return 0.0;
434 }
435}
#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 592 of file server.c.

593{
594 int n = atoi(tus->us.x);
595 return n * n;
596}

◆ s_square_unencu()

double __cdecl s_square_unencu ( int  t,
unencu_t *  eu 
)

Definition at line 609 of file server.c.

610{
611 switch (t)
612 {
613 case ENCU_I: return eu->i * eu->i;
614 case ENCU_F: return eu->f * eu->f;
615 default:
616 return 0.0;
617 }
618}

◆ s_stop()

void __cdecl s_stop ( void  )

Definition at line 1034 of file server.c.

1035{
1036 if (!stop_wait_event)
1037 {
1038 ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n");
1039 ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n");
1040 }
1041 ok(SetEvent(stop_event), "SetEvent\n");
1042 if (stop_wait_event)
1043 {
1044 DWORD ret;
1046 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
1047 }
1048}
static HANDLE stop_wait_event
Definition: server.c:46
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 1050 of file server.c.

1051{
1055 ok(status == RPC_S_UNKNOWN_MGR_TYPE, "got %u\n", status);
1056}
#define RPC_S_UNKNOWN_MGR_TYPE
Definition: winerror.h:1027

◆ s_str_length()

int __cdecl s_str_length ( const char s)

Definition at line 358 of file server.c.

359{
360 return strlen(s);
361}

◆ s_str_struct_len()

int __cdecl s_str_struct_len ( str_struct_t *  s)

Definition at line 715 of file server.c.

716{
717 return lstrlenA(s->s);
718}

◆ s_str_t_length()

int __cdecl s_str_t_length ( str_t  s)

Definition at line 363 of file server.c.

364{
365 return strlen(s);
366}

◆ s_sum()

int __cdecl s_sum ( int  x,
int  y 
)

Definition at line 308 of file server.c.

309{
310 return x + y;
311}

◆ s_sum_aligns()

double __cdecl s_sum_aligns ( aligns_t *  a)

Definition at line 681 of file server.c.

682{
683 return a->c + a->i + a->s + a->d;
684}

◆ s_sum_array_ptr()

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

Definition at line 1072 of file server.c.

1073{
1074 return (*a)[0] + (*a)[1];
1075}

◆ s_sum_bogus()

int __cdecl s_sum_bogus ( bogus_t *  b)

Definition at line 705 of file server.c.

706{
707 return *b->h.p1 + *b->p2 + *b->p3 + b->c;
708}

◆ s_sum_char()

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

Definition at line 313 of file server.c.

314{
315 return x + y;
316}

◆ s_sum_char_hyper()

int __cdecl s_sum_char_hyper ( signed char  x,
hyper  y 
)

Definition at line 343 of file server.c.

344{
345 return x + y;
346}

◆ s_sum_complex_array()

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

Definition at line 502 of file server.c.

503{
504 int total = 0;
505 for (; n > 0; n--)
506 total += *pi[n - 1];
507 return total;
508}
size_t total

◆ s_sum_conf_array()

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

Definition at line 457 of file server.c.

458{
459 int *p = x, *end = p + n;
460 int sum = 0;
461
462 while (p < end)
463 sum += *p++;
464
465 return sum;
466}
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 468 of file server.c.

469{
470 int i;
471 int sum = 0;
472 if(n1 == 0)
473 return 0;
474
475 for(i = 1; i < n1; ++i)
476 sum += n2_then_x1[i];
477
478 for(i = 0; i < *n2_then_x1; ++i)
479 sum += x2[i];
480
481 return sum;
482}
static int * n2_then_x1
Definition: server.c:86
int n1
Definition: dwarfget.c:147
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710

◆ s_sum_cps()

int __cdecl s_sum_cps ( cps_t *  cps)

Definition at line 527 of file server.c.

528{
529 int sum = 0;
530 int i;
531
532 for (i = 0; i < *cps->pn; ++i)
533 sum += cps->ca1[i];
534
535 for (i = 0; i < 2 * cps->n; ++i)
536 sum += cps->ca2[i];
537
538 return sum;
539}

◆ s_sum_cpsc()

int __cdecl s_sum_cpsc ( cpsc_t *  cpsc)

Definition at line 541 of file server.c.

542{
543 int sum = 0;
544 int i;
545 for (i = 0; i < (cpsc->c ? cpsc->a : cpsc->b); ++i)
546 sum += cpsc->ca[i];
547 return sum;
548}

◆ s_sum_cpuints()

int __cdecl s_sum_cpuints ( cpuints_t *  p)

Definition at line 578 of file server.c.

579{
580 int sum = 0;
581 int i;
582 for (i = 0; i < p->n; ++i)
583 sum += atoi(p->ps[i]);
584 return sum;
585}

◆ s_sum_cs()

int __cdecl s_sum_cs ( cs_t *  cs)

Definition at line 522 of file server.c.

523{
524 return s_sum_conf_array(cs->ca, cs->n);
525}
int __cdecl s_sum_conf_array(int x[], int n)
Definition: server.c:457

◆ s_sum_doub_carr()

int __cdecl s_sum_doub_carr ( doub_carr_t *  dc)

Definition at line 725 of file server.c.

726{
727 int i, j;
728 int sum = 0;
729 for (i = 0; i < dc->n; ++i)
730 for (j = 0; j < dc->a[i]->n; ++j)
731 sum += dc->a[i]->a[j];
732 return sum;
733}

◆ s_sum_double_int()

int __cdecl s_sum_double_int ( int  x,
double  y 
)

Definition at line 328 of file server.c.

329{
330 return x + y;
331}

◆ s_sum_fixed_array()

int __cdecl s_sum_fixed_array ( int  a[5])

Definition at line 399 of file server.c.

400{
401 return a[0] + a[1] + a[2] + a[3] + a[4];
402}

◆ s_sum_fixed_int_3d()

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

Definition at line 444 of file server.c.

445{
446 int i, j, k;
447 int sum = 0;
448
449 for (i = 0; i < 2; ++i)
450 for (j = 0; j < 3; ++j)
451 for (k = 0; k < 4; ++k)
452 sum += m[i][j][k];
453
454 return sum;
455}

◆ s_sum_float()

int __cdecl s_sum_float ( float  x,
float  y 
)

Definition at line 323 of file server.c.

324{
325 return x + y;
326}

◆ s_sum_hyper()

hyper __cdecl s_sum_hyper ( hyper  x,
hyper  y 
)

Definition at line 333 of file server.c.

334{
335 return x + y;
336}

◆ s_sum_hyper_int()

int __cdecl s_sum_hyper_int ( hyper  x,
hyper  y 
)

Definition at line 338 of file server.c.

339{
340 return x + y;
341}

◆ s_sum_L1_norms()

int __cdecl s_sum_L1_norms ( int  n,
vector_t vs 
)

Definition at line 814 of file server.c.

815{
816 int i;
817 int sum = 0;
818 for (i = 0; i < n; ++i)
819 sum += abs(vs[i].x) + abs(vs[i].y) + abs(vs[i].z);
820 return sum;
821}
#define abs(i)
Definition: fconv.c:206

◆ s_sum_padded()

int __cdecl s_sum_padded ( padded_t *  p)

Definition at line 686 of file server.c.

687{
688 return p->i + p->c;
689}

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 691 of file server.c.

692{
693 return s_sum_padded(&ps[0]) + s_sum_padded(&ps[1]);
694}
int __cdecl s_sum_padded(padded_t *p)
Definition: server.c:686

◆ s_sum_padded_conf()

int __cdecl s_sum_padded_conf ( padded_t *  ps,
int  n 
)

Definition at line 696 of file server.c.

697{
698 int sum = 0;
699 int i;
700 for (i = 0; i < n; ++i)
701 sum += s_sum_padded(&ps[i]);
702 return sum;
703}

◆ s_sum_parr()

int __cdecl s_sum_parr ( int a[3])

Definition at line 625 of file server.c.

626{
627 return s_sum_pcarr(a, 3);
628}
int __cdecl s_sum_pcarr(int *a[], int n)
Definition: server.c:630

◆ s_sum_pcarr()

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

Definition at line 630 of file server.c.

631{
632 int i, s = 0;
633 for (i = 0; i < n; ++i)
634 s += *a[i];
635 return s;
636}

Referenced by s_sum_parr().

◆ s_sum_pcarr2()

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

Definition at line 809 of file server.c.

810{
811 return s_sum_conf_array(*pa, n);
812}

◆ s_sum_ptr_array()

int __cdecl s_sum_ptr_array ( int a[2])

Definition at line 1067 of file server.c.

1068{
1069 return *a[0] + *a[1];
1070}

◆ s_sum_puints()

int __cdecl s_sum_puints ( puints_t *  p)

Definition at line 569 of file server.c.

570{
571 int sum = 0;
572 int i;
573 for (i = 0; i < p->n; ++i)
574 sum += atoi(p->ps[i]);
575 return sum;
576}

◆ s_sum_short()

short __cdecl s_sum_short ( short  x,
short  y 
)

Definition at line 318 of file server.c.

319{
320 return x + y;
321}

◆ s_sum_sp()

int __cdecl s_sum_sp ( sp_t *  sp)

Definition at line 419 of file server.c.

420{
421 return sp->x + sp->s->x;
422}

◆ s_sum_toplev_conf_2n()

int __cdecl s_sum_toplev_conf_2n ( int x,
int  n 
)

Definition at line 662 of file server.c.

663{
664 int sum = 0;
665 int i;
666 for (i = 0; i < 2 * n; ++i)
667 sum += x[i];
668 return sum;
669}

◆ s_sum_toplev_conf_cond()

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

Definition at line 671 of file server.c.

672{
673 int sum = 0;
674 int n = c ? a : b;
675 int i;
676 for (i = 0; i < n; ++i)
677 sum += x[i];
678 return sum;
679}

◆ s_sum_unique_conf_array()

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

Definition at line 484 of file server.c.

485{
486 return s_sum_conf_array(x, n);
487}

◆ s_sum_unique_conf_ptr()

int __cdecl s_sum_unique_conf_ptr ( int x,
int  n 
)

Definition at line 489 of file server.c.

490{
491 return x ? s_sum_conf_array(x, n) : 0;
492}

◆ s_sum_var_array()

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

Definition at line 494 of file server.c.

495{
496 ok(0 <= n, "RPC sum_var_array\n");
497 ok(n <= 20, "RPC sum_var_array\n");
498
499 return s_sum_conf_array(x, n);
500}

◆ s_test_handle()

void __cdecl s_test_handle ( ctx_handle_t  ctx_handle)

Definition at line 1087 of file server.c.

1088{
1089 ok(ctx_handle == (ctx_handle_t)0xdeadbeef, "Unexpected ctx_handle %p\n", ctx_handle);
1090}

◆ s_test_list_length()

int __cdecl s_test_list_length ( test_list_t *  list)

Definition at line 437 of file server.c.

438{
439 return (list->t == TL_LIST
440 ? 1 + s_test_list_length(list->u.tail)
441 : 0);
442}
int __cdecl s_test_list_length(test_list_t *list)
Definition: server.c:437

Referenced by s_test_list_length().

◆ s_wstr_struct_len()

int __cdecl s_wstr_struct_len ( wstr_struct_t *  s)

Definition at line 720 of file server.c.

721{
722 return lstrlenW(s->s);
723}

◆ server()

static void server ( void  )
static

Definition at line 2011 of file server.c.

2012{
2013 static unsigned char iptcp[] = "ncacn_ip_tcp";
2014 static unsigned char port[] = PORT;
2015 static unsigned char np[] = "ncacn_np";
2016 static unsigned char pipe[] = PIPE;
2017 static unsigned char ncalrpc[] = "ncalrpc";
2018 static unsigned char guid[] = "00000000-4114-0704-2301-000000000000";
2019 RPC_STATUS status, iptcp_status, np_status, ncalrpc_status;
2020 DWORD ret;
2021
2022 /* needed for tests involving interface pointers */
2024
2025 iptcp_status = RpcServerUseProtseqEpA(iptcp, 20, port, NULL);
2026 ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %d\n", iptcp_status);
2027
2028 ncalrpc_status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL);
2029 ok(ncalrpc_status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", ncalrpc_status);
2030
2031 np_status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
2032 if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED)
2033 skip("Protocol sequence ncacn_np is not supported\n");
2034 else
2035 ok(np_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %d\n", np_status);
2036
2037 if (pRpcServerRegisterIfEx)
2038 {
2039 trace("Using RpcServerRegisterIfEx\n");
2040 status = pRpcServerRegisterIfEx(s_IMixedServer_v0_0_s_ifspec, NULL, NULL,
2043 ok(status == RPC_S_OK, "RpcServerRegisterIfEx failed with status %d\n", status);
2044 status = pRpcServerRegisterIfEx(s_IInterpServer_v0_0_s_ifspec, NULL, NULL,
2047 ok(status == RPC_S_OK, "RpcServerRegisterIfEx failed with status %d\n", status);
2048 }
2049 else
2050 {
2051 status = RpcServerRegisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, NULL);
2052 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status);
2053 status = RpcServerRegisterIf(s_IInterpServer_v0_0_s_ifspec, NULL, NULL);
2054 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status);
2055 }
2057 status = RpcServerListen(1, 20, TRUE);
2058 ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status);
2061 ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
2062
2063 if (iptcp_status == RPC_S_OK)
2064 run_client("tcp_basic");
2065 else
2066 skip("tcp tests skipped due to earlier failure\n");
2067
2068 if (ncalrpc_status == RPC_S_OK)
2069 {
2070 run_client("ncalrpc_basic");
2071
2072 /* we don't need to register RPC_C_AUTHN_WINNT for ncalrpc */
2073 run_client("ncalrpc_secure");
2074 }
2075 else
2076 skip("lrpc tests skipped due to earlier failure\n");
2077
2078 if (np_status == RPC_S_OK)
2079 {
2080 run_client("np_basic_interp");
2081 run_client("np_basic");
2082 }
2083 else
2084 {
2085 skip("np_basic tests skipped due to earlier failure\n");
2086 /* np client is what signals stop_event, so bail out if we didn't run do it */
2087 return;
2088 }
2089
2091 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2092
2093 /* if the stop event didn't fire then RpcMgmtWaitServerListen will wait
2094 * forever, so don't bother calling it in this case */
2095 if (ret == WAIT_OBJECT_0)
2096 {
2098 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %d\n", status);
2099 }
2100
2102 stop_event = NULL;
2103
2104 if (pRpcServerRegisterIfEx)
2105 {
2106 status = pRpcServerRegisterIfEx(s_IMixedServer_v0_0_s_ifspec, NULL, NULL,
2109 ok(status == RPC_S_OK, "RpcServerRegisterIf() failed: %u\n", status);
2110
2111 run_client("ncalrpc_autolisten");
2112
2113 status = RpcServerUnregisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, TRUE);
2114 ok(status == RPC_S_OK, "RpcServerUnregisterIf() failed: %u\n", status);
2115 }
2116
2118}
#define skip(...)
Definition: atltest.h:64
static void run_client(const char *test)
Definition: server.c:1104
@ COINIT_MULTITHREADED
Definition: objbase.h:279
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
#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:1014

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 1865 of file server.c.

1866{
1868 RPC_SECURITY_QOS qos;
1869
1870 qos.Version = 1;
1874
1876 RPC_C_AUTHN_WINNT, NULL, 0, &qos);
1877 ok(status == RPC_S_OK, "RpcBindingSetAuthInfoExA failed %d\n", status);
1878}
#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 2420 of file server.c.

2421{
2422 static const WCHAR testW[] = {'r','p','c','r','t','4','_','t','e','s','t',0};
2423 HRESULT hr, init;
2424 INetFwMgr *mgr = NULL;
2430
2432 {
2434 return E_FAIL;
2435 }
2437
2438 hr = CoCreateInstance( &CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr,
2439 (void **)&mgr );
2440 ok( hr == S_OK, "got %08x\n", hr );
2441 if (hr != S_OK) goto done;
2442
2443 hr = INetFwMgr_get_LocalPolicy( mgr, &policy );
2444 ok( hr == S_OK, "got %08x\n", hr );
2445 if (hr != S_OK) goto done;
2446
2447 hr = INetFwPolicy_get_CurrentProfile( policy, &profile );
2448 if (hr != S_OK) goto done;
2449
2450 hr = INetFwProfile_get_AuthorizedApplications( profile, &apps );
2451 ok( hr == S_OK, "got %08x\n", hr );
2452 if (hr != S_OK) goto done;
2453
2454 hr = CoCreateInstance( &CLSID_NetFwAuthorizedApplication, NULL, CLSCTX_INPROC_SERVER,
2455 &IID_INetFwAuthorizedApplication, (void **)&app );
2456 ok( hr == S_OK, "got %08x\n", hr );
2457 if (hr != S_OK) goto done;
2458
2459 hr = INetFwAuthorizedApplication_put_ProcessImageFileName( app, image );
2460 if (hr != S_OK) goto done;
2461
2463 hr = INetFwAuthorizedApplication_put_Name( app, name );
2465 ok( hr == S_OK, "got %08x\n", hr );
2466 if (hr != S_OK) goto done;
2467
2468 if (op == APP_ADD)
2469 hr = INetFwAuthorizedApplications_Add( apps, app );
2470 else if (op == APP_REMOVE)
2471 hr = INetFwAuthorizedApplications_Remove( apps, image );
2472 else
2473 hr = E_INVALIDARG;
2474
2475done:
2476 if (app) INetFwAuthorizedApplication_Release( app );
2477 if (apps) INetFwAuthorizedApplications_Release( apps );
2478 if (policy) INetFwPolicy_Release( policy );
2479 if (profile) INetFwProfile_Release( profile );
2480 if (mgr) INetFwMgr_Release( mgr );
2481 if (SUCCEEDED( init )) CoUninitialize();
2483 return hr;
2484}
#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
static const WCHAR testW[]
Definition: jsregexp.c:44
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 247 of file server.c.

248{
249 is_interp = TRUE;
250
251#define X(name) name = interp_##name;
253#undef X
254}
#define SERVER_FUNCTIONS
Definition: server.c:148

Referenced by client().

◆ set_mixed_interface()

static void set_mixed_interface ( void  )
static

Definition at line 256 of file server.c.

257{
259
260#define X(name) name = mixed_##name;
262#undef X
263}

Referenced by START_TEST().

◆ short()

static short ( __cdecl sum_short)
static

◆ START_TEST()

START_TEST ( server  )

Definition at line 2486 of file server.c.

2487{
2488 ULONG size = 0;
2489 int argc;
2490 char **argv;
2491 BOOL firewall_enabled = is_firewall_enabled(), firewall_disabled = FALSE;
2492
2495
2496 ok(!GetUserNameExA(NameSamCompatible, NULL, &size), "GetUserNameExA\n");
2498 ok(GetUserNameExA(NameSamCompatible, domain_and_user, &size), "GetUserNameExA\n");
2499
2501 progname = argv[0];
2502
2503 if (argc == 3)
2504 {
2506 {
2507 client(argv[2]);
2508 }
2510 {
2511 trace("Exception %d\n", RpcExceptionCode());
2512 }
2514 }
2515 else if (argc == 4)
2516 {
2517 if (!strcmp(argv[3], "listen"))
2518 {
2520 }
2521 else if(!strcmp(argv[2], "run"))
2522 {
2524#ifdef __REACTOS__
2525 sscanf(argv[3], "%Ix", &event);
2526#else
2527 sscanf(argv[3], "%lx", &event);
2528#endif
2530 }
2531 }
2532 else
2533 {
2534 if (firewall_enabled)
2535 {
2536 if (is_process_elevated())
2537 {
2539 if (hr == S_OK)
2540 {
2541 firewall_enabled = FALSE;
2542 firewall_disabled = TRUE;
2543 }
2544 else
2545 {
2546 skip("can't authorize app in firewall %08x\n", hr);
2547 }
2548 }
2549 else
2550 {
2551 trace("no privileges, skipping tests to avoid firewall dialog\n");
2552 }
2553 }
2554
2555 if (!firewall_enabled) server();
2556
2557 /* Those tests cause occasional crashes on winxp and win2k3 */
2558 if (GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "RpcExceptionFilter"))
2560 else
2561 win_skip("Skipping reconnect tests on too old Windows version\n");
2562
2563 run_client("test listen");
2564 if (firewall_disabled) set_firewall(APP_REMOVE);
2565 }
2566
2568}
static int argc
Definition: ServiceArgs.c:12
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:2193
static HRESULT set_firewall(enum firewall_op op)
Definition: server.c:2420
static void run_server(HANDLE ready_event)
Definition: server.c:2279
static void test_reconnect(void)
Definition: server.c:2318
static void set_mixed_interface(void)
Definition: server.c:256
static BOOL is_process_elevated(void)
Definition: server.c:2365
static void server(void)
Definition: server.c:2011
static BOOL is_firewall_enabled(void)
Definition: server.c:2381
static void InitFunctionPointers(void)
Definition: server.c:265
#define argv
Definition: mplay32.c:18
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
#define RpcExceptionCode()
Definition: rpc.h:132
int winetest_get_mainargs(char ***pargv)
static FILE * client
Definition: client.c:41
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 1843 of file server.c.

1844{
1845 ctx_handle_t handle, handle2;
1846
1847 handle = get_handle();
1848 test_handle(handle);
1849 get_handle_by_ptr(&handle2);
1850 test_handle(handle2);
1851}

Referenced by run_tests().

◆ test_reconnect()

static void test_reconnect ( void  )
static

Definition at line 2318 of file server.c.

2319{
2320 static unsigned char np[] = "ncacn_np";
2321 static unsigned char address_np[] = "\\\\.";
2322 static unsigned char pipe[] = PIPE "term_test";
2323 unsigned char *binding;
2324 HANDLE threads[32];
2325 HANDLE server_process;
2326 unsigned i;
2327 DWORD ret;
2328
2329 server_process = create_server_process();
2330
2331 ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n");
2332 ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IMixedServer_IfHandle), "RpcBindingFromStringBinding\n");
2333
2334 for (i = 0; i < ARRAY_SIZE(threads); i++)
2335 {
2337 ok(threads[i] != NULL, "CreateThread failed: %u\n", GetLastError());
2338 }
2339
2340 for (i = 0; i < ARRAY_SIZE(threads); i++)
2341 {
2342 ret = WaitForSingleObject(threads[i], 10000);
2343 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2345 }
2346
2347 stop();
2348
2349 winetest_wait_child_process(server_process);
2350 ok(CloseHandle(server_process), "CloseHandle\n");
2351
2352 /* create new server, rpcrt4 will connect to it once sending to existing connection fails
2353 * that current connection is broken. */
2354 server_process = create_server_process();
2355 basic_tests();
2356 stop();
2357
2358 winetest_wait_child_process(server_process);
2359 ok(CloseHandle(server_process), "CloseHandle\n");
2360
2361 ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n");
2362 ok(RPC_S_OK == RpcBindingFree(&IMixedServer_IfHandle), "RpcBindingFree\n");
2363}
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
static HANDLE ULONG_PTR DWORD threads
Definition: process.c:81
static DWORD WINAPI basic_tests_thread(void *arg)
Definition: server.c:2312
static HANDLE create_server_process(void)
Definition: server.c:2249

Referenced by START_TEST().

◆ test_server_listening()

static void test_server_listening ( void  )
static

Definition at line 2193 of file server.c.

2194{
2195 static unsigned char np[] = "ncacn_np";
2196 static unsigned char address_np[] = "\\\\.";
2197 static unsigned char pipe[] = PIPE "listen_test";
2198 static unsigned char ncalrpc[] = "ncalrpc";
2199 static unsigned char guid[] = "00000000-4114-0704-2302-000000000000";
2200 unsigned char *binding;
2202
2203 status = RpcServerUseProtseqEpA(np, 0, pipe, NULL);
2204 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %d\n", status);
2205
2206 status = RpcServerRegisterIf(s_IMixedServer_v0_0_s_ifspec, NULL, NULL);
2207 ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status);
2208
2210 status = RpcServerListen(1, 20, TRUE);
2211 ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status);
2213
2214 status = RpcServerListen(1, 20, TRUE);
2215 ok(status == RPC_S_ALREADY_LISTENING, "RpcServerListen failed with status %d\n", status);
2216
2218 ok(status == RPC_S_OK, "RpcMgmtStopServerListening\n");
2220
2222 ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %d\n", status);
2223
2225 ok(status == RPC_S_NOT_LISTENING, "RpcMgmtWaitServerListening failed with status %d\n", status);
2226
2227 /* test that server stop waits for a call in progress */
2228 status = RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding);
2229 ok(status == RPC_S_OK, "RpcStringBindingCompose\n");
2230
2231 test_stop_wait_for_call(binding);
2232
2233 status = RpcStringFreeA(&binding);
2234 ok(status == RPC_S_OK, "RpcStringFree\n");
2235
2236 /* repeat the test using ncalrpc */
2237 status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL);
2238 ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status);
2239
2240 status = RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding);
2241 ok(status == RPC_S_OK, "RpcStringBindingCompose\n");
2242
2243 test_stop_wait_for_call(binding);
2244
2245 status = RpcStringFreeA(&binding);
2246 ok(status == RPC_S_OK, "RpcStringFree\n");
2247}
static void test_stop_wait_for_call(unsigned char *binding)
Definition: server.c:2148
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1024

Referenced by START_TEST().

◆ test_stop_wait_for_call()

static void test_stop_wait_for_call ( unsigned char binding)
static

Definition at line 2148 of file server.c.

2149{
2150 HANDLE client_thread, wait_listen_thread;
2152 DWORD ret;
2153
2154 status = RpcServerListen(1, 20, TRUE);
2155 ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status);
2157
2159 ok(stop_wait_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
2161 ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
2162
2163 wait_listen_thread = CreateThread(NULL, 0, wait_listen_proc, 0, 0, NULL);
2164 ok(wait_listen_thread != NULL, "CreateThread failed\n");
2165
2166 client_thread = CreateThread(NULL, 0, listen_test_client_thread, binding, 0, NULL);
2167 ok(client_thread != NULL, "CreateThread failed\n");
2168 CloseHandle(client_thread);
2169
2171 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n");
2172
2174 ok(status == RPC_S_OK, "RpcMgmtStopServerListening\n");
2176
2177 ret = WaitForSingleObject(wait_listen_thread, 500);
2178 ok(WAIT_TIMEOUT == ret, "WaitForSingleObject\n");
2179
2181
2182 ret = WaitForSingleObject(wait_listen_thread, 10000);
2183 ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject returned %u\n", ret);
2184
2185 CloseHandle(wait_listen_thread);
2186
2190 stop_event = NULL;
2191}
#define WAIT_TIMEOUT
Definition: dderror.h:14
static DWORD WINAPI listen_test_client_thread(void *binding)
Definition: server.c:2120
static DWORD WINAPI wait_listen_proc(void *arg)
Definition: server.c:2136

Referenced by test_server_listening().

◆ union_tests()

static void union_tests ( void  )
static

Definition at line 1293 of file server.c.

1294{
1295 encue_t eue;
1296 encu_t eu;
1297 unencu_t uneu;
1298 sun_t su;
1299 ipu_t ipu;
1300 LONG ref;
1301 int i;
1302
1303 su.s = SUN_I;
1304 su.u.i = 9;
1305 ok(square_sun(&su) == 81.0, "RPC square_sun\n");
1306
1307 su.s = SUN_F1;
1308 su.u.f = 5.0;
1309 ok(square_sun(&su) == 25.0, "RPC square_sun\n");
1310
1311 su.s = SUN_F2;
1312 su.u.f = -2.0;
1313 ok(square_sun(&su) == 4.0, "RPC square_sun\n");
1314
1315 su.s = SUN_PI;
1316 su.u.pi = &i;
1317 i = 11;
1318 ok(square_sun(&su) == 121.0, "RPC square_sun\n");
1319
1320 eu.t = ENCU_I;
1321 eu.tagged_union.i = 7;
1322 ok(square_encu(&eu) == 49.0, "RPC square_encu\n");
1323
1324 eu.t = ENCU_F;
1325 eu.tagged_union.f = 3.0;
1326 ok(square_encu(&eu) == 9.0, "RPC square_encu\n");
1327
1328 uneu.i = 4;
1329 ok(square_unencu(ENCU_I, &uneu) == 16.0, "RPC square_unencu\n");
1330
1331 uneu.f = 5.0;
1332 ok(square_unencu(ENCU_F, &uneu) == 25.0, "RPC square_unencu\n");
1333
1334 eue.t = E1;
1335 eue.tagged_union.i1 = 8;
1336 ok(square_encue(&eue) == 64.0, "RPC square_encue\n");
1337
1338 eue.t = E2;
1339 eue.tagged_union.f2 = 10.0;
1340 ok(square_encue(&eue) == 100.0, "RPC square_encue\n");
1341
1343
1344 CreateStreamOnHGlobal(NULL, TRUE, &ipu.tagged_union.stream);
1345 ip_test(&ipu);
1346 ref = IStream_Release(ipu.tagged_union.stream);
1347 ok(!ref, "got %u refs\n", ref);
1348
1350}
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 1434 of file server.c.

1435{
1436 HeapFree(GetProcessHeap(), 0, pus->x);
1437}

◆ us_t_UserMarshal()

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

Definition at line 1415 of file server.c.

1416{
1417 struct wire_us wus;
1418 wus.x = atoi(pus->x);
1419 memcpy(buffer, &wus, sizeof wus);
1420 return buffer + sizeof wus;
1421}

◆ us_t_UserSize()

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

Definition at line 1409 of file server.c.

1410{
1411 return start + sizeof(struct wire_us);
1412}

◆ us_t_UserUnmarshal()

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

Definition at line 1424 of file server.c.

1425{
1426 struct wire_us wus;
1427 memcpy(&wus, buffer, sizeof wus);
1428 pus->x = HeapAlloc(GetProcessHeap(), 0, 10);
1429 sprintf(pus->x, "%d", wus.x);
1430 return buffer + sizeof wus;
1431}

◆ 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 2136 of file server.c.

2137{
2139
2140 trace("waiting\n");
2142