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.

192 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. infobind.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. --*/
  17. #define UNICODE
  18. #include <nt.h>
  19. #include <ntrtl.h>
  20. #include <nturtl.h>
  21. #include <windef.h>
  22. #include <info_cli.h>
  23. #include <inetinfo.h>
  24. #include "apiutil.h"
  25. handle_t
  26. INET_INFO_IMPERSONATE_HANDLE_bind(
  27. INET_INFO_IMPERSONATE_HANDLE ServerName
  28. )
  29. /*++
  30. Routine Description:
  31. This routine is called from the inet info admin client stubs when
  32. it is necessary create an RPC binding to the server end with
  33. impersonation level of security
  34. Arguments:
  35. ServerName - A pointer to a string containing the name of the server
  36. to bind with.
  37. Return Value:
  38. The binding handle is returned to the stub routine. If the bind is
  39. unsuccessful, a NULL will be returned.
  40. --*/
  41. {
  42. handle_t BindHandle;
  43. RPC_STATUS RpcStatus;
  44. RpcStatus = RpcBindHandleForServer(&BindHandle,
  45. ServerName,
  46. INET_INFO_INTERFACE_NAME,
  47. PROT_SEQ_NP_OPTIONS_W
  48. );
  49. return BindHandle;
  50. } // INET_INFO_IMPERSONATE_HANDLE_bind()
  51. handle_t
  52. INET_INFO_IDENTIFY_HANDLE_bind(
  53. INET_INFO_IDENTIFY_HANDLE ServerName
  54. )
  55. /*++
  56. Routine Description:
  57. This routine is called from the inet admin client stubs when
  58. it is necessary create an RPC binding to the server end with
  59. identification level of impersonation.
  60. Arguments:
  61. ServerName - A pointer to a string containing the name of the server
  62. to bind with.
  63. Return Value:
  64. The binding handle is returned to the stub routine. If the bind is
  65. unsuccessful, a NULL will be returned.
  66. --*/
  67. {
  68. handle_t BindHandle;
  69. RPC_STATUS RpcStatus;
  70. RpcStatus = RpcBindHandleForServer(&BindHandle,
  71. ServerName,
  72. INET_INFO_INTERFACE_NAME,
  73. PROT_SEQ_NP_OPTIONS_W
  74. );
  75. return BindHandle;
  76. } // INET_INFO_IDENTITY_HANDLE_bind()
  77. void
  78. INET_INFO_IMPERSONATE_HANDLE_unbind(
  79. INET_INFO_IMPERSONATE_HANDLE ServerName,
  80. handle_t BindHandle
  81. )
  82. /*++
  83. Routine Description:
  84. This routine calls a common unbind routine that is shared by all services.
  85. This routine is called from the inet admin client stubs when it is
  86. necessary to unbind from the server end.
  87. Arguments:
  88. ServerName - This is the name of the server from which to unbind.
  89. BindingHandle - This is the binding handle that is to be closed.
  90. Return Value:
  91. None.
  92. --*/
  93. {
  94. UNREFERENCED_PARAMETER(ServerName);
  95. (VOID ) RpcBindHandleFree(&BindHandle);
  96. return;
  97. } // INET_INFO_IMPERSONATE_HANDLE_unbind()
  98. void
  99. INET_INFO_IDENTIFY_HANDLE_unbind(
  100. INET_INFO_IDENTIFY_HANDLE ServerName,
  101. handle_t BindHandle
  102. )
  103. /*++
  104. Routine Description:
  105. This routine calls a common unbind routine that is shared by all services.
  106. This routine is called from the inet admin client stubs when it is
  107. necessary to unbind from a server.
  108. Arguments:
  109. ServerName - This is the name of the server from which to unbind.
  110. BindingHandle - This is the binding handle that is to be closed.
  111. Return Value:
  112. None.
  113. --*/
  114. {
  115. UNREFERENCED_PARAMETER(ServerName);
  116. (VOID ) RpcBindHandleFree(&BindHandle);
  117. return;
  118. } // INET_INFO_IDENTITY_HANDLE_unbind()
  119. /****************************** End Of File ******************************/