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