Share via


_getdcwd_nolock, _wgetdcwd_nolock

取得指定磁碟機上目前工作目錄的完整路徑。

重要

這個 API 不能用於在 Windows 執行階段中執行的應用程式。 如需詳細資訊,請參閱 CRT functions not supported in Universal Windows Platform apps (通用 Windows 平台應用程式中不支援的 CRT 函式)。

語法

char *_getdcwd_nolock(
   int drive,
   char *buffer,
   int maxlen
);
wchar_t *_wgetdcwd_nolock(
   int drive,
   wchar_t *buffer,
   int maxlen
);

參數

drive
磁碟機。

buffer
路徑的儲存位置。

maxlen
路徑的最大長度 (以字元為單位):_getdcwd_nolockchar,且_wgetdcwd_nolockwchar_t

傳回值

請參閱 _getdcwd_wgetdcwd

備註

_getdcwd_nolock_wgetdcwd_nolock 分別與 _getdcwd_wgetdcwd 相同,不同之處在于它們不會受到其他執行緒的干擾。 它們可能更快,因為它們不會產生鎖定其他執行緒的額外負荷。 這些函式只能用在安全執行緒內容 (例如單一執行緒應用程式) 或呼叫範圍已經處理執行緒隔離的地方。

泛型文字常式對應

Tchar.h 常式 _UNICODE_MBCS 未定義 _MBCS 定義 _UNICODE 定義
_tgetdcwd_nolock _getdcwd_nolock _getdcwd_nolock _wgetdcwd_nolock

需求

常式 必要的標頭
_getdcwd_nolock <direct.h>
_wgetdcwd_nolock <direct.h > 或 < wchar.h>

如需相容性詳細資訊,請參閱相容性

另請參閱

目錄控制項
_chdir, _wchdir
_getcwd, _wgetcwd
_getdrive
_mkdir, _wmkdir
_rmdir, _wrmdir