Kernel32DefineDosDevice Method
Defines, redefines, or deletes MS-DOS device names.
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.Unicode, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool DefineDosDevice(
DefineDosDeviceFlags flags,
string deviceName,
string targetPath
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Unicode, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function DefineDosDevice (
flags As DefineDosDeviceFlags,
deviceName As String,
targetPath As String
) As Boolean
Dim flags As DefineDosDeviceFlags
Dim deviceName As String
Dim targetPath As String
Dim returnValue As Boolean
returnValue = Kernel32.DefineDosDevice(flags,
deviceName, targetPath)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Unicode, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool DefineDosDevice(
DefineDosDeviceFlags flags,
String^ deviceName,
String^ targetPath
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member DefineDosDevice :
flags : DefineDosDeviceFlags *
deviceName : string *
targetPath : string -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.