private static NtSection OpenSection(string name, bool read_only) { SectionAccessRights access = SectionAccessRights.MapRead; if (!read_only) { access |= SectionAccessRights.MapWrite; } return(NtSection.Open(name, null, access)); }
public NtMappedSection OpenMappedFile(bool writable) { SectionAccessRights accessRights = SectionAccessRights.MapRead; if (writable) { accessRights |= SectionAccessRights.MapWrite; } using (NtSection section = NtSection.DuplicateFrom(_ent.ProcessId, new IntPtr(_ent.Handle), accessRights)) { return(section.Map(writable ? ProtectionType.ReadWrite : ProtectionType.ReadOnly)); } }
public static extern NtStatus NtOpenSection(out SafeKernelObjectHandle SectionHandle, SectionAccessRights DesiredAccess, [In] ObjectAttributes ObjectAttributes);
public static extern NtStatus NtCreateSection(out SafeKernelObjectHandle SectionHandle, SectionAccessRights DesiredAccess, [In] ObjectAttributes ObjectAttributes, [In] LargeInteger SectionSize, ProtectionType Protect, SectionAttributes Attributes, SafeHandle FileHandle);
protected override sealed NtResult <NtSection> OpenInternal(ObjectAttributes obj_attributes, SectionAccessRights desired_access, bool throw_on_error) { return(NtSection.Open(obj_attributes, desired_access, throw_on_error)); }
public static extern NtStatus NtCreateSectionEx(out SafeKernelObjectHandle SectionHandle, SectionAccessRights DesiredAccess, [In] ObjectAttributes ObjectAttributes, [In] LargeInteger SectionSize, MemoryAllocationProtect Protect, SectionAttributes Attributes, SafeHandle FileHandle, MemSectionExtendedParameter[] ExtendedParameters, int ExtendedParameterCount);