INtime SDK Help
GetCurrentRtDirectory
INtime SDK v6 > About INtime > INtime Kernel > Files > GetCurrentRtDirectory

Retrieves the current directory for the current process.

DWORD GetCurrentRtDirectory(
    DWORD dwBufSize,
    LPSTR lpBuffer
);

Parameters

dwBufSize
The size in characters of the Buffer parameter.
lpBuffer
A buffer where the path of the current buffer is to be received.

Remarks

Each process has a single current directory. To set the current directory, use the SetCurrentRtDirectory function.

Multithreaded applications and shared library code should use the GetCurrentRtDirectory function with care. The current directory state written by the SetCurrentRtDirectory function is stored as a global variable in each process, therefore multithreaded applications cannot reliably use this value without possible data corruption from other threads that may also be reading or setting this value. This limitation also applies to the SetCurrentRtDirectory and GetFullRtPathName functions. The exception being when the application is guaranteed to be running in a single thread, for example parsing file names from the command line argument string in the main thread prior to creating any additional threads. Using relative path names in multithreaded applications or shared library code can yield unpredictable results and is not supported.

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.

Requirements

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

System & Status

C library