Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 71 of file registry.c.
Referenced by EnumerateNt4ServiceSoundDevices().
{ DWORD PathLength; PWCHAR RegPath; VALIDATE_MMSYS_PARAMETER( ServiceName ); VALIDATE_MMSYS_PARAMETER( KeyHandle ); /* Work out the space required to hold the path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ sndblst\ Parameters\ Device123\ */ PathLength = wcslen(REG_SERVICES_KEY_NAME_U) + 1 + wcslen(ServiceName) + 1 + wcslen(REG_PARAMETERS_KEY_NAME_U) + 1 + wcslen(REG_DEVICE_KEY_NAME_U) + GetDigitCount(DeviceIndex); /* Allocate storage for the string */ RegPath = AllocateWideString(PathLength); if ( ! RegPath ) { return MMSYSERR_NOMEM; } /* Write the path */ wsprintf(RegPath, L"%ls\\%ls\\%ls\\%ls%d", REG_SERVICES_KEY_NAME_U, ServiceName, REG_PARAMETERS_KEY_NAME_U, REG_DEVICE_KEY_NAME_U, DeviceIndex); SND_TRACE(L"Opening reg key: %wS\n", RegPath); /* Perform the open */ if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, RegPath, 0, KEY_READ, KeyHandle) != ERROR_SUCCESS ) { /* Couldn't open the key */ SND_ERR(L"Failed to open reg key: %wS\n", RegPath); FreeMemory(RegPath); return MMSYSERR_ERROR; } FreeMemory(RegPath); return MMSYSERR_NOERROR; }