| Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
|
Retrieve the UNC version of a file's name
(1 votes). Leave comments and/ or rate it.
The function needed for this is WNetGetUniversalName. The online help (win32.hlp) says about this function's arguments:
Points to a buffer that receives the type of data structure specified by the dwInfoLevel parameter. This data structure has a pointer to a string buffer: typedef struct _UNIVERSAL_NAME_INFO { /* uni */ LPTSTR lpUniversalName; } UNIVERSAL_NAME_INFO; The UNIVERSAL_NAME_INFO structure contains a pointer to a Universal Naming Convention (UNC) name string. As I found out, this is wrong. In fact, it contains a pointer to itself followed by the string buffer. Since the pointer takes 4 Bytes, the string starts at Buffer[4]. This piece of code works:
Comments:
| |||||||||||||||||||||||