Micha1405 Posted April 24, 2006 Share Posted April 24, 2006 (edited) can anyone help me with this problem ? http://www.autoitscript.com/forum/index.ph...t=0#entry176066it will not work Edited April 24, 2006 by Micha1405 My TrayToolBar Link to comment Share on other sites More sharing options...
Developers Jos Posted April 24, 2006 Developers Share Posted April 24, 2006 can anyone help me with this problem ? http://www.autoitscript.com/forum/index.ph...t=0#entry176066it will not work Doesn't belong in Idea lab... moved SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GaryFrost Posted April 24, 2006 Share Posted April 24, 2006 (edited) slight mod to Larry's post $ptr=DllStructCreate("dword;char[260];char[260];char[260]") $signed=DllCall("setupapi.dll","int","SetupVerifyInfFile","wstr",@WindowsDir & "\inf\machine.inf", _ "ptr",0,"ptr",DllStructGetPtr($ptr)) If $signed[0] Then MsgBox(0,"Signed?",DllStructGetData($ptr,2) & @LF & DllStructGetData($ptr,3) & @LF & DllStructGetData($ptr,4)) Else MsgBox(0,"Error","DllCall") Endif Edited April 24, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Micha1405 Posted April 24, 2006 Author Share Posted April 24, 2006 thx gafrost for fast reply! but it will not work with signed or unsigned driver My TrayToolBar Link to comment Share on other sites More sharing options...
GaryFrost Posted April 24, 2006 Share Posted April 24, 2006 thx gafrost for fast reply! but it will not work with signed or unsigned driverhttp://msdn.microsoft.com/library/default....rifyinffile.aspmake sure you meet the requirements at the bottom of the page. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Micha1405 Posted April 24, 2006 Author Share Posted April 24, 2006 Thanks for helping, is it right that ther must be a server ? or can it run only on a standalone XP client ? sorry for the bad english i'm from germany My TrayToolBar Link to comment Share on other sites More sharing options...
GaryFrost Posted April 24, 2006 Share Posted April 24, 2006 Thanks for helping, is it right that ther must be a server ? or can it run only on a standalone XP client ?sorry for the bad english i'm from germanyyou can run it on XP client.think you might want to google on SetupVerifyInfFile SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Micha1405 Posted April 24, 2006 Author Share Posted April 24, 2006 (edited) i have XP with SP2 and this script to check 2 drivers with $TestInf1 and $TestInf2. Script: $TestInf1="E:\Drivers\AtiFireGL500\CX_30107.inf" ;$TestInf2="E:\Drivers\PDA Driver\wceusbsh.inf" $ptr=DllStructCreate("dword;char[260];char[260];char[260]") $signed=DllCall("setupapi.dll","int","SetupVerifyInfFile","wstr",$TestInf1, "ptr",0,"ptr",DllStructGetPtr($ptr)) If $signed[0] Then MsgBox(0,"",$signed[0]) ;debug only MsgBox(0,"Signed?",DllStructGetData($ptr,2) & @LF & DllStructGetData($ptr,3) & @LF & DllStructGetData($ptr,4)) Else MsgBox(0,"Error","DllCall") Endif both value of $signed[0] will return 1 but $TestInf1 is not signed and $TestInf2 is signed Edited April 24, 2006 by Micha1405 My TrayToolBar Link to comment Share on other sites More sharing options...
Micha1405 Posted April 25, 2006 Author Share Posted April 25, 2006 (edited) another solution: here is my script to check hardware driver is signed or not: ; AutoIt Version: Beta 3.1.110 ; Author: michael.hiss@gmx.de ; ; Script Function: ; check driver is signed or not / required chktrust.exe ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> #include <Constants.au3> Dim $DriverDir="c:\mydriver" Dim $app="Check driver is sign" Dim $catFile,$TestInf,$rc,$signed _main();start program ;----------------------------functions------------------------------------------------ func _Main() $mainForm=GUICreate($app,400,150) $button1=GUICtrlCreateButton("Select inf File",20,80) $Label1=GUICtrlCreateLabel("Cat File:",20,15) $CatLabel=GUICtrlCreateLabel("",20,50,350,20,BitOr($SS_SIMPLE,$SS_SUNKEN)) $Statuslabel=GUICtrlCreateLabel("",0,130,400,20,BitOr($SS_SIMPLE,$SS_SUNKEN)) if not FileExists(@ScriptDir&"\chktrust.exe") Then MsgBox(64,$app,"File checktrust.exe is not aviable!" &chr(10) &"Please copy 'chktrust.exe' in your scriptdir") Exit EndIf GUISetState(@SW_SHOW) ; While 1;Run Gui until it closed $msg = GUIGetMsg() Select case $msg=$button1 GUICtrlSetData($CatLabel,"") GUICtrlSetData($Statuslabel,"") $TestInf=FileOpenDialog("Select inf File",$DriverDir,"Inf Files (*.inf)", 1 + 4 ) If @error Then MsgBox(4096,"","No inf file chosen") Else $catFile=_RetrieveCatFile($catFile) if $catFile<>"" then GUICtrlSetData($CatLabel,@WorkingDir&"\"&$catFile) if not FileExists(@ScriptDir&"\chkdriver.cmd") then _WriteTempCMD() _CheckSigned() GUICtrlSetData($Statuslabel,"Driver "&StringTrimRight($signed,2)) Else GUICtrlSetData($Statuslabel,"Driver not signed catalogfile file not exist") EndIf EndIf case $msg=$GUI_EVENT_CLOSE Exit EndSelect WEnd EndFunc Func _RetrieveCatFile($catFile) $catFile=IniRead($TestInf,"Version","CatalogFile","NotFound") if $catFile="NotFound" Then $catFile=IniRead($TestInf,"Version","CatalogFile.NT","") if $catFile="" Then MsgBox(0,"","No Catalog File in inf") Else EndIf EndIf return $catFile EndFunc func _CheckSigned() $command =@ScriptDir&"\chkdriver.cmd"&" "& @WorkingDir&"\"& $catFile $rc = Run(@ComSpec & " /c "&$command,@WorkingDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) $signed = StdoutRead($rc) return $signed EndFunc Func _WriteTempCMD() $Cmdfile=FileOpen(@ScriptDir&"\chkdriver.cmd",2) FileWriteLine($Cmdfile,"@echo off") FileWriteLine($Cmdfile,"%CD%\chktrust.exe -q %1 >nul") FileWriteLine($Cmdfile,"if %errorlevel%==1 goto NoTrust") FileWriteLine($Cmdfile,"echo is signed") FileWriteLine($Cmdfile,"goto end") FileWriteLine($Cmdfile,":NoTrust") FileWriteLine($Cmdfile,"echo not signed") FileWriteLine($Cmdfile,":end") FileClose($Cmdfile) EndFunc Edited April 25, 2006 by Micha1405 My TrayToolBar Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now