Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNC versus drive letter
Message
From
07/12/2001 20:40:34
 
 
To
07/12/2001 20:06:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00591571
Message ID:
00591573
Views:
20
> UNC name for the host computer drives

I chickened out and resorted to calling the Win32 Net API from an FLL function (shown below) but the same thing could easily be done with pure Fox via DECLARE DLL. Anyway, it's a lot easier than the other way round (finding drive mappings for arbitrary UNC paths).
// UNCPath (cPath, [nMode])
// nMode & 1<<0   return original path on error
FOXFUN( UNCPath )  {
   char const *s = _str_param(0, pp);
   char uni[MAX_PATH * 2];
   DWORD size = sizeof(uni);
   if (NO_ERROR == <B>WNetGetUniversalName</B>(s, UNIVERSAL_NAME_INFO_LEVEL, uni, &size))
      _RetChar(reinterpret_cast&lt;UNIVERSAL_NAME_INFO *&gt;(uni)->lpUniversalName);
   else
      _ret_str(_int_param(1, pp) & 1&lt;&lt;0 ? s : "");
} // 2001-10-12
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform