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讲] 该文观点仅代表作者本人,今日霍州系信息发布平台,霍州网仅提供信息存储空间服务。

猜你喜欢

中方表明态度,约谈英伟达,要求其自证清白,特朗普政府的“狼子野心”,已经藏不住了!(中方对此有何评论?)

今年4月,特朗普政府曾以“国家安全”为由,撤销英伟达H20芯片的对华出口许可。 2.确保美国企业垄断中国市场:美国财政部长坦言,中国已研发出与H20性能相当的芯片,但美国仍允许英伟达供货,就是为了避免本土芯片…

中方表明态度,约谈英伟达,要求其自证清白,特朗普政府的“狼子野心”,已经藏不住了!(中方对此有何评论?)

Summer夏老师-2025软考中级网络工程师第六版课程(夏老师黑发是真的吗)

但如果他懂得如何让App与智能手表、智能音箱、智能家居等通过蓝牙、Wi-Fi或NFC等无线技术进行无缝联动,那么他就为构建一个强大的生态系统贡献了关键力量。这种跨设备、跨平台的协同开发能力,是程序员价值重构的…

Summer夏老师-2025软考中级网络工程师第六版课程(夏老师黑发是真的吗)

精神分裂吃什么水果好得快(精神分裂症吃什么食物好得快)

精神分裂症患者可以适量吃香蕉、苹果、蓝莓、猕猴桃和橙子等水果,有助于辅助改善症状。精神分裂症的治疗主要依赖药物和心理干预,饮食调理仅能起到辅助作用。 香蕉富含色氨酸和维生素B6,色氨酸是合成5-羟色胺的前体物质,有助于调节情绪和改善睡眠

精神分裂吃什么水果好得快(精神分裂症吃什么食物好得快)

陆毅和郭京飞一个娶了姐姐,一个娶了妹妹,结果待遇千差万别?(陆毅和郭京飞是什么关系)

由于鲍莉与姐姐鲍蕾关系深厚,陆毅与郭京飞这对“连襟”也常常在家庭聚会中相遇。或许,这正是婚姻和家庭的美好之处——有些人被宠成了“贵客”,有些人甘心当“厨子”,但只要相爱,哪怕是这样的小小差别,也能成为幸福的…

陆毅和郭京飞一个娶了姐姐,一个娶了妹妹,结果待遇千差万别?(陆毅和郭京飞是什么关系)

不到8000元买败家之眼!ROG锐龙RTX5060游戏本这价位还要求啥(800块能买啥)

更令人惊喜的是,这并非一款简单的“低价阉割版”,它完整继承了ROG的硬核基因,以令人难以置信的性价比,将信仰与实用完美融合。此外,单条16GB DDR5内存和空置的M.2插槽,为玩家提供了充足的升级空间,这在…

不到8000元买败家之眼!ROG锐龙RTX5060游戏本这价位还要求啥(800块能买啥)