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.

113 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. atbind.c
  5. Abstract:
  6. Routines which use RPC to bind and unbind the client to the schedule
  7. service.
  8. Author:
  9. Vladimir Z. Vulovic (vladimv) 06 - November - 1992
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. 06-Nov-1992 vladimv
  14. Created
  15. --*/
  16. #include "atclient.h"
  17. handle_t
  18. ATSVC_HANDLE_bind(
  19. ATSVC_HANDLE ServerName
  20. )
  21. /*++
  22. Routine Description:
  23. This routine calls a common bind routine that is shared by all services.
  24. This routine is called from the schedule service client stubs when
  25. it is necessary to bind to a server.
  26. Arguments:
  27. ServerName - A pointer to a string containing the name of the server
  28. to bind with.
  29. Return Value:
  30. The binding handle is returned to the stub routine. If the bind is
  31. unsuccessful, a NULL will be returned.
  32. --*/
  33. {
  34. handle_t BindingHandle;
  35. RPC_STATUS RpcStatus;
  36. RpcStatus = NetpBindRpc (
  37. (LPTSTR)ServerName,
  38. AT_INTERFACE_NAME,
  39. 0,
  40. &BindingHandle
  41. );
  42. #ifdef DEBUG
  43. if ( RpcStatus != ERRROR_SUCCESS) {
  44. DbgPrint("ATSVC_HANDLE_bind:NetpBindRpc RpcStatus=%d\n",RpcStatus);
  45. }
  46. DbgPrint("ATSVC_HANDLE_bind: handle=%d\n", BindingHandle);
  47. #endif
  48. return( BindingHandle);
  49. }
  50. void
  51. ATSVC_HANDLE_unbind(
  52. ATSVC_HANDLE ServerName,
  53. handle_t BindingHandle
  54. )
  55. /*++
  56. Routine Description:
  57. This routine calls a common unbind routine that is shared by all services.
  58. This routine is called from the Workstation service client stubs when it is
  59. necessary to unbind from the server end.
  60. Arguments:
  61. ServerName - This is the name of the server from which to unbind.
  62. BindingHandle - This is the binding handle that is to be closed.
  63. Return Value:
  64. None.
  65. --*/
  66. {
  67. UNREFERENCED_PARAMETER( ServerName);
  68. #ifdef DEBUG
  69. DbgPrint(" ATSVC_HANDLE_unbind: handle= 0x%x\n", BindingHandle);
  70. #endif // DEBUG
  71. NetpUnbindRpc( BindingHandle);
  72. }
  73.