找回密码
 加入
搜索
查看: 6016|回复: 10

[AU3基础] <SetupApi.au3> 与 <Services.au3>冲突,怎么解决?

    [复制链接]
发表于 2010-3-11 10:02:56 | 显示全部楼层 |阅读模式
下载了P大侠的SETUPAPI.AU3,单独使用没有任何问题,集成在其他程序脚本里,编译时报错,经过排查是与

;#include <GDIPlus.au3>
;#include <Services.au3>

这两个UDF冲突,单独使用都没有问题,请问改如何解决?


以下是错误代码:

D:\autoit3\Include\SecurityConstants.au3(14,75) : ERROR: $SE_ASSIGNPRIMARYTOKEN_NAME previously declared as a 'Const'
Global Const $SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(15,49) : ERROR: $SE_AUDIT_NAME previously declared as a 'Const'
Global Const $SE_AUDIT_NAME = "SeAuditPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(16,51) : ERROR: $SE_BACKUP_NAME previously declared as a 'Const'
Global Const $SE_BACKUP_NAME = "SeBackupPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(17,64) : ERROR: $SE_CHANGE_NOTIFY_NAME previously declared as a 'Const'
Global Const $SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(19,68) : ERROR: $SE_CREATE_PAGEFILE_NAME previously declared as a 'Const'
Global Const $SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(20,70) : ERROR: $SE_CREATE_PERMANENT_NAME previously declared as a 'Const'
Global Const $SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(21,62) : ERROR: $SE_CREATE_TOKEN_NAME previously declared as a 'Const'
Global Const $SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(22,49) : ERROR: $SE_DEBUG_NAME previously declared as a 'Const'
Global Const $SE_DEBUG_NAME = "SeDebugPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(25,76) : ERROR: $SE_INC_BASE_PRIORITY_NAME previously declared as a 'Const'
Global Const $SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(26,66) : ERROR: $SE_INCREASE_QUOTA_NAME previously declared as a 'Const'
Global Const $SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(27,60) : ERROR: $SE_LOAD_DRIVER_NAME previously declared as a 'Const'
Global Const $SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(28,60) : ERROR: $SE_LOCK_MEMORY_NAME previously declared as a 'Const'
Global Const $SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(29,68) : ERROR: $SE_MACHINE_ACCOUNT_NAME previously declared as a 'Const'
Global Const $SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(31,78) : ERROR: $SE_PROF_SINGLE_PROCESS_NAME previously declared as a 'Const'
Global Const $SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(32,68) : ERROR: $SE_REMOTE_SHUTDOWN_NAME previously declared as a 'Const'
Global Const $SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(33,53) : ERROR: $SE_RESTORE_NAME previously declared as a 'Const'
Global Const $SE_RESTORE_NAME = "SeRestorePrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(34,55) : ERROR: $SE_SECURITY_NAME previously declared as a 'Const'
Global Const $SE_SECURITY_NAME = "SeSecurityPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(35,55) : ERROR: $SE_SHUTDOWN_NAME previously declared as a 'Const'
Global Const $SE_SHUTDOWN_NAME = "SeShutdownPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(37,74) : ERROR: $SE_SYSTEM_ENVIRONMENT_NAME previously declared as a 'Const'
Global Const $SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(38,66) : ERROR: $SE_SYSTEM_PROFILE_NAME previously declared as a 'Const'
Global Const $SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(39,59) : ERROR: $SE_SYSTEMTIME_NAME previously declared as a 'Const'
Global Const $SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(40,66) : ERROR: $SE_TAKE_OWNERSHIP_NAME previously declared as a 'Const'
Global Const $SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(41,45) : ERROR: $SE_TCB_NAME previously declared as a 'Const'
Global Const $SE_TCB_NAME = "SeTcbPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(42,72) : ERROR: $SE_UNSOLICITED_INPUT_NAME previously declared as a 'Const'
Global Const $SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\SecurityConstants.au3(43,51) : ERROR: $SE_UNDOCK_NAME previously declared as a 'Const'
Global Const $SE_UNDOCK_NAME = "SeUndockPrivilege"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(136,39) : ERROR: $GENERIC_ALL previously declared as a 'Const'
Global Const $GENERIC_ALL = 0x10000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(137,43) : ERROR: $GENERIC_EXECUTE previously declared as a 'Const'
Global Const $GENERIC_EXECUTE = 0x20000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(138,41) : ERROR: $GENERIC_WRITE previously declared as a 'Const'
Global Const $GENERIC_WRITE = 0x40000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(139,40) : ERROR: $GENERIC_READ previously declared as a 'Const'
Global Const $GENERIC_READ = 0x80000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(373,48) : ERROR: $TOKEN_ASSIGN_PRIMARY previously declared as a 'Const'
Global Const $TOKEN_ASSIGN_PRIMARY = 0x00000001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(374,43) : ERROR: $TOKEN_DUPLICATE previously declared as a 'Const'
Global Const $TOKEN_DUPLICATE = 0x00000002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(375,45) : ERROR: $TOKEN_IMPERSONATE previously declared as a 'Const'
Global Const $TOKEN_IMPERSONATE = 0x00000004
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(376,39) : ERROR: $TOKEN_QUERY previously declared as a 'Const'
Global Const $TOKEN_QUERY = 0x00000008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(377,46) : ERROR: $TOKEN_QUERY_SOURCE previously declared as a 'Const'
Global Const $TOKEN_QUERY_SOURCE = 0x00000010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(378,51) : ERROR: $TOKEN_ADJUST_PRIVILEGES previously declared as a 'Const'
Global Const $TOKEN_ADJUST_PRIVILEGES = 0x00000020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(379,47) : ERROR: $TOKEN_ADJUST_GROUPS previously declared as a 'Const'
Global Const $TOKEN_ADJUST_GROUPS = 0x00000040
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(380,48) : ERROR: $TOKEN_ADJUST_DEFAULT previously declared as a 'Const'
Global Const $TOKEN_ADJUST_DEFAULT = 0x00000080
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Constants.au3(381,50) : ERROR: $TOKEN_ADJUST_SESSIONID previously declared as a 'Const'
Global Const $TOKEN_ADJUST_SESSIONID = 0x00000100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Services.au3(58,31) : ERROR: $DELETE previously declared as a 'Const'
Global Const $DELETE = 0x10000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Services.au3(59,37) : ERROR: $READ_CONTROL previously declared as a 'Const'
Global Const $READ_CONTROL = 0x20000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Services.au3(60,34) : ERROR: $WRITE_DAC previously declared as a 'Const'
Global Const $WRITE_DAC = 0x40000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Services.au3(61,36) : ERROR: $WRITE_OWNER previously declared as a 'Const'
Global Const $WRITE_OWNER = 0x80000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\Include\Services.au3(1452,65) : ERROR: _Service_QueryStartType() already defined.
Func _Service_QueryStartType($sServiceName, $sComputerName = "")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
发表于 2010-3-11 10:24:52 | 显示全部楼层
两份里有重叠的 常量 函数

