1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

REGDIR, strange error message

Discussion in 'Support' started by vefatica, Jul 31, 2017.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    upload_2017-7-31_21-42-41.png
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    Does that key exist?

    The error is coming from Windows, not TCC.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    No, the key does not exist. Are you calling GetLastError() after a function that doesn't SetLastError()?
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    Here's a similar one with another oddity (that was not in my first example). Notice the leading space when the parameter is shown after the error message.

    upload_2017-8-1_0-7-55.png

    ProcessMonitor says TCC calls RegOpenKey (result "NAME NOT FOUND" ... ???). But WinDbg does not break on RegOpenKeyW! Could it be the new VisualStudio pooh-poohing that old function?
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    WinDbg wasn't breaking because it had set the breakpoint at CRYPT32!RegOpenKeyExW. After I specified ADVAPI32!RegOpenKeyExW and tried the experiment in question, I could see that RegOpenKeyExW returns 2, which seems correct.
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    Not reproducible here with 21.0.39.
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    I took a look at that code (which is in a third-party library). They are throwing an exception if RegOpenKeyEx returns an error; the (generic) exception handler then calls GetLastError(). For 21.0.40, I just changed that to pass the error returned from RegOpenKeyEx. (Though to be fair to the original developer, the MS docs never say which of the Windows APIs do not support GetLastError().)
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    That one with the leading space was with build 39. Here it is again.
    upload_2017-8-1_12-59-42.png
     

Share This Page