Local $ErrorOutput = DllStructCreate("wchar[128]")
Local $Output = DllStructCreate("wchar[1024]")
Local $DeviceName
; Local Dim $aResult[5]
Local $hDLL = DllOpen("PB.Ex_MTP_x64.dll")
; Local $hDLL = DllOpen("PB.Ex_MTP_x86.dll")
If @error Then
MsgBox(0, "", "@error")
EndIf
DllCall($hDLL, "int", "ExamineMTP", "ptr", DllStructGetPtr($ErrorOutput))
If @error Then
MsgBox(0, "ExamineMTP", "@error")
EndIf
; While 1
$aResult = DllCall($hDLL, "int", "NextMTPEntry", "ptr", DllStructGetPtr($ErrorOutput))
If @error Then
MsgBox(0, "NextMTPEntry", "@error")
EndIf
; If $aResult[0] Then
DllCall($hDLL, "int", "MTPEntryName", "ptr", DllStructGetPtr($Output), "ptr", DllStructGetPtr($ErrorOutput))
$DeviceName = DllStructGetData($Output, 1)
MsgBox(0, "", $DeviceName)
; EndIf
; Wend
DllCall($hDLL, "int", "OpenMTP", "int", "1", "WSTR", $DeviceName, "ptr", DllStructGetPtr($ErrorOutput))
If @error Then
MsgBox(0, "OpenMTP", "@error")
EndIf
DllCall($hDLL, "int", "GetMTPManufacturer", "int", "1", "ptr", DllStructGetPtr($Output), "ptr", DllStructGetPtr($ErrorOutput))
If @error Then
MsgBox(0, "GetMTPManufacturer", "@error")
EndIf
MsgBox(0, "GetMTPManufacturer", DllStructGetData($Output, 1))
DllCall($hDLL, "int", "CloseMTP", "int", "1", "ptr", DllStructGetPtr($ErrorOutput))
DllClose($hDLL)
$ErrorOutput = 0
$Output = 0