Hi,
I am having a problem using CM_Open_DevNode_Key to make our APO compatible
with Windows Core OS. It returns CR_ACCESS_DENIED when called from APO with
KEY_SET_VALUE access requested. KEY_QUERY_VALUE and KEY_NOTIFY work fine. We
need to be able to write some persistent values from within APO. Please
advise.
if ((cfgRet = CM_Locate_DevNodeW(&devInst, (LPWSTR)DeviceID.c_str(),
CM_LOCATE_DEVNODE_NORMAL)) == CR_SUCCESS) {
HKEY devKeyHandle;
if ((cfgRet = CM_Open_DevNode_Key(devInst, KEY_SET_VALUE, 0,
RegDisposition_OpenExisting, &devKeyHandle, CM_REGISTRY_SOFTWARE)) ==
CR_SUCCESS) {
// Never gets here because of CR_ACCESS_DENIED
RegCloseKey(devKeyHandle);
}
}
Thanks,
Edward