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.

194 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. nntpbind.c
  5. Abstract:
  6. Routines which use RPC to bind and unbind the client to the common
  7. internet Admin APIs.
  8. Author:
  9. Madan Appiah (madana) 10-Oct-1995
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. Madan Appiah (madana) 10-Oct-1995 Created.
  14. Murali R. Krishnan (MuraliK) 15-Nov-1995 Remove Netp routines
  15. Murali R. Krishnan (MuraliK) 21-Nov-1995 Support TCP/IP binding
  16. Rajeev Rajan (rajeevr) 26-Feb-1997 Moved from K2 tree for nntp
  17. --*/
  18. #define UNICODE
  19. #include <nt.h>
  20. #include <ntrtl.h>
  21. #include <nturtl.h>
  22. #include <windef.h>
  23. #include <nntpsvc.h>
  24. #include <inetinfo.h>
  25. #include <norminfo.h>
  26. #include "apiutil.h"
  27. handle_t
  28. NNTP_IMPERSONATE_HANDLE_bind(
  29. NNTP_IMPERSONATE_HANDLE ServerName
  30. )
  31. /*++
  32. Routine Description:
  33. This routine is called from the inet info admin client stubs when
  34. it is necessary create an RPC binding to the server end with
  35. impersonation level of security
  36. Arguments:
  37. ServerName - A pointer to a string containing the name of the server
  38. to bind with.
  39. Return Value:
  40. The binding handle is returned to the stub routine. If the bind is
  41. unsuccessful, a NULL will be returned.
  42. --*/
  43. {
  44. handle_t BindHandle;
  45. RPC_STATUS RpcStatus;
  46. RpcStatus = RpcBindHandleForServer(&BindHandle,
  47. ServerName,
  48. NNTP_INTERFACE_NAME,
  49. PROT_SEQ_NP_OPTIONS_W
  50. );
  51. return BindHandle;
  52. } // NNTP_IMPERSONATE_HANDLE_bind()
  53. handle_t
  54. NNTP_HANDLE_bind(
  55. NNTP_HANDLE ServerName
  56. )
  57. /*++
  58. Routine Description:
  59. This routine is called from the inet admin client stubs when
  60. it is necessary create an RPC binding to the server end with
  61. identification level of impersonation.
  62. Arguments:
  63. ServerName - A pointer to a string containing the name of the server
  64. to bind with.
  65. Return Value:
  66. The binding handle is returned to the stub routine. If the bind is
  67. unsuccessful, a NULL will be returned.
  68. --*/
  69. {
  70. handle_t BindHandle;
  71. RPC_STATUS RpcStatus;
  72. RpcStatus = RpcBindHandleForServer(&BindHandle,
  73. ServerName,
  74. NNTP_INTERFACE_NAME,
  75. PROT_SEQ_NP_OPTIONS_W
  76. );
  77. return BindHandle;
  78. } // NNTP_HANDLE_bind()
  79. void
  80. NNTP_IMPERSONATE_HANDLE_unbind(
  81. NNTP_IMPERSONATE_HANDLE ServerName,
  82. handle_t BindHandle
  83. )
  84. /*++
  85. Routine Description:
  86. This routine calls a common unbind routine that is shared by all services.
  87. This routine is called from the inet admin client stubs when it is
  88. necessary to unbind from the server end.
  89. Arguments:
  90. ServerName - This is the name of the server from which to unbind.
  91. BindingHandle - This is the binding handle that is to be closed.
  92. Return Value:
  93. None.
  94. --*/
  95. {
  96. UNREFERENCED_PARAMETER(ServerName);
  97. (VOID ) RpcBindHandleFree(&BindHandle);
  98. return;
  99. } // NNTP_IMPERSONATE_HANDLE_unbind()
  100. void
  101. NNTP_HANDLE_unbind(
  102. NNTP_HANDLE ServerName,
  103. handle_t BindHandle
  104. )
  105. /*++
  106. Routine Description:
  107. This routine calls a common unbind routine that is shared by all services.
  108. This routine is called from the inet admin client stubs when it is
  109. necessary to unbind from a server.
  110. Arguments:
  111. ServerName - This is the name of the server from which to unbind.
  112. BindingHandle - This is the binding handle that is to be closed.
  113. Return Value:
  114. None.
  115. --*/
  116. {
  117. UNREFERENCED_PARAMETER(ServerName);
  118. (VOID ) RpcBindHandleFree(&BindHandle);
  119. return;
  120. } // NNTP_IDENTITY_HANDLE_unbind()
  121. /****************************** End Of File ******************************/