|
|
1.1 ! root 1: /*++ ! 2: ! 3: Copyright (c) 1993 Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: config.c ! 8: ! 9: Abstract: ! 10: ! 11: This module contains code configuration code for the initialization phase ! 12: of the Microsoft midi synth device driver. ! 13: ! 14: Author: ! 15: ! 16: Robin Speed (RobinSp) 17-Oct-1992 ! 17: ! 18: Environment: ! 19: ! 20: Kernel mode ! 21: ! 22: Revision History: ! 23: ! 24: --*/ ! 25: ! 26: ! 27: #include "sound.h" ! 28: #include <string.h> ! 29: ! 30: ! 31: ! 32: ! 33: ! 34: VOID ! 35: SoundSaveVolume( ! 36: PGLOBAL_DEVICE_INFO pGDI ! 37: ) ! 38: { ! 39: // ! 40: // Write out left and right volume settings for each device ! 41: // ! 42: ! 43: int i; ! 44: for (i = 0; i < NumberOfDevices; i++) { ! 45: if (pGDI->DeviceObject[i]) { ! 46: PLOCAL_DEVICE_INFO pLDI; ! 47: ! 48: pLDI = (PLOCAL_DEVICE_INFO)pGDI->DeviceObject[i]->DeviceExtension; ! 49: ! 50: SoundSaveDeviceVolume(pLDI, pGDI->RegistryPathName); ! 51: } ! 52: } ! 53: SoundFlushRegistryKey(pGDI->RegistryPathName); ! 54: } ! 55: ! 56: ! 57: ! 58: NTSTATUS ! 59: SoundReadConfiguration( ! 60: IN PWSTR ValueName, ! 61: IN ULONG ValueType, ! 62: IN PVOID ValueData, ! 63: IN ULONG ValueLength, ! 64: IN PVOID Context, ! 65: IN PVOID EntryContext ! 66: ) ! 67: /*++ ! 68: ! 69: Routine Description : ! 70: ! 71: Return configuration information for our device ! 72: ! 73: Arguments : ! 74: ! 75: ConfigData - where to store the result ! 76: ! 77: Return Value : ! 78: ! 79: NT status code - STATUS_SUCCESS if no problems ! 80: ! 81: --*/ ! 82: { ! 83: PSOUND_CONFIG_DATA ConfigData; ! 84: ! 85: ConfigData = Context; ! 86: ! 87: if (ValueType == REG_DWORD) { ! 88: ! 89: int i; ! 90: ! 91: for (i = 0; i < NumberOfDevices; i++) { ! 92: if (DeviceInit[i].LeftVolumeName != NULL && ! 93: wcsicmp(ValueName, DeviceInit[i].LeftVolumeName) == 0) { ! 94: ConfigData->Volume[i].Left = *(PULONG)ValueData; ! 95: ! 96: dprintf3(("%ls = %8X", DeviceInit[i].LeftVolumeName, ! 97: ConfigData->Volume[i].Left)); ! 98: } ! 99: if (DeviceInit[i].RightVolumeName != NULL && ! 100: wcsicmp(ValueName, DeviceInit[i].RightVolumeName) == 0) { ! 101: ConfigData->Volume[i].Right = *(PULONG)ValueData; ! 102: ! 103: dprintf3(("%ls = %8X", DeviceInit[i].RightVolumeName, ! 104: ConfigData->Volume[i].Right)); ! 105: } ! 106: } ! 107: ! 108: } ! 109: return STATUS_SUCCESS; ! 110: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.