Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name :
  4. gdbind.c
  5. Abstract:
  6. Routines that use RPC bind and unbind of the client to
  7. Gopher service.
  8. Author:
  9. Murali R. Krishnan ( MuraliK ) 15-Nov-1994
  10. Project:
  11. Gopher Server Admin DLL
  12. Functions Exported:
  13. GOPHERD_IMPERSONATE_HANDLE_bind()
  14. GOPHERD_IMPERSONATE_HANDLE_unbind()
  15. Revision History:
  16. MuraliK 15-Nov-1995 Modified to support binding w/o Net api functions
  17. MuraliK 21-Dec-1995 Support binding over TCP/IP
  18. --*/
  19. /************************************************************
  20. * Include Headers
  21. ************************************************************/
  22. # define UNICODE
  23. # include <nt.h>
  24. # include <ntrtl.h>
  25. # include <nturtl.h>
  26. # include <windef.h>
  27. # include "gd_cli.h"
  28. # include "apiutil.h"
  29. /************************************************************
  30. * Functions
  31. ************************************************************/
  32. handle_t
  33. GOPHERD_IMPERSONATE_HANDLE_bind(
  34. IN GOPHERD_IMPERSONATE_HANDLE pszServer
  35. )
  36. /*++
  37. Description:
  38. This function is called by Gopher service admin client stubs
  39. when it is necessary to create an RPC binding to the server end
  40. with the impersonation level of security.
  41. Arguments:
  42. pszServer
  43. pointer to null-terminated string containing the name of the
  44. server to bind to.
  45. Returns:
  46. The binding handle required for the stub routine.
  47. If the bind is unsuccessful a NULL is returned.
  48. --*/
  49. {
  50. handle_t hBinding = NULL;
  51. RPC_STATUS rpcStatus;
  52. rpcStatus = RpcBindHandleForServer(&hBinding,
  53. pszServer,
  54. GOPHERD_INTERFACE_NAME,
  55. PROT_SEQ_NP_OPTIONS_W
  56. );
  57. return ( hBinding);
  58. } // GOPHERD_IMPERSONATE_HANDLE_bind()
  59. void
  60. GOPHERD_IMPERSONATE_HANDLE_unbind(
  61. GOPHERD_IMPERSONATE_HANDLE pszServer,
  62. handle_t hBinding
  63. )
  64. /*++
  65. Description:
  66. This function calls the common unbind routine shared by all services.
  67. This function is called by the Gopher service client stubs when it is
  68. required to unbind from the server end.
  69. Arguments:
  70. pszServer
  71. pointer to a null-terminated string containing the name of server
  72. from which to unbind.
  73. hBinding
  74. handle that is to be closed by unbinding
  75. Returns:
  76. None
  77. --*/
  78. {
  79. UNREFERENCED_PARAMETER( pszServer);
  80. (VOID ) RpcBindHandleFree(& hBinding);
  81. return;
  82. } // GOPHERD_IMPERSONATE_HANDLE_unbind()
  83. /************************ End of File ***********************/