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.

102 lines
2.4 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: vsl.cpp
  4. //
  5. // Description:
  6. //
  7. // Virtual Source Line Class
  8. //
  9. //@@BEGIN_MSINTERNAL
  10. // Development Team:
  11. // Mike McLaughlin
  12. //
  13. // History: Date Author Comment
  14. //
  15. // To Do: Date Author Comment
  16. //
  17. //@@END_MSINTERNAL
  18. //
  19. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  20. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  21. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  22. // PURPOSE.
  23. //
  24. // Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
  25. //
  26. //---------------------------------------------------------------------------
  27. #include "common.h"
  28. //---------------------------------------------------------------------------
  29. PLIST_VIRTUAL_SOURCE_LINE gplstVirtualSourceLine = NULL;
  30. ULONG gcVirtualSources = 0;
  31. //---------------------------------------------------------------------------
  32. //---------------------------------------------------------------------------
  33. #pragma INIT_CODE
  34. #pragma INIT_DATA
  35. NTSTATUS
  36. InitializeVirtualSourceLine(
  37. )
  38. {
  39. if(gplstVirtualSourceLine == NULL) {
  40. gplstVirtualSourceLine = new LIST_VIRTUAL_SOURCE_LINE;
  41. if(gplstVirtualSourceLine == NULL) {
  42. return(STATUS_INSUFFICIENT_RESOURCES);
  43. }
  44. }
  45. return(STATUS_SUCCESS);
  46. }
  47. #pragma PAGEABLE_CODE
  48. #pragma PAGEABLE_DATA
  49. VOID
  50. UninitializeVirtualSourceLine(
  51. )
  52. {
  53. delete gplstVirtualSourceLine;
  54. gplstVirtualSourceLine = NULL;
  55. }
  56. //---------------------------------------------------------------------------
  57. CVirtualSourceLine::CVirtualSourceLine(
  58. PSYSAUDIO_CREATE_VIRTUAL_SOURCE pCreateVirtualSource
  59. )
  60. {
  61. ASSERT(gplstVirtualSourceLine != NULL);
  62. //
  63. // NOTE: Virtual pins must end up first before the hardware's
  64. // pins so wdmaud mixer line parsing works correctly.
  65. //
  66. AddListEnd(gplstVirtualSourceLine);
  67. if(pCreateVirtualSource->Property.Id ==
  68. KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE_ONLY) {
  69. ulFlags |= VSL_FLAGS_CREATE_ONLY;
  70. }
  71. RtlCopyMemory(
  72. &guidCategory,
  73. &pCreateVirtualSource->PinCategory,
  74. sizeof(GUID));
  75. RtlCopyMemory(
  76. &guidName,
  77. &pCreateVirtualSource->PinName,
  78. sizeof(GUID));
  79. iVirtualSource = gcVirtualSources++;
  80. }
  81. CVirtualSourceLine::~CVirtualSourceLine(
  82. )
  83. {
  84. RemoveList(gplstVirtualSourceLine);
  85. gcVirtualSources--;
  86. }