VBA 64位API声明语句第007讲

VBA 64位API声明语句第007讲

跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望职场和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪陪父母,多陪陪家人,何乐而不为呢?我的教程一共九套,从入门开始一直讲到程序的分发,是学习利用VBA的实用教程。这份API资料是随高级教程赠送的.

这讲我们继续学习VBA 64位API声明语句第007讲,这些内容是MS的权威资料,看似枯燥,但对于想学习API函数的朋友是非常有用的。

【分享成果,随喜正能量】 大喜易失言,大怒易失礼,大惊易失态,大哀易失颜,大乐易失察,大惧易失节,大醉易失德,大话易失信,大欲易失命。谨记!。

当学员学习到高级阶段,如果引用API,这个资料可以直接查到64位写法。大多数情况下我们是将低版本的程序文件升级到高版本,这时您就不必为如下的错误提示所困扰了:

' //////////////////////////////////////////////////////////////////////

' //

' LUID_AND_ATTRIBUTES //

' //

' //////////////////////////////////////////////////////////////////////

'

Type LUID

LowPart As Long

HighPart As Long

End Type

Type LUID_AND_ATTRIBUTES

pLuid As LUID

Attributes As Long

End Type

' //////////////////////////////////////////////////////////////////////

' //

' ACL and ACE //

' //

' //////////////////////////////////////////////////////////////////////

'

' Define an ACL and the ACE format. The structure of an ACL header

' followed by one or more ACEs. Pictorally the structure of an ACL header

' is as follows:

'

' The current AclRevision is defined to be ACL_REVISION.

'

' AclSize is the size, in bytes, allocated for the ACL. This includes

' the ACL header, ACES, and remaining free space in the buffer.

'

' AceCount is the number of ACES in the ACL.

'

' begin_ntddk begin_ntifs

' This is the *current* ACL revision

Const ACL_REVISION = (2)

' This is the history of ACL revisions. Add a new one whenever

' ACL_REVISION is updated

Const ACL_REVISION1 = (1)

Const ACL_REVISION2 = (2)

Type ACL

AclRevision As Byte

Sbz1 As Byte

AclSize As Integer

AceCount As Integer

Sbz2 As Integer

End Type

' typedef ACL *PACL;

' end_ntddk

' The structure of an ACE is a common ace header followed by ace type

' specific data. Pictorally the structure of the common ace header is

' as follows:

' AceType denotes the type of the ace, there are some predefined ace

' types

'

' AceSize is the size, in bytes, of ace.

'

' AceFlags are the Ace flags for audit and inheritance, defined Integerly.

Type ACE_HEADER

AceType As Byte

AceFlags As Byte

AceSize As Integer

End Type

'

' The following are the predefined ace types that go into the AceType

' field of an Ace header.

Const ACCESS_ALLOWED_ACE_TYPE = &H0

Const ACCESS_DENIED_ACE_TYPE = &H1

Const SYSTEM_AUDIT_ACE_TYPE = &H2

Const SYSTEM_ALARM_ACE_TYPE = &H3

' The following are the inherit flags that go into the AceFlags field

' of an Ace header.

Const OBJECT_INHERIT_ACE = &H1

Const CONTAINER_INHERIT_ACE = &H2

Const NO_PROPAGATE_INHERIT_ACE = &H4

Const INHERIT_ONLY_ACE = &H8

Const VALID_INHERIT_FLAGS = &HF

' The following are the currently defined ACE flags that go into the

' AceFlags field of an ACE header. Each ACE type has its own set of

' AceFlags.

'

' SUCCESSFUL_ACCESS_ACE_FLAG - used only with system audit and alarm ACE

' types to indicate that a message is generated for successful accesses.

'

' FAILED_ACCESS_ACE_FLAG - used only with system audit and alarm ACE types

' to indicate that a message is generated for failed accesses.

' SYSTEM_AUDIT and SYSTEM_ALARM AceFlags

'

' These control the signaling of audit and alarms for success or failure.

Const SUCCESSFUL_ACCESS_ACE_FLAG = &H40

Const FAILED_ACCESS_ACE_FLAG = &H80

'

' We'll define the structure of the predefined ACE types. Pictorally

' the structure of the predefined ACE's is as follows:

