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 / handles / auto / autop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-11  |  1.3 KB  |  48 lines

  1. /****************************************************************************
  2.                    Microsoft RPC Version 2.0
  3.            Copyright Microsoft Corp. 1992, 1993, 1994- 1996
  4.                         Auto Example
  5.  
  6.     FILE:       autop.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:   This distributed application uses an auto handle.
  14.  
  15. ****************************************************************************/
  16.  
  17. #include <stdlib.h>
  18. #include <stdio.h>
  19. #include <time.h>
  20. #include "auto.h"    // header file generated by MIDL compiler
  21.  
  22. void GetTime(time_t * pTime)
  23. {
  24.     time(pTime);
  25.     return;
  26. }
  27.  
  28. void Shutdown(void)
  29. {
  30.     RPC_STATUS status;
  31.  
  32.     printf("Calling RpcMgmtStopServerListening\n");
  33.     status = RpcMgmtStopServerListening(NULL);
  34.     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
  35.     if (status) {
  36.         exit(status);
  37.     }
  38.  
  39.     printf("Calling RpcServerUnregisterIf\n");
  40.     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
  41.     printf("RpcServerUnregisterIf returned 0x%x\n", status);
  42.     if (status) {
  43.         exit(status);
  44.     }
  45. }
  46.  
  47. /* end file autop.c */
  48.