Registry Entries for Audio Device Drivers

char  szDevNodeCfg[256];
HKEY  hkSW;

// Retrieve the name of the device node's registry key.

if (CM_Get_DevNode_Key(pDevNode, NULL, 
        szDevNodeCfg, sizeof(szDevNodeCfg), CM_REGISTRY_SOFTWARE))
return MMSYSERR_KEYNOTFOUND;

// Combine the registry key name and string for new key name.

strcat(szDevNodeCfg, "\\Config");

// Open or create the new key.

if (RegOpenKey(HKEY_LOCAL_MACHINE, szDevNodeCfg, &hkSW)) {
   if (RegCreateKey(HKEY_LOCAL_MACHINE, szDevNodeCfg, &hkSW))
      return MMSYSERR_BADDB ;
}

// Set a value for the new key.

RegSetValueEx(hkSW, gszValueName, 0, REG_BINARY, 
    (LPBYTE) pCustomData, sizeof(DWORD)) ;