Home   Index   About
Ultimate Pack


Custom Search
Share Functions

The share functions control shared resources. A shared resource is a local resource on a server (for example, a disk directory, print device, or named pipe) that can be accessed by users and applications on the network. The share functions are:

NetShareAdd
Shares a resource on a server.
NetShareCheck
Queries whether a server is sharing a device.
NetShareDel
Deletes a share name from a server's list of shared resources.
NetShareEnum
Retrieves share information about each shared resource on a server.
NetShareGetInfo
Retrieves information about a specified shared resource on a server.
NetShareSetInfo
Sets a shared resource's parameters.

The WNetEnumResource function should be used instead of the NetShareEnum function, which is obsolete.

The NetShareAdd function allows a user or application to share a resource of a specific type using the specified share name. The NetShareAdd function requires the share name and local device name to share the resource. A user or application must have an account on the server to access the resource.

You may also specify a Security Descriptor to be associated with a share, which specifies which users will be allowed to access files through this share, and with what type of access.

LAN Manager defines three types of special share names for interprocess communication (IPC) and remote administration of the server:

  • IPC$, reserved for interprocess communication.

  • ADMIN$, reserved for remote administration.

  • A$, B$, C$ (and other local disk names followed by a dollar sign), assigned to local disk devices.

Share functions are available at four information levels:

SHARE_INFO_0
SHARE_INFO_1
SHARE_INFO_2
SHARE_INFO_502

The following information levels are valid only for NetShareSetInfo:

SHARE_INFO_1004
SHARE_INFO_1006

The following is supported only on Windows NT:

SHARE_INFO_1501

For NetShareSetInfo, parmnum values refer to the members of the SHARE_INFO structure, as follows. These values are used when indicating an error in a specific parameter through parm_err.

parmnum value
Member of SHARE_INFO structure
SHARE_NETNAME_PARMNUM
shi_netname
SHARE_TYPE_PARMNUM
shi_type
SHARE_REMARK_PARMNUM
shi_remark
SHARE_PERMISSIONS_PARMNUM
shi_permissions
SHARE_MAX_USES_PARMNUM
shi_max_uses
SHARE_CURRENT_USES_PARMNUM
shi_current_uses
SHARE_PATH_PARMNUM
shi_path
SHARE_PASSWD_PARMNUM
shi_passwd
SHARE_FILE_SD_PARMNUM
shi_security_descriptor


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun