Modify

Opened 10 years ago

Closed 10 years ago

#833 closed Bug (No Bug)

Bug in function DllOpen ()

Reported by: fristo Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

A Dll that not exist can not provide a handle. In this case the DllOpen function return value @error should set to -1.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         fristo

 Script Function:
	Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

	Local $nameDll="netapi32.dll"
	Local $Netapi
	
	$Netapi = DllOpen($nameDll)
	MsgBox(64, "@ERROR Of DllOpen", "Call DllOpen (" & $nameDll & ")" & @CRLF & @CRLF & "@error = " & @error)
	DllClose($Netapi)
	ExistDLL ($nameDll)


	$nameDll="net___api32.dll"
	$Netapi = DllOpen($nameDll)
	MsgBox(48, "@ERROR Of DllOpen", "Call DllOpen (" & $nameDll & ")" & @CRLF & @CRLF & "@error = " & @error)
	DllClose($Netapi)
	ExistDLL ($nameDll)
	
	Exit
	
	
; =============================================================================	


Func ExistDLL ($name)	
	
	Local $fullName = @SystemDir & "\" & $name
	
	If FileExists($fullName) > 0 Then
		MsgBox(0, "Result of FileExist", "File '" & $fullName & "'" & @CRLF & @CRLF & "exist")
	Else
		MsgBox(48, "Result of FileExist", "File '" & $fullName & "'" & @CRLF & @CRLF & "exist not")
	EndIf
	
EndFunc
	
	
; =============================================================================	

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

Or you could try reading the documentation and applying some critical thinking.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.