home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / hello / hellop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-11  |  1.6 KB  |  51 lines

  1. /****************************************************************************
  2.                    Microsoft RPC Version 2.0
  3.            Copyright Microsoft Corp. 1992, 1993, 1994- 1996
  4.                         Hello Example
  5.  
  6.     FILE:       hellop.c
  7.  
  8.     PURPOSE:    Remote procedures that are linked with the server
  9.                 side of RPC distributed application
  10.  
  11.     FUNCTIONS:  HelloProc() - prints "hello, world" or other string
  12.                 sent by client to server
  13.  
  14.     COMMENTS:   This version of the distributed application that prints
  15.                 "hello, world" (or other string) on the server features
  16.                 a client that manages its connection to the server.
  17.                 It uses the binding handle hello_IfHandle, defined in
  18.                 the file hello.h.
  19.  
  20. ****************************************************************************/
  21.  
  22. #include <stdlib.h>
  23. #include <stdio.h>
  24. #include "hello.h"    // header file generated by MIDL compiler
  25.  
  26. void HelloProc(unsigned char * pszString)
  27. {
  28.     printf("%s\n", pszString);
  29. }
  30.  
  31. void Shutdown(void)
  32. {
  33.     RPC_STATUS status;
  34.  
  35.     printf("Calling RpcMgmtStopServerListening\n");
  36.     status = RpcMgmtStopServerListening(NULL);
  37.     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
  38.     if (status) {
  39.        exit(status);
  40.     }
  41.  
  42.     printf("Calling RpcServerUnregisterIf\n");
  43.     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
  44.     printf("RpcServerUnregisterIf returned 0x%x\n", status);
  45.     if (status) {
  46.        exit(status);
  47.     }
  48. }
  49.  
  50. /* end file hellop.c */
  51.