Results 1 to 6 of 6

Thread: HELP with constant values for RegRestoreKey

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    15

    Angry

    Hello all!

    I was wondering if anyone had any luck with RegRestoreKey and whether you were able to find all the values for the dwFlags you can pass to it. The allowed values are:
    REG_FORCE_RESTORE, REG_NO_LAZY_FLUSH, REG_REFRESH_HIVE, REG_WHOLE_HIVE_VOLATILE.
    I've been able to find the long values for the last two, but not for REG_FORCE_RESTORE, REG_NO_LAZY_FLUSH.
    Anyone can help me here?
    Thanks!!
    Daniel Pinzas

  2. #2
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Code:
    Private Const REG_NO_LAZY_FLUSH = (&H00000004 )
    Private Const REG_FORCE_RESTORE = (&H00000008 )
    I got these as part of a more complete API programm from http://www.AllApi.com (the app is called 'API Toolshed')

    I hope this helps,

    Me.
    Courgettes.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    15

    Set a security privilege with code

    it did help, thanks

    it just brought another problem. I need to have the SE_RESTORE_NAME privilege to do that.

    Can a privilege be set by code???
    Daniel Pinzas

  4. #4
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    I don't know, but ... opens ToolShed ...

    Code:
    Private Const SE_RESTORE_NAME = "SeRestorePrivilege"
    I don't know if you could use this site somehow.


    Courgettes.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    15
    Yes, I have been researching the issue, but it seems that in order to be able to change security permission, or "priviliges", you need permission to be able to change a permission.
    How about that?
    Any ideas anyone?
    Daniel Pinzas

  6. #6
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    I think you need to use AdjustTokenPriviliges:

    Code:
    Public Declare Function AdjustTokenPrivileges Lib "advapi32.dll" (ByVal TokenHandle As Long, ByVal DisableAllPrivileges As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long, PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long
    
    Public Type LUID_AND_ATTRIBUTES
        pLuid As LUID
        Attributes As Long
    End Type
    
    Public Type LUID
    	LowPart As Long
    	HighPart As Long
    End Type
    
    Public Type TOKEN_PRIVILEGES
    	PrivilegeCount As Long
    	Privileges(ANYSIZE_ARRAY) As LUID_AND_ATTRIBUTES
    End Type
    I think that to know how to use this, you should check this:

    Hyah
    Courgettes.

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