IRP_MJ_SET_SECURITY

When Sent

The IRP_MJ_SET_SECURITY request is sent by the I/O Manager. This request can be sent, for example, when a user-mode application has called a Win32 function such as SetSecurityInfo.

Operation: File System Drivers

The file system driver should extract and decode the file object to determine whether it represents a user file or directory open. If it does, the driver should process the request and complete the IRP. Otherwise, the driver should complete the IRP as appropriate without processing the request.

Operation: File System Filter Drivers

The filter driver should pass this IRP down to the next-lower driver on the stack.

Parameters

A file system or filter driver calls IoGetCurrentIrpStackLocation with the given IRP to get a pointer to its own stack location in the IRP, shown in the following list as IrpSp. (The IRP is shown as Irp.) The driver can use the information that is set in the following members of the IRP and the IRP stack location in processing a set security information request:

DeviceObject

A pointer to the target device object.

Irp->IoStatus

A pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the requested operation.

IrpSp->FileObject

A pointer to the file object that is associated with DeviceObject.

The IrpSp->FileObject parameter contains a pointer to the RelatedFileObject field, which is also a FILE_OBECT structure. The RelatedFileObject field of the FILE_OBJECT structure is not valid during the processing of IRP_MJ_SET_SECURITY and should not be used.

IrpSp->MajorFunction

Specifies IRP_MJ_SET_SECURITY.

IrpSp->Parameters.SetSecurity.SecurityDescriptor

A pointer to a SECURITY_DESCRIPTOR structure that contains the values of the security information to be assigned to the object.

IrpSp->Parameters.SetSecurity.SecurityInformation

A value of type SECURITY_INFORMATION that specifies which security information is to be set in the security descriptor. This value can be one of the following.

SecurityInformation ValueMeaning

DACL_SECURITY_INFORMATION

Indicates that the discretionary access control list (DACL) of the object is being set. Requires WRITE_DAC access.

GROUP_SECURITY_INFORMATION

Indicates that the primary group identifier of the object is being set. Requires WRITE_OWNER access.

OWNER_SECURITY_INFORMATION

Indicates that the owner identifier of the object is being set. Requires WRITE_OWNER access.

SACL_SECURITY_INFORMATION

Indicates that the system ACL (SACL) of the object is being set. Requires ACCESS_SYSTEM_SECURITY access.

 

See also

IO_STACK_LOCATION
IO_STATUS_BLOCK
IoGetCurrentIrpStackLocation
IRP
IRP_MJ_QUERY_SECURITY
SECURITY_DESCRIPTOR
SECURITY_INFORMATION

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft