ReactOS 0.4.15-dev-8235-gcd88a97
server.c
Go to the documentation of this file.
1#include <stdlib.h>
2#include <stdio.h>
3#include <ctype.h>
4#include "ctx.h"
5
6void CtxOpen( PCTXTYPE *pphContext,
7 long Value)
8{
9 printf("CtxOpen(): Value=%d\n",Value);
10 *pphContext = (PCTXTYPE)midl_user_allocate( sizeof(CTXTYPE) );
11 **pphContext = Value;
12}
13
14void CtxHello( PCTXTYPE phContext )
15{
16 printf("CtxHello(): Hello, World! Context value: %d\n", *phContext);
17}
18
19void CtxClose(PCTXTYPE *pphContext )
20{
21 printf("CtxClose(): %d\n", **pphContext);
22 midl_user_free(*pphContext);
23 *pphContext = NULL;
24}
25
26
27void main()
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}
60
61
63 PCTXTYPE hContext)
64{
65 PCTXTYPE pCtx = (PCTXTYPE)hContext;
66 printf("Context rundown: Value=%d \n", *pCtx);
67 midl_user_free(hContext);
68}
69
71{
72 return(malloc(len));
73}
74
76{
77 free(ptr);
78}
long CTXTYPE
Definition: ctx.h:46
RPC_IF_HANDLE hello_v1_0_s_ifspec
Definition: ctx_s.c:61
CTXTYPE __RPC_FAR * PCTXTYPE
Definition: ctx.h:48
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define printf
Definition: freeldr.h:97
GLenum GLsizei len
Definition: glext.h:6722
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,...)
static PVOID ptr
Definition: dispmode.c:27
void __RPC_USER PCTXTYPE_rundown(PCTXTYPE hContext)
Definition: server.c:62
void CtxOpen(PCTXTYPE *pphContext, long Value)
Definition: server.c:6
void CtxHello(PCTXTYPE phContext)
Definition: server.c:14
void main()
Definition: server.c:27
void CtxClose(PCTXTYPE *pphContext)
Definition: server.c:19
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
#define midl_user_free
Definition: rpc.h:45
#define __RPC_FAR
Definition: rpc.h:56
long RPC_STATUS
Definition: rpc.h:52
#define __RPC_USER
Definition: rpc.h:65
#define midl_user_allocate
Definition: rpc.h:44
#define exit(n)
Definition: config.h:202
Definition: ps.c:97
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413