The difference between the two was supposed to be that WNetGetConnection required the drive to be actively connected, but sure if you want to switch that in and let me know if it works?
Error 234 is ERROR_MORE_DATA so it must behave contrary to documentation and append the data pointed to into the return...
Code:Dim bt() As Byte ReDim bt((MAX_PATH * 2 + 1) + LenB(tn)) lRet = WNetGetUniversalNameW(StrPtr("L:\"), UNIVERSAL_NAME_INFO_LEVEL, bt(0), UBound(bt) + 1) If lRet = 0 Then CopyMemory tn, bt(0), LenB(tn) Dim sPath As String sPath = PointerToStringW(tn.lpUniversalName) Debug.Print sPath End If




Reply With Quote
