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.

94 lines
2.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1990 - 1999
  6. //
  7. // File: sinfoapi.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /* --------------------------------------------------------------------
  11. Microsoft OS/2 LAN Manager
  12. Copyright(c) Microsoft Corp., 1990
  13. -------------------------------------------------------------------- */
  14. /* --------------------------------------------------------------------
  15. File : sinfoapi.cxx
  16. -------------------------------------------------------------------- */
  17. #include <precomp.hxx>
  18. #include <hndlsvr.hxx>
  19. #include <thrdctx.hxx>
  20. /* --------------------------------------------------------------------
  21. A server thread calls this API to obtain the current call handle it should
  22. be using.
  23. -------------------------------------------------------------------- */
  24. RPC_BINDING_HANDLE RPC_ENTRY
  25. I_RpcGetCurrentCallHandle (
  26. )
  27. {
  28. #ifdef RPC_DELAYED_INITIALIZATION
  29. if ( RpcHasBeenInitialized == 0 )
  30. {
  31. RPC_STATUS RpcStatus;
  32. RpcStatus = PerformRpcInitialization();
  33. if ( RpcStatus != RPC_S_OK )
  34. return((RPC_BINDING_HANDLE) 0);
  35. }
  36. #endif // RPC_DELAYED_INITIALIZATION
  37. return(RpcpGetThreadContext());
  38. }
  39. /* --------------------------------------------------------------------
  40. -------------------------------------------------------------------- */
  41. RPC_STATUS RPC_ENTRY
  42. I_RpcServerInqTransportType(
  43. OUT unsigned int __RPC_FAR * Type
  44. )
  45. /*++
  46. Routine Description:
  47. Determines what kind of transport on the current thread
  48. Arguments:
  49. Type - Points to the type of binding if the functions succeeds.
  50. One of:
  51. TRANSPORT_TYPE_CN
  52. TRANSPORT_TYPE_DG
  53. TRANSPORT_TYPE_LPC
  54. TRANSPORT_TYPE_WMSG
  55. Return Value:
  56. RPC_S_OK - The operation completed successfully.
  57. RPC_S_INVALID_BINDING - When the argument is not a binding handle.
  58. --*/
  59. {
  60. SCALL *SCall ;
  61. AssertRpcInitialized();
  62. ASSERT(!RpcpCheckHeap());
  63. SCall = (SCALL *) RpcpGetThreadContext() ;
  64. if (!SCall)
  65. {
  66. return (RPC_S_NO_CALL_ACTIVE) ;
  67. }
  68. return (SCall->InqTransportType(Type)) ;
  69. }