GetDriveTypeA Function
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdrivetypea
GetDriveTypeA function (fileapi.h)
Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.
docs.microsoft.com
가. 디스크 드라이브가 이동식, 고정식, CD-ROM, RAM 디스크 또는 네트워크 드라이브인지 결정한다.
나. 드라이브가 USB 유형 드라이브인지 확인하려면 SetupDiGetDeviceRegistryProperty를 호출하고 SPDRP_REMOVAL_POLICY 속성을 지정해라.
Syntax
UINT getDriveTypeA(
LPCSTR lpRootPathName
);
Parameters
1. lpRootPathName
1) 드라이브의 루트 디렉터리이다.
2) 후행 백슬래시가 필요하다. 이 매개변수가 NULL이면 함수는 현재 디렉토리의 루트를 사용한다.
Return Value
반환 값은 드라이브 유형을 지정하며, 이는 다음 값 중 하나가 될 수 있다.
Return code/value | Description |
0 / DRIVE_UNKNOWN | 드라이브 유형을 확인할 수 없음. |
1 / DRIVE_NO_ROOT_DIR | 루트 경로가 잘못됨. 예를 들어 지정된 경로에 마운트된 볼륨이 없음. |
2 / DRIVE_REMOVABLE | 이 드라이브에는 floppy 드라이브, thumb 드라이브 또는 flash car reader와 같은 removable media가 있다. |
3 / DRIVE_FIXED | 이 드라이브에는 하드 디스크 드라이브 또는 플래시 드라이브와 같은 fixed media가 있다. |
4 / DRIVE_REMOTE | 이 드라이브는 원격(네트워크) 드라이브다. |
5 / DRIVE_CDROM | 이 드라이브는 CD-ROM 드라이브 입니다. |
6 / DRIVE_RAMDISK | 이 드라이브는 RAM 디스크다. |
Remarks
윈도우즈 8 및 윈도우즈 서버 2012에서 이 기능은 다음 기술에 의해 지원된다.
Technology | Supported |
Server Message Block (SMB) 3.0 protocol | No |
SMB 3.0 Transparent Failover (TFO) | No |
SMB 3.0 with Scale-out File Shares (SO) | No |
Cluster Shared Volume File System (CsvFS) | Yes |
Resilient File System (ReFS) | Yes |
SMB는 볼륨 관리 기능을 지원하지 않는다.
Requirements
1. Minimum supported client
Windows XP [desktop apps | UWP apps]
2. Minimum supported server
Windows Server 2003 [desktop apps | UWP apps]
3. Target Platform
Windows
4. Header
fileapi.h (include Windows.h)
5. Library
Kernel32.lib
6. DLL
Kernel32.dll
'ETC > Windows API' 카테고리의 다른 글
DialogBoxParamA Function (0) | 2019.08.07 |
---|---|
GetDlgItemTextA Function (0) | 2019.07.17 |
LoadLibraryA Function (0) | 2019.05.05 |
WaitForSingleObject Function (1) | 2019.05.05 |
CreateRemoteThread Function (0) | 2019.05.04 |