什么是“指针”? Inno Setup 中的 (PVOID) 数据类型等效
我正在尝试使用 RegSetKeySecurity ()
Windows API 函数,但 pSecurityDescriptor
参数是一个指针。 Inno Setup 中的“指针”(PVOID
) 数据类型等效项是什么?
I'm trying to use the RegSetKeySecurity()
function of Windows API, but the pSecurityDescriptor
parameter is a pointer. What is "pointer" (PVOID
) data type equivalence in Inno Setup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
小小迟到了。 xD
要解决这个问题,必须使用关键字“var”将函数参数声明为变量。这是 Pascal 函数参数中声明指向变量的标准方法。
哈哈,我会把想法带到逻辑的终点。首先,InnoSetup在所有32位情况下的执行过程,也就是说,没有人阻止你声明新类型(“PVOID”或“Pointer”)相应的维度(类型PVOID = Cardinal;Pointer = Integer;等等)更何况这只是为了方便认知。其次,在宣布外部 API 函数时,用变量替换索引(通过关键字“var”)已经足够了。第三,由于 Pascal 脚本中内存的特定组织,某些 API 函数将无法寻址此类变量,那么您就无法阻止声明使用内存的函数的外部函数(GetMemory、FreeMemory、FillMemory + GetMemory = AllocMemory)来自 Kernel32.dll。 GetMemory 仅返回内存站点上的索引。第四,为了从带有索引的块中提取数据,没有人会阻止使用来自同一 Kernel32.dll 的 CopyMemory、StringCchCopyA、lstrcpynA 等复制函数,其中输出参数将是必要维度的变量 (var),并且入口,块上的索引,其偏移量为必要值。
Little was late. xD
To solve this problem, you must announce function parameter as a variable, using the keyword 'var'. This is the standard method of declaration pointers to the variables in the function parameters for Pascal.
Hah, I will bring thought to the logical end. First, the executing process of InnoSetup in all cases of 32 bits, that is, to you nobody prevents to declare new type ("PVOID" or "Pointer") the corresponding dimension (type PVOID = Cardinal; Pointer = Integer; etc.) and the more so it only for convenience of perception. Secondly, replacement of the index by a variable (by means of a keyword of "var"), at the announcement of external API functions, happens more than enough. In the third, because of the specific organization of memory at Pascal-script, some API functions won't be able to address such variables, then you nobody prevents to declare external functions of function of work with memory (GetMemory, FreeMemory, FillMemory + GetMemory = AllocMemory) from Kernel32.dll. GetMemory just returns the index on a memory site. In the fourth, for extraction of data from the block with indexes to you nobody prevents to use functions of copying like CopyMemory, StringCchCopyA, lstrcpynA from the same Kernel32.dll where he output parameter will be variable (var) of the necessary dimension, and entrance, the index on the block with offset to the necessary value.
Inno Setup 中使用的 Pascal 脚本似乎根本不支持指针。也许您可以只传递一个基数(如果是 32 位),或者您可以在外部 DLL 中编写代码并从 Inno Setup 安装程序中调用它。
The Pascal Scripting used in Inno Setup seems not to support pointers at all. Maybe you can just pass a
cardinal
(if 32-bit), or you could write your code in an external DLL and call this from the Inno Setup installation program.