INtime SDK Help
GetCurrentRtThreadDirectory
INtime SDK v7 > About INtime > INtime Kernel > Files > GetCurrentRtThreadDirectory

Retrieves the current directory for the current thread.

DWORD GetCurrentRtThreadDirectory(
    DWORD dwBufSize,
    LPSTR lpBuffer
);

Parameters

dwBufSize
The size of buffer for the current directory string in characters. The buffer length must include space of a terminating null character.
lpBuffer
A buffer where the path of the current buffer is to be received. The null-terminated string specifies the absolute path to the current directory. To determine the required buffer size, set this parameter to NULL and the dwBufferLength parameter to 0.

Remarks

Each thread has a single current directory. To set the current directory, use the SetCurrentRtThreadDirectory function. If SetCurrentRtThreadDirectory is never called then GetCurrentRtThreadDirectory returns the process current directory.

Return values

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. To get extended error information, call GetLastRtError.

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. The contents of the supplied buffer will be the empty string ("").

Specifying NULL for the buffer pointer and 0 for the buffer size causes the call to return a value indicating the size of the buffer required to store the current directory.

Requirements

Versions Defined in Include Link to
INtime 6.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also

C library