Request for behavior related to UAC (specifically, disabled UAC) RRS feed

  • Question

  • One component of our application is an ODBC driver.  During our Vista/Windows 7 testing, we have seen some odd behavior related to UAC being disabled, and want to confirm that things are behaving the way they are supposed to.

    Creation of an ODBC connection includes adding keys under {HKLM|HKCU}\SOFTWARE\ODBC\ODBC.INI (HKLM for system DSNs, HKCU for user DSNs).  HKLM is a protected location, so with UAC on, the user will be prompted for elevation before being allowed to create a system DSN.  A standard user will be prompted for the admin password, and an administrator will just be prompted for permission.  With UAC turned off, however, no prompting occurs.  But also, the standard user cannot modify the HKLM\... key, which basically means that with UAC off, a standard user cannot create a system DSN at all.  The RegCreateKeyEx call used to create the key fails, but GetLastError returns a "no error" code, and the key is not created.  Things work fine for an administrator when UAC is off.  Our executables have manifests specifying "requireAdministrator" as the requested execution level, so virtualization will not take place.

    I can easily code around this issue, but I just wanted to confirm that this is the correct behavior - if UAC is off, a standard user will never be able modify any protected file/registry locations because they will never get prompted for elevation.  (Which may also explain why, when I turn off UAC on my personal system, some previously-installed programs break)
    Tuesday, September 29, 2009 3:02 PM