Subj : NetShareAdd problem To : borland.public.cpp.borlandcpp,borland.public.cppbuilder.documentation,borland.public.cppbuilder.internet.socket,borland.public.cppbuilder.internet.web,borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.non-technical From : "Tiziano" Date : Wed Sep 10 2003 09:26 am Hello guys, I am using the api function NetShareAdd to share a directory in a local lan based on Windows XP, everything seems to work well, the directory is shared but if someone try to access it from a client PC the system send a message of "Access denied". If I remove and redo the sharing with explorer everything work fine. Is there someone tha can help me ? Thx everyone... Code NET_API_STATUS res; SHARE_INFO_2 p; DWORD parm_err = 0; p.shi2_netname = L"Ottimo"; p.shi2_type = STYPE_DISKTREE; // disk drive p.shi2_remark = L"TESTSHARE to test NetShareAdd"; p.shi2_permissions = 0; p.shi2_max_uses = 1000; p.shi2_current_uses = 10; p.shi2_path = L"C:\\Ottimo"; p.shi2_passwd = NULL; // no password res=NetShareAdd(NULL, 2, (LPBYTE) &p, &parm_err); .