Ciao a tutti,

Ho un problema con una funzione includa in una DLL che ho bisogno di usare.
Ho a disposizione alcuni esempi scritti in VB6 e C++ ed ho bisogno della versione in VB.NET
ho tentato di fare la conversione automatica da VB6 a VB.NET ma non funziona correttamente.

Specifiche del problema

1. Nella DLL sono incluse 2 funzioni chiamate "EupicdsmGetFlashInfo" e "EupicdsmGetFlashInfoW"

2. Le dichiarazioni in C++ sono:

codice:
EUPICDSM_LINK int __stdcall EupicdsmGetFlashInfo(
	const int index, 
	int& numDrives,
	char* drives, 
	int& drives_len, 
	char* serial, 
	int& serial_len);

Specifiche del fornitore:
drives [out] 
Pointer to char that receives the list of drive letters associated to the device. The drive letters have SCSI
format ( \\.\H: ) and they are separated by the terminating null character (ASCII code 0). A double terminating
null character is the end of list. If this parameter is NULL, function returns EUPICDSM_ERROR_PARAM_LEN
and iDriversLen receives the minimum size for containing the entire list.

EUPICDSM_LINK int __stdcall EupicdsmGetFlashInfoW(
	const int index, 
	int& numDrives,
	BSTR* pDrives, 
	BSTR* pSerial);

Specifiche del fornitore: 
pDrives [out] 
Pointer to wide character string that receives the list of drive letters associated to the device. The drive
letters have SCSI format ( \\.\H: ) and they are separated by the terminating null character (ASCII code 0). A
double terminating null character is the end of list.
3. Le dichiarazioni in VB6 sono:

codice:
EupicdsmGetFlashInfo - NOT DECLARED in the example ! 

Declare Function EupicdsmGetFlashInfoW Lib "eupicdsm.dll" (
	ByVal iIndex As Long, 
	ByRef iNumDrives As Long, 
	ByRef pDrives As String, 
	ByRef pSN As String) As Long
4. Il mio tentativo di conversione in VB.NET:

codice:
Declare Function EupicdsmGetFlashInfo Lib "eupicdsm.dll" (
	ByRef index As Long, 
	ByRef numDrives As Long, 
	ByRef drives() As Byte, 
	ByRef drives_len As Long, 
	ByRef serial() As Byte, 
	ByRef serial_len As Long) As PD_RETURNVALUES

Declare Function EupicdsmGetFlashInfoW Lib "eupicdsm.dll" (
	ByRef iIndex As Long, 
	ByRef iNumDrives As Long, 
	ByRef pDrives As String, 
	ByRef pSN As String) As PD_RETURNVALUES
Problema:

Il risultato della funzione EupicdsmGetFlashInfoW (come dichiarato al punto 4.) è errato:
Nella stringa pDrives viene restituito solo il nome del primo driver anche se ce ne sono di più (es 2 o 3)
Suppongo che l'errore sia dovuto all'uso del carattere null (ASCII code 0) come separatore.
Ho provato anche ad usare la funzione "EupicdsmGetFlashInfo" ma da errore.

C'è qualcuno che mi può dare un consiglio/aiuto?

vi ringrazio in anticipo
un saluto a tutti
Boris

PS. il fornitore non da supporto per VB.NET :-( :-(