VBA 64位API声明语句第007讲

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

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

今日霍州(www.jrhz.info)©️

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

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

今日霍州(www.jrhz.info)©️

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

' //

' 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

今日霍州(www.jrhz.info)©️

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

今日霍州(www.jrhz.info)©️

今日霍州(www.jrhz.info)©️

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

猜你喜欢

AI写作哪个网站好?优采云自动写文章真实体验(ai写小说的软件是什么)

它们给你一篇看起来完整的文章,但你仔细读,逻辑是断的,前言不搭后语。那些太短的、不通顺的、带敏感词的、或者内容压根不相关的,全给筛掉了。我最初就是设置了几个关键词,让它每天给我“写”五篇原创试试。 …

AI写作哪个网站好?优采云自动写文章真实体验(ai写小说的软件是什么)

今日科普丨手机续航暴增的秘密,竟然是“硅碳负极”?(手机科普知识简短)

大家是否曾为手机一天三充抓狂?出门必带充电宝的电量焦虑,现在居然被一个新材料轻松破解!手机续航的飞跃式提升,背后藏着的核心密码就是硅碳负极。 来源:中国科普博览…

今日科普丨手机续航暴增的秘密,竟然是“硅碳负极”?(手机科普知识简短)

奥美拉唑与吗丁啉能同时吃吗(奥美拉唑与吗丁啉哪个好)

奥美拉唑与吗丁啉能否同时服用是不少朋友关心的问题。这两种药物作为治疗胃部疾病的常见选择,广泛被人们所熟知。面对快节奏生活带来的饮食不规律与不平衡,越来越多的人遭受胃病困扰,因此,它们成为了许多患者的常备药物

奥美拉唑与吗丁啉能同时吃吗(奥美拉唑与吗丁啉哪个好)

四版“金笛秀才”【余鱼同】对比,哪一个让你最难忘?

该剧中饰演“金笛秀才”余鱼同的是『夏雨』,可能听名字很多人想不起来是谁,他就是后来83版《射雕英雄传》中丘处机的扮演者。 这版余鱼同和李沅芷是我最喜欢的一版,谢君豪饰演余鱼同,孙莉饰演李沅芷,两人的风头甚至盖过…

四版“金笛秀才”【余鱼同】对比,哪一个让你最难忘?

“我们”之后,只剩背影:『李晨』『范冰冰』的童话,败给了现实

那时没人相信,这场被称作“『娱乐圈』️最稳CP”的爱情,会在四年后,以一句“我们不再是我们”悄然落幕。如今,『李晨』退居幕后,鲜少露面;『范冰冰』专注制片,不再谈情。 而爱情最残酷的真相就是: 再轰动的官宣,也抵不过一…

“我们”之后,只剩背影:『李晨』『范冰冰』的童话,败给了现实