Kernel32SetVolumeMountPoint Method
Associates a volume with a drive letter or a directory on another volume.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool SetVolumeMountPoint(
string volumeMountPoint,
string volumeName
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function SetVolumeMountPoint (
volumeMountPoint As String,
volumeName As String
) As Boolean
Dim volumeMountPoint As String
Dim volumeName As String
Dim returnValue As Boolean
returnValue = Kernel32.SetVolumeMountPoint(volumeMountPoint,
volumeName)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool SetVolumeMountPoint(
String^ volumeMountPoint,
String^ volumeName
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member SetVolumeMountPoint :
volumeMountPoint : string *
volumeName : string -> bool
No code example is currently available or this language may not be supported.
- volumeMountPoint String
-
The user-mode path to be associated with the volume.
This may be a drive letter (for example, "X:") or a directory on another volume (for example, "Y:\MountX").
The string must end with a trailing backslash ('').
If the volumeMountPoint parameter contains a path to a mounted folder,
last error returns ERROR_DIR_NOT_EMPTY, even if the directory is empty.
- volumeName String
-
A volume GUID path for the volume.
This string must be of the form "\?\Volume{GUID}" where GUID is a GUID that identifies the volume.
The "\?" turns off path parsing and is ignored as part of the path.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.