ich versuche gerade einen Treiber mithilfe der newdev.dll zu installieren. Leider bekomme ich beim versuch die Funktion "UpdateDriverForPlugAndPlayDevicesA" bzw. "UpdateDriverForPlugAndPlayDevicesW" auf zu rufen eine Fehlermeldung "Ungültiger Speicherzugriff".
Da ich nicht so oft mit DLL's arbeite dachte ich mir frag ich mal lieber nach ^^
Code: Alles auswählen
hwnd = 0
hardwareid$ = "USB\VID_0000&PID_0400"
path$ = "C:\Documents And Settings\Administrator\My Documents\Dropbox\HTK\USB\"
flag = 0
reboot = 0
Procedure.s GetSpecialFolder(iCSIDL.i)
Protected sPath.s = Space(#MAX_PATH)
If SHGetSpecialFolderPath_(#Null, @sPath, iCSIDL, 0) = #True
ProcedureReturn sPath
Else
ProcedureReturn ""
EndIf
EndProcedure
system32$ = GetSpecialFolder(#CSIDL_SYSTEM) + "\newdev.dll"
OpenLibrary(0, system32$)
Debug CallCFunction(0, "UpdateDriverForPlugAndPlayDevicesA", hwnd, @hardwareid$, @path$, flag, reboot)
CloseLibrary(0)