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.
112 lines
2.7 KiB
112 lines
2.7 KiB
|
|
//---------------------------------------------------------------------------
|
|
//
|
|
// Module: vsl.cpp
|
|
//
|
|
// Description:
|
|
//
|
|
// Virtual Source Line Class
|
|
//
|
|
//@@BEGIN_MSINTERNAL
|
|
// Development Team:
|
|
// Mike McLaughlin
|
|
//
|
|
// History: Date Author Comment
|
|
//
|
|
// To Do: Date Author Comment
|
|
//
|
|
//@@END_MSINTERNAL
|
|
//
|
|
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
|
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
|
|
// PURPOSE.
|
|
//
|
|
// Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#if defined(_M_IA64)
|
|
#define USE_ALLOC_TEXT
|
|
#endif
|
|
#include "common.h"
|
|
|
|
#if defined(ALLOC_PRAGMA) && defined(_M_IA64)
|
|
#pragma alloc_text(INIT, InitializeVirtualSourceLine)
|
|
#endif
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
ALLOC_PAGEABLE_DATA PLIST_VIRTUAL_SOURCE_LINE gplstVirtualSourceLine = NULL;
|
|
ALLOC_PAGEABLE_DATA ULONG gcVirtualSources = 0;
|
|
|
|
//---------------------------------------------------------------------------
|
|
//---------------------------------------------------------------------------
|
|
|
|
#if !defined(_M_IA64)
|
|
#pragma INIT_CODE
|
|
#endif
|
|
#pragma INIT_DATA
|
|
|
|
NTSTATUS
|
|
InitializeVirtualSourceLine(
|
|
)
|
|
{
|
|
if(gplstVirtualSourceLine == NULL) {
|
|
gplstVirtualSourceLine = new LIST_VIRTUAL_SOURCE_LINE;
|
|
if(gplstVirtualSourceLine == NULL) {
|
|
return(STATUS_INSUFFICIENT_RESOURCES);
|
|
}
|
|
}
|
|
return(STATUS_SUCCESS);
|
|
}
|
|
|
|
#pragma PAGEABLE_CODE
|
|
#pragma PAGEABLE_DATA
|
|
|
|
VOID
|
|
UninitializeVirtualSourceLine(
|
|
)
|
|
{
|
|
delete gplstVirtualSourceLine;
|
|
gplstVirtualSourceLine = NULL;
|
|
}
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
CVirtualSourceLine::CVirtualSourceLine(
|
|
PSYSAUDIO_CREATE_VIRTUAL_SOURCE pCreateVirtualSource
|
|
)
|
|
{
|
|
ASSERT(gplstVirtualSourceLine != NULL);
|
|
//
|
|
// NOTE: Virtual pins must end up first before the hardware's
|
|
// pins so wdmaud mixer line parsing works correctly.
|
|
//
|
|
AddListEnd(gplstVirtualSourceLine);
|
|
|
|
if(pCreateVirtualSource->Property.Id ==
|
|
KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE_ONLY) {
|
|
ulFlags |= VSL_FLAGS_CREATE_ONLY;
|
|
}
|
|
|
|
|
|
RtlCopyMemory(
|
|
&guidCategory,
|
|
&pCreateVirtualSource->PinCategory,
|
|
sizeof(GUID));
|
|
|
|
RtlCopyMemory(
|
|
&guidName,
|
|
&pCreateVirtualSource->PinName,
|
|
sizeof(GUID));
|
|
|
|
iVirtualSource = gcVirtualSources++;
|
|
}
|
|
|
|
CVirtualSourceLine::~CVirtualSourceLine(
|
|
)
|
|
{
|
|
RemoveList(gplstVirtualSourceLine);
|
|
gcVirtualSources--;
|
|
}
|