NetShareAdd

Allan Fernandes <[email protected]> Mon, 27 Dec 2004 09:55:50 +0000 (GMT)
Newsgroups gmane.comp.lang.delphi.jedi
Message-ID <[email protected]>

Hi ,

I'm using JEDI's implementation of the NetShareAdd
api. While executing I keep getting
ERROR_INVALID_PARAMETER in Win98 and some Error code =
998 in WinNT4.
In either case the folder does not get shared. I use
Delphi5

Please advice.
Thank You in advance.
below is my code.
********************************
uses
  ....svrapi,LmCons,LmErr;

procedure ....
var
  struShare_Info_2: Share_Info_2;
  result: NET_API_STATUS;
  ParmError : dword;
begin
  with struShare_Info_2 do
  begin
    shi2_netname := 'TestShr' ;   // I have already
created this folder in
my d:\
    shi2_type := STYPE_DISKTREE;    // Disk drive.
    shi2_remark := '';
    shi2_permissions := ACCESS_ALL; // ignored in
windows
    shi2_max_uses := 10 ;
    shi2_current_uses := 0;
    shi2_path :=  'd:';
    shi2_passwd := '';
  end;
  result :=
NetShareAdd('',2,@struShare_Info_2,ParmError);   // I
need share
on Local machine
  if (result <> NERR_Success) then
  begin
    case result of
      ERROR_BAD_NETPATH       : ShowMessage('Network
Path not found');
      ERROR_ACCESS_DENIED     : ShowMessage('Access
Denied');
      ERROR_INVALID_LEVEL     : ShowMessage('Invalid
Level');
      ERROR_INVALID_NAME      : ShowMessage('Invalid
Name');
      ERROR_INVALID_PARAMETER : ShowMessage('Invalid
Parameter');
      NERR_DuplicateShare     : ShowMessage('Duplicate
share');
      NERR_RedirectedPath     :
ShowMessage('Redirected Path');
      NERR_UnknownDevDir      : ShowMessage('Unkown
Dev Dir');
    end;
  end;
end;
*************************





		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Delphi-JEDI/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/