ReactOS 0.4.16-dev-297-gc569aee
server.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "ctx.h"
Include dependency graph for server.c:

Go to the source code of this file.

Functions

void CtxOpen (PCTXTYPE *pphContext, long Value)
 
void CtxHello (PCTXTYPE phContext)
 
void CtxClose (PCTXTYPE *pphContext)
 
void main ()
 
void __RPC_USER PCTXTYPE_rundown (PCTXTYPE hContext)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (size_t len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 

Function Documentation

◆ CtxClose()

void CtxClose ( PCTXTYPE pphContext)

Definition at line 19 of file server.c.

20{
21 printf("CtxClose(): %d\n", **pphContext);
22 midl_user_free(*pphContext);
23 *pphContext = NULL;
24}
#define NULL
Definition: types.h:112
#define printf
Definition: freeldr.h:97
#define midl_user_free
Definition: rpc.h:45

◆ CtxHello()

void CtxHello ( PCTXTYPE  phContext)

Definition at line 14 of file server.c.

15{
16 printf("CtxHello(): Hello, World! Context value: %d\n", *phContext);
17}

Referenced by hello_CtxHello().

◆ CtxOpen()

void CtxOpen ( PCTXTYPE pphContext,
long  Value 
)

Definition at line 6 of file server.c.

8{
9 printf("CtxOpen(): Value=%d\n",Value);
10 *pphContext = (PCTXTYPE)midl_user_allocate( sizeof(CTXTYPE) );
11 **pphContext = Value;
12}
long CTXTYPE
Definition: ctx.h:46
CTXTYPE __RPC_FAR * PCTXTYPE
Definition: ctx.h:48
#define midl_user_allocate
Definition: rpc.h:44
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

◆ main()

void main ( void  )

Definition at line 27 of file server.c.

28{
30 unsigned int cMinCalls = 1;
31 unsigned int cMaxCalls = 20;
32 int i;
33
34 status = RpcServerUseProtseqEp("ncacn_np", 20, "\\pipe\\hello", NULL);
35
36 if (status)
37 {
38 printf("RpcServerUseProtseqEp %x\n", status);
39 exit(status);
40 }
41
43
44 if (status)
45 {
46 printf("RpcServerRegisterIf %x\n", status);
47 exit(status);
48 }
49
51
52 if (status)
53 {
54 printf("RpcServerListen %x", status);
55 exit(status);
56 }
57
58 scanf("%d", &i);
59}
RPC_IF_HANDLE hello_v1_0_s_ifspec
Definition: ctx_s.c:61
#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
_Check_return_ _CRTIMP int __cdecl scanf(_In_z_ _Scanf_format_string_ const char *_Format,...)
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
#define RpcServerUseProtseqEp
Definition: rpcdce.h:479
long RPC_STATUS
Definition: rpc.h:52
#define exit(n)
Definition: config.h:202
Definition: ps.c:97

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( size_t  len)

Definition at line 70 of file server.c.

71{
72 return(malloc(len));
73}
#define malloc
Definition: debug_ros.c:4
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 75 of file server.c.

76{
77 free(ptr);
78}
#define free
Definition: debug_ros.c:5
static PVOID ptr
Definition: dispmode.c:27

◆ PCTXTYPE_rundown()

void __RPC_USER PCTXTYPE_rundown ( PCTXTYPE  hContext)

Definition at line 62 of file server.c.

64{
65 PCTXTYPE pCtx = (PCTXTYPE)hContext;
66 printf("Context rundown: Value=%d \n", *pCtx);
67 midl_user_free(hContext);
68}

Referenced by hello_CtxClose(), and hello_CtxOpen().