Kernel32GetCurrentDirectory Method
Retrieves the current directory for the current process.
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 uint GetCurrentDirectory(
uint bufferLength,
StringBuilder buffer
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetCurrentDirectory (
bufferLength As UInteger,
buffer As StringBuilder
) As UInteger
Dim bufferLength As UInteger
Dim buffer As StringBuilder
Dim returnValue As UInteger
returnValue = Kernel32.GetCurrentDirectory(bufferLength,
buffer)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static unsigned int GetCurrentDirectory(
unsigned int bufferLength,
StringBuilder^ buffer
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetCurrentDirectory :
bufferLength : uint32 *
buffer : StringBuilder -> uint32
No code example is currently available or this language may not be supported.
- bufferLength UInt32
-
The length of the buffer for the current directory string, in TCHARs.
The buffer length must include room for a terminating null character.
- buffer StringBuilder
-
A pointer to the buffer that receives the current directory string.
This null-terminated string specifies the absolute path to the current directory.
To determine the required buffer size, set this parameter to NULL and the bufferLength parameter to 0.
UInt32
If the function succeeds, the return value specifies the number of characters that are written to the buffer,
not including the terminating null character.
If the function fails, the return value is zero.
If the buffer that is pointed to by lpBuffer is not large enough,
the return value specifies the required size of the buffer, in characters, including the null-terminating character.