|
|
1.1 root 1: /****************************************************************************
2: Microsoft RPC Version 1.0
3: Copyright Microsoft Corp. 1992
4: Callback Example
5:
6: FILE: callp.c
7:
8: PURPOSE: Remote procedures that are linked with the server
9: side of RPC distributed application
10:
11: FUNCTIONS: Fibonacci() -
12:
13: COMMENTS: This sample program generates a Fibonacci number by
14: static callback.
15:
16: ****************************************************************************/
17:
18: #include <stdlib.h>
19: #include <stdio.h>
20: #include "call.h" // header file generated by MIDL compiler
21:
22: short Fibonacci(short n)
23: {
24: short nsub1, nsub2;
25:
26: printf("Fibonacci() called with value %d\n", n);
27: if ((n == 0) || (n == 1))
28: return(1);
29: else {
30: nsub1 = n - 1;
31: nsub2 = n - 2;
32: return(Fibonacci2(nsub1) + Fibonacci2(nsub2));
33: }
34: }
35:
36: void Shutdown(void)
37: {
38: RPC_STATUS status;
39:
40: printf("calling RpcMgmtStopServerListening\n");
41: status = RpcMgmtStopServerListening(NULL);
42: printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
43: if (status) {
44: exit(status);
45: }
46:
47: printf("calling RpcServerUnregisterIf\n");
48: status = RpcServerUnregisterIf(NULL, NULL, FALSE);
49: printf("RpcServerUnregisterIf returned 0x%x\n", status);
50: if (status) {
51: exit(status);
52: }
53: }
54:
55: /* end file callp.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.