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 / usrdef / usrdefp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-11  |  1.3 KB  |  46 lines

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