Leaked source code of windows server 2003
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.

111 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. srvbind.c
  5. Abstract:
  6. Contains the RPC bind and un-bind routines for the Server
  7. Service.
  8. Author:
  9. Dan Lafferty (danl) 01-Mar-1991
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. 01-Mar-1991 danl
  14. created
  15. 07-Jun-1991 JohnRo
  16. Allowed debug output of failures.
  17. --*/
  18. //
  19. // INCLUDES
  20. //
  21. #include <nt.h> // DbgPrint prototype
  22. #include <rpc.h> // DataTypes and runtime APIs
  23. #include <srvsvc.h> // generated by the MIDL complier
  24. #include <rpcutil.h> // NetRpc utils
  25. #include <netlib.h> // UNUSED macro
  26. #include <srvnames.h> // SERVER_INTERFACE_NAME
  27. handle_t
  28. SRVSVC_HANDLE_bind (
  29. SRVSVC_HANDLE ServerName)
  30. /*++
  31. Routine Description:
  32. This routine calls a common bind routine that is shared by all services.
  33. This routine is called from the server service client stubs when
  34. it is necessary to bind to a server.
  35. Arguments:
  36. ServerName - A pointer to a string containing the name of the server
  37. to bind with.
  38. Return Value:
  39. The binding handle is returned to the stub routine. If the
  40. binding is unsuccessful, a NULL will be returned.
  41. --*/
  42. {
  43. handle_t bindingHandle;
  44. RPC_STATUS status;
  45. status = NetpBindRpc (
  46. ServerName,
  47. SERVER_INTERFACE_NAME,
  48. TEXT("Security=Impersonation Dynamic False"),
  49. &bindingHandle);
  50. return( bindingHandle);
  51. }
  52. void
  53. SRVSVC_HANDLE_unbind (
  54. SRVSVC_HANDLE ServerName,
  55. handle_t BindingHandle)
  56. /*++
  57. Routine Description:
  58. This routine calls a common unbind routine that is shared by
  59. all services.
  60. This routine is called from the server service client stubs when
  61. it is necessary to unbind to a server.
  62. Arguments:
  63. ServerName - This is the name of the server from which to unbind.
  64. BindingHandle - This is the binding handle that is to be closed.
  65. Return Value:
  66. none.
  67. --*/
  68. {
  69. UNUSED(ServerName); // This parameter is not used
  70. NetpUnbindRpc ( BindingHandle);
  71. return;
  72. }