using : NetShareEnum
The NetShareEnum function retrieves information about each shared resource on a server.
NET_API_STATUS NetShareEnum(
LPWSTR servername,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);
the second parameter is to specify the level data eg:share names or share informations...
the third parameter is the return pointer to a struct or a buffer include the share infos
if level = 0 then bufptr is a pointer to a SHARE_INFO_0 struct (the shared info)