' Mask is the access mask associated with the ACE. This is either the

' access allowed, access denied, audit, or alarm mask.

'

' Sid is the Sid associated with the ACE.

'

' The following are the four predefined ACE types.

' Examine the AceType field in the Header to determine

' which structure is appropriate to use for casting.

Type ACCESS_ALLOWED_ACE

Header As ACE_HEADER

Mask As Long

SidStart As Long

End Type

Type ACCESS_DENIED_ACE

Header As ACE_HEADER

Mask As Long

SidStart As Long

End Type

Type SYSTEM_AUDIT_ACE

Header As ACE_HEADER

Mask As Long

SidStart As Long

End Type

Type SYSTEM_ALARM_ACE

Header As ACE_HEADER

Mask As Long

SidStart As Long

End Type

' The following declarations are used for setting and querying information

' about and ACL. First are the various information classes available to

' the user.

'

Const AclRevisionInformation = 1

Const AclSizeInformation = 2

'

' This record is returned/sent if the user is requesting/setting the

' AclRevisionInformation

'

Type ACL_REVISION_INFORMATION

AclRevision As Long

End Type

'

' This record is returned if the user is requesting AclSizeInformation

'

Type ACL_SIZE_INFORMATION

我20多年的VBA实践经验,全部浓缩在下面的各个教程中:

特别声明:[VBA 64位API声明语句第007讲] 该文观点仅代表作者本人,今日霍州系信息发布平台,霍州网仅提供信息存储空间服务。

猜你喜欢

尼格买提又碎了!维也纳餐厅为中国游客铺红毯,小尼以为在等他(尼格买提感情)

众所周知,在今年春节的时候,多年未见的大魔术师刘谦,重新回到了春晚舞台上,然而让他想不到的是,他的魔术,竟然被小尼老师给“搞翻车”了。 而小尼老师在说自己“碎了”的时候,双手扶着帽子,为此,有网友猜测:对不…

尼格买提又碎了!维也纳餐厅为中国游客铺红毯,小尼以为在等他(尼格买提感情)

9月25日,『刘德华』线上演唱会,以歌声唤醒你的今日勇气(刘德演唱会1992年)

据悉,本次演唱会采用多场景沉浸式舞台设计,通过电影级摄制技术,将音乐与视觉艺术深度融合,力求在虚拟空间中传递真实的音乐感染力。 与近年常见的“线上演唱会”不同,本次制作团队特别注重内容的结构性创新。团队表示,…

9月25日,『刘德华』线上演唱会,以歌声唤醒你的今日勇气(刘德演唱会1992年)

『金晨』“下衣失踪”大秀长腿,网友:南法的风都嫉妒了!

『金晨』的时尚『穿搭』总是能引发网友的热议,这次也不例外。网友们纷纷表示:“『金晨』这身『穿搭』和南法的景色太搭了,简直就是画中人!”有人调侃道:“『金晨』这是要把时尚圈都‘玩坏’了吗?”这种时尚与保守的碰撞也引发了网友们的热烈…

『金晨』“下衣失踪”大秀长腿,网友:南法的风都嫉妒了!

2000内谁称王?1849元荣耀200凭旗舰电池、神摄,能否一骑绝尘?(2000千王之王)

荣耀200的绿洲护眼屏则从源头上解决了这一问题,让你在享受手机带来的便利的同时,也能保护好自己的视力。它能够捕捉到细腻的光影变化,还原真实的色彩,让每一张照片都仿佛是一幅艺术品。即使是拍摄美食,荣耀200也能…

2000内谁称王?1849元荣耀200凭旗舰电池、神摄,能否一骑绝尘?(2000千王之王)

『景甜』:素颜女神,美丽依旧,素颜下的真实,『高圆圆』:光芒背后的美(『景甜』气质)

近年来,随着『社交媒体』的兴起和公众审美的转变,人们开始不再满足于仅仅欣赏这些经过包装的完美形象,而是更加渴望一窥她们素颜下的真实面貌。那份从容与坦然不仅令人敬佩,也让人们看到了她作为一个母亲的坚韧和自信。 通过…

『景甜』:素颜女神,美丽依旧,素颜下的真实,『高圆圆』:光芒背后的美(『景甜』气质)