EldoS
 Table of Contents >  CBDisk.AddMountingPoint method
Navigation
Web site
Support
Table Of Contents

CBDisk.AddMountingPoint method

Filter:

Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CBDisk     See also    

Overview

Adds a mounting point for the storage.

Declaration

[Pascal]
    procedure AddMountingPoint(MountingPoint: TCBString);
    procedure AddMountingPoint( MountingPoint: TCBString; Flags : integer; AuthenticationID : PLUID );

    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    void AddMountingPoint(const unsigned short *mountingPoint);
    void AddMountingPoint( const unsigned short *mountingPoint, DWORD Flags, PLUID AuthenticationID);

[C++ (VCL)]
    void __fastcall AddMountingPoint(WideString MountingPoint);
    void __fastcall AddMountingPoint( WideString MountingPoint, DWORD Flags, PLUID AuthenticationID);

[C++ (.NET)]
    void AddMountingPoint(String ^MountingPoint);
    void AddMountingPoint( String ^MountingPoint, UInt32 Flags, Object^ AuthenticationID );

[C#]
    void AddMountingPoint(String MountingPoint);
    void AddMountingPoint( String MountingPoint, UInt32 Flags, Object AuthenticationID );

[VB.NET]
    Sub AddMountingPoint(ByVal MountingPoint As String)
    Sub AddMountingPoint( ByVal MountingPoint As String, ByVal Flags As UInt32, ByVal AuthenticationID As Object)

Parameters

  • MountingPoint - The path of the mounting point (see About Mounting Points topic)
  • Flags - Zero or more flags that specify parameters of mounting point creation (see details below).
    Several flags are joined using bitwise-OR in C++, C# and VB.NET.
  • AuthenticationId - Authentication ID of the session.
    This parameter can be NULL/null/Nothing/nil if CBDISK_SYMLINK_LOCAL flag is not set or if the mounting point is added for the "current" session.

Values of Flags

[Pascal] [C++ (VCL)] [C++ (Lib)] [C++ (.NET)] [C#] [VB.NET] [Java] Meaning
CBDISK_SYMLINK_SIMPLE
$00010000, 0x00010000, 00010000h
Creates a "simple" mounting point. Simple mounting point can be global (accessilbe from all user sessions) or local, visible in current or some other user session (see CBDISK_SYMLINK_LOCAL flag).
CBDISK_SYMLINK_MOUNT_MANAGER
$00020000, 0x00020000, 00020000h
Creates a mounting point visible in the mount manager and in Disk Manager applet of Microsoft Manager Console. Such mounting points can be mounted as folders on existing NTFS drive.
This flag can not be combined with CBDISK_SYMLINK_SIMPLE, CBDISK_SYMLINK_LOCAL or CBDISK_SYMLINK_NETWORK.
CBDISK_SYMLINK_NETWORK
$00040000, 0x00040000, 00040000h
Creates a "network" mounting point.
This flag can not be combined with CBDISK_SYMLINK_SIMPLE or CBDISK_SYMLINK_MOUNT_MANAGER.
CBDISK_SYMLINK_LOCAL
$10000000, 0x10000000, 10000000h
This is a supplementary flag, which specifies that the mounting point is local, visible in current or different user's session. For current session set AuthenticationID to nil / NULL / null / nothing. For other session set Authentication ID to the identifier of that session.
This flag can be combined with CBDISK_SYMLINK_SIMPLE and CBDISK_SYMLINK_NETWORK.
Additional flags for network mounting points
CBDISK_SYMLINK_NETWORK_ALLOW_MAP_AS_DRIVE
$00000001, 0x00000001, 00000001h
When the flag is set, a user can assign a drive letter to the "share" for example using "Map share as a drive" menu command in Explorer.
CBDISK_SYMLINK_NETWORK_HIDDEN_SHARE
$00000002, 0x00000002, 00000002h
Specifies that during the enumeration the share should be skipped. The share is still accessible for use if the user knows its name.
CBDISK_SYMLINK_NETWORK_READ_NETWORK_ACCESS
$00000004, 0x00000004, 00000004h
Tells the API to make a share, available for reading, from the added mounting point.
CBDISK_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS
$00000008, 0x00000008, 00000008h
Tells the API to make a share, available for reading and writing, from the added mounting point.

Description

Use this method to add a mounting point for mounted volume. Use DeleteMountingPoint to delete the mounting point.

Short form of the method (the one that accepts only MountingPoint parameter) creates a globally accessible mounting point.

Long form of the method can be used to create all types of mounting points as defined by combination of Flags method.

Read more About Mounting Points.

If you are creating the network mounting point, you can expose it as a network share which can be used by other computers (SMB share). This is done by specifying one of CBDISK_SYMLINK_NETWORK_READ_NETWORK_ACCESS or CBDISK_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS flags in Flags parameter. If the share is to be created, the following conditions must be met:

  1. The ServerName part of MountingPoint parameter must be either empty or equal to the value returned by GetComputerName() function of Windows API.
  2. The process, which creates a network share, must have proper security rights that allow creation of network shares. If the rights are insufficient, the function fails.
  3. CBDISK_SYMLINK_NETWORK_READ_NETWORK_ACCESS or CBDISK_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS flag must be the only flag set in Flags parameter.

NOTE: Network mounting points won't work with NTFS disks.

Call from...

This method may be called only from outside of callback / event handlers.

See also

StorageCharacteristics     StorageType     DeleteMountingPoint     GetMountingPoint     GetMountingPointCount     MountMedia    


Got questions or comments about this topic? Tell us about them.
Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2011, EldoS Corporation