把错误部分出现的 两份里面随便哪里一份里 删掉
发表于 2010-3-11 10:43:43 | 显示全部楼层
把#include <SetupAPI.au3>放在#include <Services.au3>后面。
上面的报错只是AutoIt自检的BUG,SetupApi在定义一个常量之前,已经用IsDeclared检查过了。

#include <GDIPlus.au3>
#include <Services.au3>
#include <SetupAPI.au3>
发表于 2010-3-11 11:12:45 | 显示全部楼层
- -|||| 发现有2个重名函数,现在修改,等会你下载LocalSecurityAuthority.au3。 - -|||
 楼主| 发表于 2010-3-11 12:45:58 | 显示全部楼层
谢谢P大~~又解决了我的问题:)
发表于 2010-3-11 17:39:44 | 显示全部楼层
呵呵,学习一下。。
 楼主| 发表于 2010-3-14 10:41:58 | 显示全部楼层
P大,什么时候能把这个API的UDF重新搞一下呀~
发表于 2010-3-14 17:57:50 | 显示全部楼层
回复 7# 58fly


    不是发信息告诉你了吗,你没看到?
问题不在SetupApi.au3,而是包含其中的LocalSecurityAuthority.au3,3天前就已经把这个库文件修复好并上传了,去UDF区下载。
另外,感谢你还有这个问题,使我发现LocalSecurityAuthority.au3中的错误。
发表于 2021-3-16 09:09:16 | 显示全部楼层
好东西啊!小白的福音!!!!
发表于 2021-3-16 09:13:08 | 显示全部楼层
这个帖子真不错!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-23 02:20 , Processed in 0.079498 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表