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.

149 lines
3.6 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. rpcutil.h
  5. Abstract:
  6. This file contains prototypes for the bind and unbind functions that
  7. all net api stub functions will call. It also includes the allocate
  8. and free routines used by the MIDL generated RPC stubs.
  9. Other function prototypes defined here are RPC helper routines to
  10. start and stop the RPC server, and the RPC status to Net API status
  11. mapping function.
  12. Author:
  13. Dan Lafferty danl 06-Feb-1991
  14. Environment:
  15. User Mode - Win32
  16. Revision History:
  17. 06-Feb-1991 danl
  18. Created
  19. 26-Apr-1991 JohnRo
  20. Added IN and OUT keywords to MIDL functions. Commented-out
  21. (nonstandard) identifier on endif. Deleted tabs.
  22. 23-Oct-1991 Danl
  23. Added NetpInitRpcServer().
  24. 03-Dec-1991 JohnRo
  25. Added MIDL_user_reallocate and MIDL_user_size APIs. (These are so we
  26. create the NetApiBufferAllocate, NetApiBufferReallocate, and
  27. NetApiBufferSize APIs.)
  28. 20-Jul-1992 JohnRo
  29. RAID 2252: repl should prevent export on Windows/NT.
  30. Reordered this change history.
  31. 01-Dec-1992 JohnRo
  32. Fix MIDL_user_ func signatures.
  33. --*/
  34. #ifndef _RPCUTIL_
  35. #define _RPCUTIL_
  36. #include <lmcons.h>
  37. #ifndef RPC_NO_WINDOWS_H // Don't let rpc.h include windows.h
  38. #define RPC_NO_WINDOWS_H
  39. #endif // RPC_NO_WINDOWS_H
  40. #include <rpc.h> // __RPC_FAR, etc.
  41. //
  42. // DEFINES
  43. //
  44. //
  45. // The following typedefs are created for use in the net api Enum entry point
  46. // routines. These structures are meant to mirror the level specific
  47. // info containers that are specified in the .idl file for the Enum API
  48. // function. Using these structures to set up for the API call allows
  49. // the entry point routine to avoid using any bulky level-specific logic
  50. // to set-up or return from the RPC stub call.
  51. //
  52. typedef struct _GENERIC_INFO_CONTAINER {
  53. DWORD EntriesRead;
  54. LPBYTE Buffer;
  55. } GENERIC_INFO_CONTAINER, *PGENERIC_INFO_CONTAINER, *LPGENERIC_INFO_CONTAINER ;
  56. typedef struct _GENERIC_ENUM_STRUCT {
  57. DWORD Level;
  58. PGENERIC_INFO_CONTAINER Container;
  59. } GENERIC_ENUM_STRUCT, *PGENERIC_ENUM_STRUCT, *LPGENERIC_ENUM_STRUCT ;
  60. #define NT_PIPE_PREFIX TEXT("\\PIPE\\")
  61. //
  62. // Function Prototypes - routines called by MIDL-generated code:
  63. //
  64. void __RPC_FAR * __RPC_API
  65. MIDL_user_allocate(
  66. IN size_t NumBytes
  67. );
  68. void __RPC_API
  69. MIDL_user_free(
  70. IN void __RPC_FAR *MemPointer
  71. );
  72. //
  73. // Function Prototypes - routines to go along with the above, but aren't
  74. // needed by MIDL or any other non-network software.
  75. //
  76. void *
  77. MIDL_user_reallocate(
  78. IN void * OldPointer OPTIONAL,
  79. IN size_t NewByteCount
  80. );
  81. unsigned long
  82. MIDL_user_size(
  83. IN void * Pointer
  84. );
  85. //
  86. // Function Prototypes - private network routines.
  87. //
  88. RPC_STATUS
  89. NetpBindRpc(
  90. IN LPTSTR servername,
  91. IN LPTSTR servicename,
  92. IN LPTSTR networkoptions,
  93. OUT RPC_BINDING_HANDLE * pBindingHandle
  94. );
  95. // We do not need any longer NetpRpcStatusToApiStatus() mapping
  96. // But for now, rather than eliminating a few references to it in
  97. // the net tree, we just stub it out.
  98. // NET_API_STATUS
  99. // NetpRpcStatusToApiStatus(
  100. // IN RPC_STATUS RpcStatus
  101. // );
  102. #define NetpRpcStatusToApiStatus(RpcStatus) ((NET_API_STATUS)(RpcStatus))
  103. RPC_STATUS
  104. NetpUnbindRpc(
  105. IN RPC_BINDING_HANDLE BindingHandle
  106. );
  107. #endif // _RPCUTIL_
  108.