#include <windows.h>
#include <stdio.h>
#include <lm.h>
void main( int argc, CHAR *lpszArgv[ ])
{
PSHARE_INFO_502 BufPtr,p;
NET_API_STATUS res;
//LPTSTR lpszServer = NULL;
DWORD er=0,tr=0,resume=0, i;
do // begin do
{
res = NetShareEnum (NULL, 502, (LPBYTE *)&BufPtr, -1, &er, &tr, &resume);
//
// If the call succeeds,
//
if(res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
{
p=BufPtr;
for(i=1;i<=er;i++)
{
printf("%S\n",p->shi502_path);
p++;
}
NetApiBufferFree(BufPtr);
}
else
printf("Error: %ld\n",res);
}while (res==ERROR_MORE_DATA); // end do
return;
}