Results 1 to 5 of 5

Thread: Take ownership of registry key with .NET 2.0?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    76

    Take ownership of registry key with .NET 2.0?

    How does one go about taking ownership of a registry key using VB.NET 2008 *IF* one has only TakeOwnership privilege?

    The problem is exactly as specified in MS KB Article ID: 111546 at:
    http://support.microsoft.com/kb/111546/EN-US/

    ...except that I would like to know how to do it in VB.NET 2008

    Any help would be much appreciated. Thanks!
    < advertising link removed by moderator >

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Take ownership of registry key with .NET 2.0?

    That article gives you the answer. It tells you that need to use the RegOpenKeyEx API. I think that example is in C#, but that's not a big deal. Just look up the API on Google, MSDN, PInvoke, or all of them.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    76

    Re: Take ownership of registry key with .NET 2.0?

    Yeah I looked out and got these two functions for VB.NET

    vb Code:
    1. Declare Auto Function RegOpenKeyEx Lib "advapi32.dll" ( _
    2.    ByVal hKey As IntPtr, _
    3.    ByVal lpSubKey As String, _
    4.    ByVal ulOptions As Integer, _
    5.    ByVal samDesired As Integer, _
    6.    ByRef phkResult As Integer _
    7. ) As Integer
    8.  
    9.     Declare Function RegSetKeySecurity Lib "advapi32" (ByVal hKey As Long, ByVal SecurityInformation As Long, ByVal pSecurityDescriptor As Security.SecurityZone) As Long

    Now how to use them to get what I want
    < advertising link removed by moderator >

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    76

    Re: Take ownership of registry key with .NET 2.0?

    Bump......

    I tried a lot but couldn't find anything
    < advertising link removed by moderator >

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Take ownership of registry key with .NET 2.0?

    What exactly did you try?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


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