阅读:744回复:8
看看这个,用户被禁言,该主题自动屏蔽! |
|
沙发#
发布于:2004-08-12 23:13
ZwCreateSection
The ZwCreateSection routine creates a section object and returns a section object handle with the specified desired access. NTSTATUS ZwCreateSection( OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL ); Parameters SectionHandle Pointer to a variable that will receive the section object handle if this call is successful. DesiredAccess Specifies the ACCESS_MASK value that expresses the requested access to the section object. The system-defined set of DesiredAccess flags defines the following specific access rights for section objects. Flag Meaning SECTION_EXTEND_SIZE The size of the section can be dynamically extended. SECTION_MAP_EXECUTE Views of this section are executable. SECTION_MAP_READ Views of this section are readable. SECTION_MAP_WRITE Views of this section are writeable. SECTION_QUERY The section object can be queried for information about the section. Drivers should set this bit. SECTION_ALL_ACCESS All of the above flags ORed with the system-defined STANDARD_RIGHTS_REQUIRED. ObjectAttributes Pointer to a structure that contains the attributes of the section to be opened. The structure was previously initialized by calling InitializeObjectAttributes. If the caller is running in the system process context, this parameter can be NULL. Otherwise, the caller must set the OBJ_KERNEL_HANDLE attribute in the call to InitializeObjectAttributes. MaximumSize Specifies the maximum size, in bytes, of the section. This value is rounded up by ZwCreateSection to the nearest multiple of PAGE_SIZE. If the section is backed by the paging file, MaximumSize specifies the actual size of the section. If the section is backed by an ordinary file, MaximumSize specifies the maximum size to which the file can be extended or mapped. SectionPageProtection Specifies the protection to place on each page in the section. Specify one of the following: PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE, or PAGE_WRITECOPY. For a description of each PAGE_XXX value, see the CreateFileMapping routine in the Platform SDK. AllocationAttributes Specifies a bitmask of SEC_XXX flags that determine the allocation attributes of the section. For a description of the possible SEC_XXX flags, see the documentation of the CreateFileMapping routine in the Platform SDK. FileHandle Optionally specifies a handle for an open file object. If the value of FileHandle is NULL, the section is backed by the paging file. Otherwise the section is backed by the specified file. Headers Declared in ntddk.h. Include ntddk.h. Return Value ZwCreateSection returns STATUS_SUCCESS on success, or the appropriate error code on failure. Possible error status codes include the following: STATUS_FILE_LOCK_CONFLICT The file specified by the FileObject parameter is locked. STATUS_INVALID_FILE_FOR_SECTION The file specified by FileObject does not support sections. STATUS_INVALID_PAGE_PROTECTION The value specified for the SectionPageProtection parameter is invalid. STATUS_MAPPED_FILE_SIZE_ZERO The size of the file specified by FileObject is zero, and MaximumSize is zero. STATUS_SECTION_TOO_BIG The value of MaximumSize is too big. This occurs when either MaximumSize is greater than the system-defined maximum for sections, or if MaximumSize is greater than the specified file and the section is not writeable. Comments Any handle that is obtained from ZwCreateSection must eventually be released by calling ZwClose. Driver routines that run in a process context other than that of the system process must set the OBJ_KERNEL_HANDLE attribute for the ObjectAttributes parameter of ZwCreateSection. This restricts the use of the handle returned by ZwCreateSection to processes that are running in kernel mode. Otherwise, the handle can be accessed by the process in whose context the driver is running. For more information on setting up mapped sections and views of memory, see Sections and Views. Callers of ZwCreateSection must be running at IRQL = PASSIVE_LEVEL. See Also ACCESS_MASK, InitializeObjectAttributes, ZwClose, ZwMapViewOfSection, ZwOpenSection, ZwUnmapViewOfSection Built on Friday, April 11, 2003 |
|
|
板凳#
发布于:2004-08-12 23:43
用户被禁言,该主题自动屏蔽! |
|
地板#
发布于:2004-08-12 23:53
用户被禁言,该主题自动屏蔽! |
|
地下室#
发布于:2004-08-13 09:58
自己添加声明呗 :D
|
|
5楼#
发布于:2004-08-13 10:49
用户被禁言,该主题自动屏蔽! |
|
6楼#
发布于:2004-08-13 12:09
太难了。
|
|
7楼#
发布于:2004-08-15 12:38
这个我也能找到,不过是在2000下的ddk中没有声明。 你这个笨猫,去sdk招招,ddk,msdn,sdk都找找啊 找到了给我1000分啊,别忘了 :D |
|
|
8楼#
发布于:2004-08-15 13:37
[quote]这个我也能找到,不过是在2000下的ddk中没有声明。 你这个笨猫,去sdk招招,ddk,msdn,sdk都找找啊 找到了给我1000分啊,别忘了 :D [/quote] |
|