You might take a look at Roland Smith's netquery code example on his web site.
http://www.topwizprogramming.com/freecode_netquery.html
Search the function of_WNetGetConnection() in n_netapi..
Quick compare...
Function ulong WNetGetConnection ( &
string lpszLocalName, &
ref string lpszRemoteName, &
ref ulong buflen &
) Library "mpr.dll" Alias For "WNetGetConnectionW"