Tom.Cat
禁止发言
禁止发言
  • 注册日期2001-10-10
  • 最后登录2019-07-29
  • 粉丝1
  • 关注0
  • 积分-53792分
  • 威望197411点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
  • 社区居民
阅读:744回复:8

看看这个,

楼主#
更多 发布于:2004-08-12 23:11
用户被禁言,该主题自动屏蔽!
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
沙发#
发布于: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
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
Tom.Cat
禁止发言
禁止发言
  • 注册日期2001-10-10
  • 最后登录2019-07-29
  • 粉丝1
  • 关注0
  • 积分-53792分
  • 威望197411点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
  • 社区居民
板凳#
发布于:2004-08-12 23:43
用户被禁言,该主题自动屏蔽!
Tom.Cat
禁止发言
禁止发言
  • 注册日期2001-10-10
  • 最后登录2019-07-29
  • 粉丝1
  • 关注0
  • 积分-53792分
  • 威望197411点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2004-08-12 23:53
用户被禁言,该主题自动屏蔽!
arthurtu
驱动巨牛
驱动巨牛
  • 注册日期2001-11-08
  • 最后登录2020-12-19
  • 粉丝0
  • 关注0
  • 积分26分
  • 威望161点
  • 贡献值0点
  • 好评度35点
  • 原创分0分
  • 专家分0分
  • 社区居民
地下室#
发布于:2004-08-13 09:58
自己添加声明呗 :D
Tom.Cat
禁止发言
禁止发言
  • 注册日期2001-10-10
  • 最后登录2019-07-29
  • 粉丝1
  • 关注0
  • 积分-53792分
  • 威望197411点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
  • 社区居民
5楼#
发布于:2004-08-13 10:49
用户被禁言,该主题自动屏蔽!
jec017
驱动太牛
驱动太牛
  • 注册日期2002-08-22
  • 最后登录2008-01-09
  • 粉丝0
  • 关注0
  • 积分91分
  • 威望10点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2004-08-13 12:09
太难了。
KungFu
驱动大牛
驱动大牛
  • 注册日期2001-09-27
  • 最后登录2008-04-08
  • 粉丝0
  • 关注0
  • 积分221分
  • 威望24点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2004-08-15 12:38
这个我也能找到,不过是在2000下的ddk中没有声明。
怎么办?


你这个笨猫,去sdk招招,ddk,msdn,sdk都找找啊

找到了给我1000分啊,别忘了 :D
我不写驱动好多年
Sundsea
驱动老牛
驱动老牛
  • 注册日期2003-05-06
  • 最后登录2012-06-05
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望35点
  • 贡献值0点
  • 好评度15点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2004-08-15 13:37
[quote]这个我也能找到,不过是在2000下的ddk中没有声明。
怎么办?


你这个笨猫,去sdk招招,ddk,msdn,sdk都找找啊

找到了给我1000分啊,别忘了 :D [/quote]
游客

返回顶部