RtlInitUnicodeString(&ReferenceString, DeviceEntry->DeviceName);
/* register device interface */
- Status = IoRegisterDeviceInterface(BusDeviceExtension->PhysicalDeviceObject, &BusInstanceEntry->InterfaceGuid, &ReferenceString, &BusInstanceEntry->SymbolicLink);
+ Status = IoRegisterDeviceInterface(BusDeviceExtension->PhysicalDeviceObject, &DeviceEntry->DeviceGuid, NULL, &BusInstanceEntry->SymbolicLink);
/* check for success */
if (!NT_SUCCESS(Status))
if (NT_SUCCESS(Status))
{
/* perform callback */
- Status = Callback(hNewKey, BusDeviceExtension, DeviceEntry, ReferenceString, KeyInfo->Name);
+ Status = Callback(hNewKey, BusDeviceExtension, DeviceEntry, KeyInfo->Name, ReferenceString);
/* should enumeration stop */
if (!NT_SUCCESS(Status))
/* check if the device is already present */
Entry = DeviceEntry->DeviceInterfaceList.Flink;
+ DPRINT1("KspCreateDeviceAssociation ReferenceString %S\n", ReferenceString);
+ DPRINT1("KspCreateDeviceAssociation InterfaceString %S\n", InterfaceString);
while(Entry != &DeviceEntry->DeviceInterfaceList)
{
IN PHANDLE hKey,
IN PBUS_ENUM_DEVICE_EXTENSION BusDeviceExtension,
IN PBUS_DEVICE_ENTRY DummyEntry,
- IN LPWSTR DeviceCategory,
- IN LPWSTR ReferenceString)
+ IN LPWSTR InterfaceId,
+ IN LPWSTR DeviceId)
{
LPWSTR DeviceName;
SIZE_T Length;
KIRQL OldLevel;
/* first construct device name & reference guid */
- Length = wcslen(DeviceCategory) + wcslen(ReferenceString);
+ Length = wcslen(DeviceId) + wcslen(InterfaceId);
/* append '&' and null byte */
Length += 2;
}
/* construct device name */
- swprintf(DeviceName, L"%s&%s", DeviceCategory, ReferenceString);
+ wcscpy(DeviceName, DeviceId);
+ wcscat(DeviceName, L"&");
+ wcscat(DeviceName, InterfaceId);
/* scan list and check if it is already present */
Entry = BusDeviceExtension->Common.Entry.Flink;
InitializeListHead(&DeviceEntry->IrpPendingList);
/* copy device guid */
- RtlInitUnicodeString(&String, DeviceCategory);
+ RtlInitUnicodeString(&String, DeviceId);
RtlGUIDFromString(&String, &DeviceEntry->DeviceGuid);
/* copy device names */
DeviceEntry->DeviceName = DeviceName;
- DeviceEntry->Instance = (DeviceName + wcslen(DeviceCategory) + 1);
+ DeviceEntry->Instance = (DeviceName + wcslen(DeviceId) + 1);
/* copy name */
- DeviceEntry->BusId = AllocateItem(NonPagedPool, (wcslen(DeviceCategory) + 1) * sizeof(WCHAR));
+ DeviceEntry->BusId = AllocateItem(NonPagedPool, (wcslen(DeviceId) + 1) * sizeof(WCHAR));
if (!DeviceEntry->BusId)
{
/* no memory */
FreeItem(DeviceEntry);
return STATUS_INSUFFICIENT_RESOURCES;
}
- wcscpy(DeviceEntry->BusId, DeviceCategory);
+ wcscpy(DeviceEntry->BusId, DeviceId);
}
- /* now enumerate the devices */
- Status = KspEnumerateBusRegistryKeys(hKey, ReferenceString, KspCreateDeviceAssociation, BusDeviceExtension, DeviceEntry);
+ /* now enumerate the interfaces */
+ Status = KspEnumerateBusRegistryKeys(hKey, InterfaceId, KspCreateDeviceAssociation, BusDeviceExtension, DeviceEntry);
/* check if list is empty */
if (IsListEmpty(&DeviceEntry->DeviceInterfaceList))
IN LPWSTR DeviceCategory,
IN LPWSTR ReferenceString)
{
- return KspEnumerateBusRegistryKeys(hKey, ReferenceString, KspCreateDeviceReference, BusDeviceExtension, DummyEntry);
+ return KspEnumerateBusRegistryKeys(hKey, DeviceCategory, KspCreateDeviceReference, BusDeviceExtension, DummyEntry);
}
Status = ZwCreateKey(&hDeviceKey, GENERIC_WRITE, &ObjectAttributes, 0, NULL, 0, NULL);
if (NT_SUCCESS(Status))
{
- /* initialize reference string */
- RtlInitUnicodeString(&ReferenceString, InstallInterface->ReferenceString);
-
- /* initialize object attributes */
- InitializeObjectAttributes(&ObjectAttributes, &ReferenceString, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hDeviceKey, NULL);
-
- /* construct device key */
- Status = ZwCreateKey(&hReferenceKey, GENERIC_WRITE, &ObjectAttributes, 0, NULL, 0, NULL);
+ /* convert interface guid to string */
+ Status = RtlStringFromGUID(&InstallInterface->InterfaceId, &InterfaceString);
if (NT_SUCCESS(Status))
{
- /* convert interface guid to string */
- Status = RtlStringFromGUID(&InstallInterface->InterfaceId, &InterfaceString);
+ /* initialize object attributes */
+ InitializeObjectAttributes(&ObjectAttributes, &InterfaceString, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hDeviceKey, NULL);
+
+ /* construct device key */
+ Status = ZwCreateKey(&hInterfaceKey, GENERIC_WRITE, &ObjectAttributes, 0, NULL, 0, NULL);
if (NT_SUCCESS(Status))
{
+ /* initialize reference string */
+ RtlInitUnicodeString(&ReferenceString, InstallInterface->ReferenceString);
+
/* initialize object attributes */
- InitializeObjectAttributes(&ObjectAttributes, &InterfaceString, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hReferenceKey, NULL);
+ InitializeObjectAttributes(&ObjectAttributes, &ReferenceString, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hInterfaceKey, NULL);
/* construct device key */
- Status = ZwCreateKey(&hInterfaceKey, GENERIC_WRITE, &ObjectAttributes, 0, NULL, 0, NULL);
+ Status = ZwCreateKey(&hReferenceKey, GENERIC_WRITE, &ObjectAttributes, 0, NULL, 0, NULL);
if (NT_SUCCESS(Status))
{
/* close key */
- ZwClose(hInterfaceKey);
+ ZwClose(hReferenceKey);
}
- /* free interface string */
- RtlFreeUnicodeString(&InterfaceString);
}
+ /* free interface string */
+ RtlFreeUnicodeString(&InterfaceString);
+
/* close reference key */
- ZwClose(hReferenceKey);
+ ZwClose(hInterfaceKey);
}
/* close device key */
ZwClose(hDeviceKey);
{
/* get device entry */
DeviceEntry = (PBUS_DEVICE_ENTRY)CONTAINING_RECORD(Entry, BUS_DEVICE_ENTRY, Entry);
-
- if (IsEqualGUIDAligned(&DeviceEntry->DeviceGuid, &InstallInterface->DeviceId) &&
- !wcsicmp(DeviceEntry->Instance, InstallInterface->ReferenceString))
+ if (IsEqualGUIDAligned(&DeviceEntry->DeviceGuid, &InstallInterface->DeviceId))
{
if (!DeviceEntry->PDO)
{
+ /* release device entry lock */
+ KeReleaseSpinLock(&Context->BusDeviceExtension->Lock, OldLevel);
+
/* create pdo */
Status = KspCreatePDO(Context->BusDeviceExtension, DeviceEntry, &DeviceEntry->PDO);
+ /* acquire device entry lock */
+ KeAcquireSpinLock(&Context->BusDeviceExtension->Lock, &OldLevel);
+
/* done */
break;
}
ExcludeFromSelect = WDMAUDIO_CopyFilesOnlyId\r
\r
[GenericMfg]\r
+%WDM_WDMAUD.DeviceDesc% = WDM_WDMAUD, SW\{CD171DE3-69E5-11D2-B56D-0000F8754380}\r
%WDM_DRMKAUD.DeviceDesc% = WDM_DRMKAUD, SW\{EEC12DB6-AD9C-4168-8658-B03DAEF417FE}\r
%WDMAUDIO_CopyFilesOnlyId.DeviceDesc% = WDMAUDIO.CopyFilesOnly, WDMAUDIO_CopyFilesOnlyId\r
\r
CopyFiles = WDM.CopyFiles\r
\r
[DeviceRegistration]\r
-;; DRMKAUD swenum install\r
+; WDMAud install\r
+HKLM,%RunOnce%,"WDM_WDMAUD",,"rundll32.exe streamci.dll,StreamingDeviceSetup %WDM_WDMAUD.DeviceId%,%KSNAME_Filter%,%KSCATEGORY_WDMAUD%,%17%\WDMAUDIO.inf,WDM_WDMAUD.Interface.Install"\r
+; DRMKAUD install\r
HKLM,%RunOnce%,"WDM_DRMKAUD",,"rundll32.exe streamci,StreamingDeviceSetup %WDM_DRMKAUD.DeviceId%,%KSNAME_DRMKAUD%,%KSCATEGORY_DRM_DESCRAMBLE%,%17%\WDMAUDIO.inf,WDM_DRMKAUD.Interface.Install"\r
\r
-;; DRMKAUD Install\r
+;--------------------------------------------------------------------------------\r
+; WDMAUD Install\r
+[WDM_WDMAUD.Interface.Install]\r
+AddReg=WDM_WDMAUD.Interface.AddReg\r
+\r
+[WDM_WDMAUD.Interface.AddReg]\r
+HKR,,CLSID,,%Proxy.CLSID%\r
+HKR,,FriendlyName,,%WDM_WDMAUD.FriendlyName%\r
+\r
+[WDM_WDMAUD]\r
+CopyFiles = WDM_WDMAUD.CopyFiles\r
+\r
+[WDM_WDMAUD.CopyFiles]\r
+wdmaud.sys\r
+\r
+[WDM_WDMAUD.Services]\r
+AddService = wdmaud,0x00000002, wdmaud_Service_Inst\r
+\r
+[wdmaud_Service_Inst]\r
+DisplayName = %wdmaud.SvcDesc%\r
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER\r
+StartType = 3 ; SERVICE_DEMAND_START\r
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL\r
+ServiceBinary = %10%\system32\drivers\wdmaud.sys\r
+\r
+;--------------------------------------------------------------------------------\r
+; DRMKAUD Install\r
[WDM_DRMKAUD.Interface.Install]\r
AddReg=WDM_DRMKAUD.Interface.AddReg\r
\r
WDM.CopyFiles = 10,system32\drivers ; %SystemRoot%\system32\drivers\r
WDM_DRMKAUD.CopyFiles = 10,system32\drivers\r
\r
+;---------------------------------------------------------------------------------\r
[Strings]\r
;Non-localizable\r
ReactOS="ReactOS"\r
\r
RunOnce = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"\r
Proxy.CLSID = "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"\r
+KSNAME_Filter = "{9B365890-165F-11D0-A195-0020AFD156E4}"\r
KSNAME_DRMKAUD = "{ABD61E00-9350-47e2-A632-4438B90C6641}"\r
WDM_DRMKAUD.DeviceId = "{EEC12DB6-AD9C-4168-8658-B03DAEF417FE}"\r
KSCATEGORY_DRM_DESCRAMBLE = "{FFBB6E3F-CCFE-4D84-90D9-421418B03A8E}"\r
KSCATEGORY_DATATRANSFORM = "{2EB07EA0-7E70-11D0-A5D6-28DB04C10000}"\r
KSCATEGORY_AUDIO = "{6994AD04-93EF-11D0-A3CC-00A0C9223196}"\r
PKEY_AudioEngine_OEMFormat = "{E4870E26-3CC5-4CD2-BA46-CA0A9A70ED04},3"\r
+WDM_WDMAUD.DeviceId = "{CD171DE3-69E5-11D2-B56D-0000F8754380}"\r
+KSCATEGORY_WDMAUD = "{3E227E76-690D-11D2-8161-0000F8775BF1}"\r
+\r
\r
;Localizable\r
WDM_DRMKAUD.DeviceDesc = "ReactOS Trusted Audio Drivers"\r
WDM_DRMKAUD.FriendlyName = "ReactOS Trusted Audio Drivers"\r
drmkaud.SvcDesc = "ReactOS Trusted Audio Drivers"\r
WDMAUDIO_CopyFilesOnlyId.DeviceDesc = "ReactOS WDM Audio Drivers"\r
+WDM_WDMAUD.DeviceDesc = "Driver for ReactOS WINMM-WDM-Audio"\r
+WDM_WDMAUD.FriendlyName = "Driver for ReactOS WINMM-WDM-Audio"\r
+wdmaud.SvcDesc = "Driver for ReactOS WINMM-WDM-Audio"\r
+\r
\r
[Strings.0418]\r
WDM_DRMKAUD.DeviceDesc = "Module-pilot audio de încredere ale ReactOS"\r