打开services.au3,找到_Service_Create函数,你会发现有其中这样一段代码:
If IsArray($vDependencies) Then
Local $iDepend, $tagDepend
$iDepend = UBound($vDependencies) - 1
For $i = 0 To $iDepend
$tagDepend &= "wchar[" & StringLen($vDependencies[$i]) + 1 & "];"
Next
$tDepend = DllStructCreate(StringTrimRight($tagDepend, 1))
For $i = 0 To $iDepend
DllStructSetData($tDepend, $i + 1, $vDependencies[$i])
Next
Else
$tDepend = DllStructCreate("wchar[" & Number($vDependencies <> Default) * (StringLen($vDependencies) + 1) & "]")
DllStructSetData($tDepend, 1, $vDependencies)
EndIf
将这段代码替换为:
If IsArray($vDependencies) Then
Local $iDepend, $tagDepend
$iDepend = UBound($vDependencies) - 1
For $i = 0 To $iDepend
if $i = $iDepend Then
$tagDepend &= "wchar[" & StringLen($vDependencies[$i]) + 2 & "];"
Else
$tagDepend &= "wchar[" & StringLen($vDependencies[$i]) + 1 & "];"
EndIf
Next
$tDepend = DllStructCreate(StringTrimRight($tagDepend, 1))
For $i = 0 To $iDepend
DllStructSetData($tDepend, $i + 1, $vDependencies[$i])
Next
Else
$tDepend = DllStructCreate("wchar[" & Number($vDependencies <> Default) * (StringLen($vDependencies) + 2) & "]")
DllStructSetData($tDepend, 1, $vDependencies)
EndIf
指定依存服务的参数,是用NULL字符分割的字符串,最后应该追加一个NULL。 |