Kernel32DefineDosDevice Method

Defines, redefines, or deletes MS-DOS device names.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: 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.Unicode, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool DefineDosDevice(
	DefineDosDeviceFlags flags,
	string deviceName,
	string targetPath
)

Parameters

flags  DefineDosDeviceFlags
The controllable aspects of the DefineDosDevice(DefineDosDeviceFlags, String, String) function.
deviceName  String
A pointer to an MS-DOS device name string specifying the device the function is defining, redefining, or deleting.

The device name string must not have a colon as the last character, unless a drive letter is being defined, redefined, or deleted.

For example, drive 'C' would be the string "C:". In no case is a trailing backslash ("\") allowed.

targetPath  String
A pointer to a path string that will implement this device.

The string is an MS-DOS path string unless the RawTargetPath flag is specified, in which case this string is a path string.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also