[Visual Basic]
The ChangeSecurityPermissions method changes the security permissions for the logical file specified in the object path. If the logical file is a directory, then this method will act recursively, changing the security permissions for all of the files and sub-directories that the directory contains. This method is inherited from CIM_LogicalFile.
For information about using this method with C/C++, see Calling a Method.
Function ChangeSecurityPermissions( _
ByVal SecurityDescriptor As Win32_SecurityDescriptor, _
ByVal Option As Integer _
) As Integer
Parameters
SecurityDescriptor
[in] Specifies the security information.
Note A NULL access control list (ACL) in the SECURITY_DESCRIPTOR structure grants unlimited access. For information about the implications of unlimited access, see Creating a Security Descriptor for a New Object.
Option
[in] Security privilege to modify. For example, to change the owner and DACL security, use:
Option = 1 + 4
or
Option = CHANGE_OWNER_SECURITY_INFORMATION | CHANGE_DACL_SECURITY_INFORMATIONValues to set the bit: Meaning
CHANGE_OWNER_SECURITY_INFORMATION
1 Change the owner of the logical file.
CHANGE_GROUP_SECURITY_INFORMATION
2 Change the group of the logical file.
CHANGE_DACL_SECURITY_INFORMATION
4 Change the ACL of the logical file.
CHANGE_SACL_SECURITY_INFORMATION
8 Change the system ACL of the logical file.
Return Values
Returns an integer value of 0 on success, and any other number to indicate an error.
Return Code Description
0 Success.
2 Access denied.
8 Unspecified failure.
9 Invalid object.
10 Object already exists.
11 File system not NTFS
12 Platform not Windows NT or Windows 2000.
13 Drive not the same.
14 Directory not empty.
15 Sharing violation.
16 Invalid start file.
17 Privilege not held.
21 Invalid parameter.
Remarks
The ChangeSecurityPermissions method in CIM_DataFile is implemented by WMI.
Requirements
Client: Included in Windows XP, Windows 2000 Professional, and Windows NT Workstation 4.0.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server 4.0.
Header: Declared in Cimwin32.mof.
Namespace: Included in \root\cimv2.
See Also
CIM_DataFile