VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

changing security permissions of the registry folders

Viswanath Munnangi  (1 Submission)   Registry   VB 6.0   Unknown Difficulty   Tue 13th November 2001   Mon 8th February 2021

changing security permissions of the registry folders

API Declarations


' Standard Header:
'Private Const MODULE_NAME As String =
"lilRegistryPermissions"
'Private Const MODULE_FILE_NAME As String =
"basRegistryPermissions"
'Private Const MODULE_DESC As String = "It contains
functions related to Registry"
'Private Const MODULE_MAJOR As Integer = 1
'Private Const MODULE_MINOR As Integer = 0
'Private Const MODULE_REVISION As Integer = 0
'Private Const CREATED_ON As Date = #6/14/2001# '
US date sformat!
'Private Const CREATED_BY As String = "Munnangi
Viswanath"



'Modification History:
'DATE MODIFIED BY CHANGED


Option Explicit

'Module level Variables
Public merkRootKey As eRegistryRootKeys
Public msKeyAdd As String
Public msUName As String
Public mekpAttrib As eKeyPerms
Public mlTotal As Long
Public mvParams As Variant
' Constants used within our API calls. Refer
win32api.txt file and msdn
Public Const GMEM_MOVEABLE = &H2
Public Const LMEM_FIXED = &H0
Public Const LMEM_ZEROINIT = &H40
Public Const LPTR = (LMEM_FIXED + LMEM_ZEROINIT)

'collection object to hold all the class objects
Public moAllData As Collection
'declaration of class object
Public moPath As lilRegistryPermissions.cKeyAddresses

Public moLogWriter As lilLogWriter.clsLogWriter

'Constants Registry Key Permissions refer win32api.txt
file for constants
Public Enum eKeyPerms
GENERIC_READ = &H80000000
GENERIC_ALL = &H10000000
GENERIC_EXECUTE = &H20000000
GENERIC_WRITE = &H40000000
End Enum

' The security API call constants. refer to
win32api.txt file
Public Const DACL_SECURITY_INFORMATION = &H4
Public Const SECURITY_DESCRIPTOR_REVISION = 1
Public Const SECURITY_DESCRIPTOR_MIN_LENGTH = 20
Public Const SD_SIZE = (65536 +
SECURITY_DESCRIPTOR_MIN_LENGTH)
Public Const ACL_REVISION2 = 2
Public Const ACL_REVISION = 2
Public Const MAXDWORD = &HFFFFFFFF

'Type of User 1-user and 2-Group refer win32api.txt
file for constants

Public Const SidTypeUser = 2
Public Const AclSizeInformation = 2

'The following are the inherit flags that go into the
AceFlags field of an Ace header. refer win32api.txt
file

Public Const OBJECT_INHERIT_ACE = &H1
Public Const CONTAINER_INHERIT_ACE = &H2
Public Const NO_PROPAGATE_INHERIT_ACE = &H4
Public Const INHERIT_ONLY_ACE = &H8
Public Const INHERITED_ACE = &H10
Public Const VALID_INHERIT_FLAGS = &H1F
Public Const DELETE = &H10000

'Constant to compare Error return value from the API
call
Const ERROR_SUCCESS = 0
Const ERROR_INSUFFICIENT_BUFFER = 122

'This constant is used to format the error message
returned from the api call
Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000

'enumarated values for the RootKeys in the Registry

Public Enum eRegistryRootKeys
rkHKeyClassesRoot = &H80000000
rkHKeyCurrentUser = &H80000001
rkhkeylocalmachine = &H80000002
rkHKeyUsers = &H80000003
End Enum

'Type declaration for Filetime used in RegQueryInfo
API Call
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type

' Structures used by our API calls.

'Type Declarations for ACE's
Type ACE_HEADER
AceType As Byte
AceFlags As Byte
AceSize As Integer
End Type

Public Type ACCESS_DENIED_ACE
Header As ACE_HEADER
Mask As Long
SidStart As Long
End Type

Type ACCESS_ALLOWED_ACE
Header As ACE_HEADER
Mask As Long
SidStart As Long
End Type

Type ACL
AclRevision As Byte
Sbz1 As Byte
AclSize As Integer
AceCount As Integer
Sbz2 As Integer
End Type

Rate changing security permissions of the registry folders (2(2 Vote))
changing security permissions of the registry folders.bas

changing security permissions of the registry folders Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters