Leer en inglés Editar

Compartir a través de


NativeObjectSecurity.Persist Method

Definition

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage.

Overloads

Persist(SafeHandle, AccessControlSections)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend.persist that the values of the includeSections parameters passed to the constructor and persist methods be identical.

Persist(String, AccessControlSections)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

Persist(SafeHandle, AccessControlSections, Object)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

Persist(String, AccessControlSections, Object)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

Persist(SafeHandle, AccessControlSections)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend.persist that the values of the includeSections parameters passed to the constructor and persist methods be identical.

protected override sealed void Persist (System.Runtime.InteropServices.SafeHandle handle, System.Security.AccessControl.AccessControlSections includeSections);

Parameters

handle
SafeHandle

The handle of the securable object with which this NativeObjectSecurity object is associated.

includeSections
AccessControlSections

One of the AccessControlSections enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save.

Exceptions

The securable object with which this NativeObjectSecurity object is associated is either a directory or a file, and that directory or file could not be found.

Remarks

When persisting a NativeObjectSecurity object, if the value of the includeSections parameter passed to the Persist method is not identical to the value of the includeSections parameter passed to the constructor used to create that NativeObjectSecurity object, sections of the persisted NativeObjectSecurity object can contain unpredictable values. For example, if a constructor is called with an includeSections value of Access, and later a Persist method is called on that object with an includeSections value of All, the resulting persisted NativeObjectSecurity object will contain unpredictable values for its audit rules, group, and owner.

Applies to

.NET 9 y otras versiones
Producto Versiones
.NET Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

Persist(String, AccessControlSections)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

protected override sealed void Persist (string name, System.Security.AccessControl.AccessControlSections includeSections);

Parameters

name
String

The name of the securable object with which this NativeObjectSecurity object is associated.

includeSections
AccessControlSections

One of the AccessControlSections enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save.

Exceptions

The securable object with which this NativeObjectSecurity object is associated is either a directory or a file, and that directory or file could not be found.

Remarks

When persisting a NativeObjectSecurity object, if the value of the includeSections parameter passed to the Persist method is not identical to the value of the includeSections parameter passed to the constructor used to create that NativeObjectSecurity object, sections of the persisted NativeObjectSecurity object can contain unpredictable values. For example, if a constructor is called with an includeSections value of Access, and later a Persist method is called on that object with an includeSections value of All, the resulting persisted NativeObjectSecurity object will contain unpredictable values for its audit rules, group, and owner.

Applies to

.NET 9 y otras versiones
Producto Versiones
.NET Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

Persist(SafeHandle, AccessControlSections, Object)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

protected void Persist (System.Runtime.InteropServices.SafeHandle handle, System.Security.AccessControl.AccessControlSections includeSections, object? exceptionContext);
protected void Persist (System.Runtime.InteropServices.SafeHandle handle, System.Security.AccessControl.AccessControlSections includeSections, object exceptionContext);

Parameters

handle
SafeHandle

The handle of the securable object with which this NativeObjectSecurity object is associated.

includeSections
AccessControlSections

One of the AccessControlSections enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save.

exceptionContext
Object

An object that contains contextual information about the source or destination of the exception.

Exceptions

The securable object with which this NativeObjectSecurity object is associated is either a directory or a file, and that directory or file could not be found.

Remarks

When persisting a NativeObjectSecurity object, if the value of the includeSections parameter passed to the Persist method is not identical to the value of the includeSections parameter passed to the constructor used to create that NativeObjectSecurity object, sections of the persisted NativeObjectSecurity object can contain unpredictable values. For example, if a constructor is called with an includeSections value of Access, and later a Persist method is called on that object with an includeSections value of All, the resulting persisted NativeObjectSecurity object will contain unpredictable values for its audit rules, group, and owner.

Applies to

.NET 9 y otras versiones
Producto Versiones
.NET Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5

Persist(String, AccessControlSections, Object)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

protected void Persist (string name, System.Security.AccessControl.AccessControlSections includeSections, object? exceptionContext);
protected void Persist (string name, System.Security.AccessControl.AccessControlSections includeSections, object exceptionContext);

Parameters

name
String

The name of the securable object with which this NativeObjectSecurity object is associated.

includeSections
AccessControlSections

One of the AccessControlSections enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save.

exceptionContext
Object

An object that contains contextual information about the source or destination of the exception.

Exceptions

The securable object with which this NativeObjectSecurity object is associated is either a directory or a file, and that directory or file could not be found.

Remarks

When persisting a NativeObjectSecurity object, if the value of the includeSections parameter passed to the Persist method is not identical to the value of the includeSections parameter passed to the constructor used to create that NativeObjectSecurity object, sections of the persisted NativeObjectSecurity object can contain unpredictable values. For example, if a constructor is called with an includeSections value of Access, and later a Persist method is called on that object with an includeSections value of All, the resulting persisted NativeObjectSecurity object will contain unpredictable values for its audit rules, group, and owner.

Applies to

.NET 9 y otras versiones
Producto Versiones
.NET Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5