public static extern NtStatus NtCreateWnfStateName( out ulong StateName, WnfStateNameLifetime NameLifetime, WnfDataScope DataScope, bool PersistData, [In, Optional] WnfTypeId TypeId, int MaximumStateSize, SafeBuffer SecurityDescriptor );
public static extern NtStatus NtCreateWnfStateName( ref WnfStateName StateName, WnfStateNameLifetime NameLifetime, WnfDataScope DataScope, bool PersistData, ref WnfTypeId TypeId, uint MaximumStateSize, SafeBuffer SecurityDescriptor );
/// <summary> /// Create a new WNF state name. /// </summary> /// <param name="name_lifetime">The lifetime of the name.</param> /// <param name="data_scope">The scope of the data.</param> /// <param name="persist_data">Whether to persist data.</param> /// <param name="type_id">Optional type ID.</param> /// <param name="maximum_state_size">Maximum state size.</param> /// <param name="security_descriptor">Mandatory security descriptor.</param> /// <returns>The created object.</returns> public static NtWnf Create( WnfStateNameLifetime name_lifetime, WnfDataScope data_scope, bool persist_data, WnfTypeId type_id, int maximum_state_size, SecurityDescriptor security_descriptor) { return(Create(name_lifetime, data_scope, persist_data, type_id, maximum_state_size, security_descriptor, true).Result); }
/// <summary> /// Create a new WNF state name. /// </summary> /// <param name="name_lifetime">The lifetime of the name.</param> /// <param name="data_scope">The scope of the data.</param> /// <param name="persist_data">Whether to persist data.</param> /// <param name="type_id">Optional type ID.</param> /// <param name="maximum_state_size">Maximum state size.</param> /// <param name="security_descriptor">Mandatory security descriptor.</param> /// <param name="throw_on_error">True to throw on error.</param> /// <returns>The created object.</returns> public static NtResult <NtWnf> Create( WnfStateNameLifetime name_lifetime, WnfDataScope data_scope, bool persist_data, WnfTypeId type_id, int maximum_state_size, SecurityDescriptor security_descriptor, bool throw_on_error) { if (security_descriptor == null) { throw new ArgumentNullException("Must specify a security descriptor"); } using (var sd_buffer = security_descriptor.ToSafeBuffer()) { return(NtSystemCalls.NtCreateWnfStateName(out ulong state_name, name_lifetime, data_scope, persist_data, type_id, maximum_state_size, sd_buffer) .CreateResult(throw_on_error, () => new NtWnf(state_name) { _security_descriptor = security_descriptor })); } }
public static extern NtStatus NtCreateWnfStateName( ref WnfStateName StateName, WnfStateNameLifetime NameLifetime, WnfDataScope DataScope, bool PersistData, ref WnfTypeId TypeId, uint MaximumStateSize, IntPtr SecurityDescriptor );