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.

68 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. ConfBridge.cpp
  5. Abstract:
  6. Implementations for bridge terminal creation
  7. Author:
  8. Qianbo Huai (qhuai) 1/21/2000
  9. --*/
  10. #include "stdafx.h"
  11. #include <bridge.h>
  12. #include "ConfBridge.h"
  13. /*//////////////////////////////////////////////////////////////////////////////
  14. Creates bridge terminal
  15. ////*/
  16. STDMETHODIMP
  17. CConfBridge::CreateBridgeTerminal (
  18. long lMediaType,
  19. ITTerminal **ppTerminal
  20. )
  21. {
  22. ENTER_FUNCTION("CIPConfBridge::CreateBridgeTerminal");
  23. BGLOG((BG_TRACE, "%s entered", __fxName));
  24. if (IsBadWritePtr(ppTerminal, sizeof(void *)))
  25. {
  26. LOG ((BG_ERROR, "%x receives bad write pointer", __fxName));
  27. return E_POINTER;
  28. }
  29. HRESULT hr;
  30. // Make sure we support the requested media type.
  31. if ( ! IsValidSingleMediaType( (DWORD) lMediaType,
  32. TAPIMEDIATYPE_AUDIO | TAPIMEDIATYPE_VIDEO ) )
  33. {
  34. BGLOG((BG_ERROR, "%s, bad media type %d", __fxName, lMediaType));
  35. return E_INVALIDARG;
  36. }
  37. // create the bridge terminal with the desired media type.
  38. ITTerminal *pTerminal;
  39. hr = CIPConfBridgeTerminal::CreateTerminal(
  40. (DWORD)lMediaType,
  41. NULL, // msp address
  42. &pTerminal
  43. );
  44. if (FAILED (hr))
  45. {
  46. BGLOG ((BG_ERROR, "%s, Create bridge terminal failed. hr=%x", __fxName, hr));
  47. return E_INVALIDARG;
  48. }
  49. *ppTerminal = pTerminal;
  50. return hr;
  51. }