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.

105 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. bind.c
  5. Abstract:
  6. Routines which use RPC to bind and unbind the client to the STI server
  7. Environment:
  8. User Mode -Win32
  9. Author:
  10. Vlad Sadovsky (vlads) 26-Jan-1997
  11. Revision History:
  12. 26-Jan-1997 VladS created
  13. --*/
  14. #include "pch.h"
  15. #include "apiutil.h"
  16. #include <stirpc.h>
  17. handle_t
  18. STI_STRING_HANDLE_bind(
  19. STI_STRING_HANDLE ServerName
  20. )
  21. /*++
  22. Routine Description:
  23. This routine is called from the STI client stubs when
  24. it is necessary create an RPC binding to the server end
  25. Arguments:
  26. ServerName - A pointer to a string containing the name of the server
  27. to bind with.
  28. Return Value:
  29. The binding handle is returned to the stub routine. If the bind is
  30. unsuccessful, a NULL will be returned.
  31. --*/
  32. {
  33. handle_t BindHandle;
  34. RPC_STATUS RpcStatus;
  35. RpcStatus = RpcBindHandleForServer(&BindHandle,
  36. (LPWSTR)ServerName,
  37. STI_INTERFACE_W,
  38. PROT_SEQ_NP_OPTIONS_W
  39. );
  40. return BindHandle;
  41. } // STI_STRING_HANDLE_bind()
  42. void
  43. STI_STRING_HANDLE_unbind(
  44. STI_STRING_HANDLE ServerName,
  45. handle_t BindHandle
  46. )
  47. /*++
  48. Routine Description:
  49. This routine calls a common unbind routine
  50. Arguments:
  51. ServerName - This is the name of the server from which to unbind.
  52. BindingHandle - This is the binding handle that is to be closed.
  53. Return Value:
  54. None.
  55. --*/
  56. {
  57. UNREFERENCED_PARAMETER(ServerName);
  58. (VOID ) RpcBindHandleFree(&BindHandle);
  59. return;
  60. } // STI_STRING_HANDLE_unbind()
  61. /****************************** End Of File ******************************/