Results 1 to 1 of 1

Thread: [VB6] Registry Key Virtual type checker

  1. #1

    Thread Starter
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine on fire (country of slaves)
    Posts
    750

    [VB6] Registry Key Virtual type checker

    Hi,

    this module allows to check whether Registry Key is:
    - Shared
    - Redirected
    - Usual
    - Symlink
    And to show a target of symlink.

    Note: Reflected type of keys (OS Vista and older only) are not considered.

    RegGetKeyVirtualType() function returns a bitmask of KEY_VIRTUAL_TYPE enum.

    Example of using is inside.
    For most and reliable operation results elevated privilages required.
    Code:
        Dim kvt As KEY_VIRTUAL_TYPE
        ...
        kvt = RegGetKeyVirtualType(HKLM, "SOFTWARE\Classes\AppID", sSymLinkTarget)
        
        If kvt And KEY_VIRTUAL_NOT_EXIST Then sKeyType = "Not exist"
        If kvt And KEY_VIRTUAL_USUAL Then sKeyType = "Usual"
        If kvt And KEY_VIRTUAL_SHARED Then sKeyType = "Shared"
        If kvt And KEY_VIRTUAL_REDIRECTED Then sKeyType = "Redirected"
        If kvt And KEY_VIRTUAL_SYMLINK Then sKeyType = sKeyType & " (Symlink)" & " -> " & sSymLinkTarget
        ...
    References:
    There is also a short article in Russian about such keys I wrote a long time ago, available here.

    See also:
    MSDN. Registry Keys Affected by WOW64
    MSDN. Accessing an Alternate Registry View
    MSDN. Registry Reflection
    MSDN. [MS-RRP] Symbolic Links
    Stefan Kuhr. Registry Symbolic Links creation tool.
    Jeremy Hurren. Registry Filters and Symbolic Links
    Paula Tomlinson. Understanding NT

    I must warn that the table of virtual types for some keys presented on MSDN page is wrong.
    Also, some information how to open and work with symlinks are incomplete. See my code on how to do it reliable.
    Attached Files Attached Files
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width