ReactOS  0.4.14-dev-342-gdc047f9
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 }
smooth NULL
Definition: ftsmooth.c:416
#define printf
Definition: config.h:203
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: server.c:75

◆ 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 }
#define printf
Definition: config.h:203

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 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
CTXTYPE __RPC_FAR * PCTXTYPE
Definition: ctx.h:48
void __RPC_FAR *__RPC_USER midl_user_allocate(size_t len)
Definition: server.c:70
long CTXTYPE
Definition: ctx.h:46
#define printf
Definition: config.h:203

◆ 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 
50  status = RpcServerListen(1, 20, FALSE);
51 
52  if (status)
53  {
54  printf("RpcServerListen %x", status);
55  exit(status);
56  }
57 
58  scanf("%d", &i);
59 }
#define RpcServerUseProtseqEp
Definition: rpcdce.h:479
RPC_IF_HANDLE hello_v1_0_s_ifspec
Definition: ctx_s.c:61
_Check_return_ _CRTIMP int __cdecl scanf(_In_z_ _Scanf_format_string_ const char *_Format,...)
long RPC_STATUS
Definition: rpc.h:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1527
smooth NULL
Definition: ftsmooth.c:416
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1123
void exit(int exitcode)
Definition: _exit.c:33
static SERVICE_STATUS status
Definition: service.c:31
#define printf
Definition: config.h:203
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 }
GLenum GLsizei len
Definition: glext.h:6722
#define malloc
Definition: debug_ros.c:4

Referenced by CtxOpen(), s_get_numbers(), and s_get_numbers_struct().

◆ 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

Referenced by basic_tests(), CtxClose(), and PCTXTYPE_rundown().

◆ 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 }
CTXTYPE __RPC_FAR * PCTXTYPE
Definition: ctx.h:48
#define printf
Definition: config.h:203
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: server.c:75

Referenced by hello_CtxClose(), and hello_CtxOpen().