PDA

View Full Version : Where are profiles kept in the registry?


Sweetz
January 14th, 2010, 10:37 PM
I've been some research into how nVidia profiles actually work. Most of know about NvApps.xml, but that's more or less just a backup of the profile settings. The actual profile settings are stored in the registry. The problem is finding the conclusive location for them.

On my Vista x64 system I've been able to find the profile settings under this registry path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000

I thought the "{4D36E968-E325-11CE-BFC1-08002BE10318}" part was a device specific ID, however it turns out that this is just Window's generic device ID for display adapters. In other words, that path should be the same for everyone.

However, I checked on a friend's system, which was running WinXP and he only had profiles here (I forgot to get the exact device ID):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Video\<device GUID>\0000

I checked my system and I have profiles under the Video section as well, but I think my device ID is different - is that ID model/device specific?

Also is the Video section just a backup? For me, making changes to the profiles under the Class key was enough to make things different when running games.

Grestorn
January 16th, 2010, 02:38 PM
The GUID for the video device is generated dynamically when the driver is installed, it's not the same on every system.

You can query all Displays using the Win32 API to get the correct path of the main display. Or you can use nVidia's own NVAPI, which nHancer is using in the last couple of versions, for the same purpose.

By the way, starting with the 191 drivers, the DirectX 9 driver is no longer reading the registry for the profiles, it reads from nvapps.xml directly. The DX10 driver did that from the beginning. Currently, only the OGL driver is still using the registry for the profiles.

Sweetz
January 18th, 2010, 09:08 PM
You can query all Displays using the Win32 API to get the correct path of the main display. Or you can use nVidia's own NVAPI, which nHancer is using in the last couple of versions, for the same purpose.
I took a look at EnumDisplayDevices, but rather annoyingly, it says as DeviceID in the DISPLAY_DEVICE struct it passes back is "not used". I have no idea whether that's accurate or not though.

I just checked out NVAPI and well, let's just say it's been much too long since I did anything in C++ and my brain is too addled to figure out what I'd need to use there to get the device ID :(

By the way, starting with the 191 drivers, the DirectX 9 driver is no longer reading the registry for the profiles, it reads from nvapps.xml directly. The DX10 driver did that from the beginning. Currently, only the OGL driver is still using the registry for the profiles.Really? That's great if that's the case! Does it only read it into memory at startup though? Or does it now read it every time an app loads?

I know I've manually made changes to nVapps.xml and they did not apply in games - even after restart. Also I know I've made manually changes to the registry and the changes did apply without restart. However, these observations may come from pre-191 driver sets, I can't remember what I was using at the time.

If one manually edits the nvapps.xml now, would those changes immediately apply, or does something need to inform the driver to load those changes?

squall_leonhart69r
January 19th, 2010, 12:17 AM
the profile is read on app start.


pita really, since now you can't change aa while a game is running

Grestorn
January 20th, 2010, 05:24 PM
I took a look at EnumDisplayDevices, but rather annoyingly, it says as DeviceID in the DISPLAY_DEVICE struct it passes back is "not used". I have no idea whether that's accurate or not though.

I just checked out NVAPI and well, let's just say it's been much too long since I did anything in C++ and my brain is too addled to figure out what I'd need to use there to get the device ID :(

I've put the code nHancer uses to access the NVAPI in a zip file and uploaded it for you (http://www.nhancer.com/downloads/nvapi.zip). Hope that helps!

Really? That's great if that's the case! Does it only read it into memory at startup though? Or does it now read it every time an app loads?When an app starts, but only then (as Squall noted). Previously the driver used to reread the registry whenever the 3D display got initialized, i.e. also after each Alt-Tab back into a game.

squall_leonhart69r
January 23rd, 2010, 04:47 PM
Behavior has changed slightly in 196.21, if the game allows switching from windowed to fullscreen (such as with alt+enter), then changing profile AA will work when you switch back into fullscreen, for Direct3D apps.