|
|
1.1 root 1: /****************************************************************************
2: Microsoft RPC Version 1.0
3: Copyright Microsoft Corp. 1992
4: inout Example
5:
6: FILE: inoutp.c
7: PURPOSE: Remote procedures that are linked with the server
8: side of RPC distributed application
9: FUNCTIONS: InOutProc() - demonstrates in, out parameters
10: COMMENTS:
11:
12: ****************************************************************************/
13: #include <stdlib.h>
14: #include <stdio.h> // printf
15: #include <rpc.h>
16: #include "inout.h"
17:
18: #define CONSTANT 257
19:
20: void InOutProc(short s1,
21: short * ps2,
22: float * pf3)
23: {
24: printf("on entry, *pf3 = %f\n", *pf3);
25:
26: *pf3 = (float) s1 / (float) *ps2;
27: printf("%d / %d = %0.3f\n", s1, *ps2, *pf3);
28:
29: *ps2 = (short)CONSTANT - s1;
30: printf("%d - %d = %d\n", CONSTANT, s1, *ps2);
31:
32: s1++;
33:
34: return;
35: }
36:
37: void Shutdown(void)
38: {
39: RPC_STATUS status;
40:
41: printf("Calling RpcMgmtStopServerListening\n");
42: status = RpcMgmtStopServerListening(NULL);
43: printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
44: if (status) {
45: exit(2);
46: }
47:
48: printf("Calling RpcServerUnregisterIf\n");
49: status = RpcServerUnregisterIf(NULL, NULL, FALSE);
50: printf("RpcServerUnregisterIf returned 0x%x\n", status);
51: if (status) {
52: exit(2);
53: }
54: }
55: /* end of file \inoutp.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.