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 / ns / nhello / nhellop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-11  |  1.2 KB  |  46 lines

  1. /****************************************************************************
  2.                    Microsoft RPC Version 2.0
  3.            Copyright Microsoft Corp. 1992, 1993, 1994- 1996
  4.                        nhello Example
  5.  
  6.     FILE:       nhellop.c
  7.  
  8.     PURPOSE:    Remote procedures that are linked with the server
  9.                 side of RPC distributed application
  10.  
  11.     FUNCTIONS:  TimeProc() - obtains the time from the server
  12.  
  13.     COMMENTS:
  14.  
  15. ****************************************************************************/
  16.  
  17. #include <stdlib.h>
  18. #include <stdio.h>
  19. #include <time.h>
  20. #include "nhello.h"    // header file generated by MIDL compiler
  21.  
  22. void HelloProc(handle_t hHello, unsigned char *pszString)
  23. {
  24.     printf("%s\n", pszString);
  25.     return;
  26. }
  27.  
  28. void Shutdown(handle_t hHello)
  29. {
  30.     RPC_STATUS status;
  31.  
  32.     printf("Calling RpcMgmtIsServerListening\n");
  33.     status = RpcMgmtIsServerListening(NULL);
  34.     printf("RpcMgmtIsServerListening returned: 0x%x\n", status);
  35.  
  36.     if ( status == RPC_S_OK )
  37.     {
  38.         printf("Calling RpcMgmtStopServerListening\n");
  39.         status = RpcMgmtStopServerListening(NULL);
  40.         printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
  41.     }
  42.  
  43. }
  44.  
  45. /* end file nhellop.c */
  46.