GetDriveType
The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.
UINT GetDriveType(
LPCTSTR lpRootPathName // pointer to root path
);
Parameters
lpRootPathName
Pointer to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory.
Return Values
The return value specifies the type of drive. It can be one of the following values:
Value Meaning
DRIVE_UNKNOWN The drive type cannot be determined.
DRIVE_NO_ROOT_DIR The root directory does not exist.
DRIVE_REMOVABLE The disk can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk.
Turbo Link Version 1.6.71.0 Copyright (c) 1993,1996 Borland International
Error: Unresolved external 'GetDriveType' referenced from module SearchDisk.asm
SearchDisk.obj
SearchDisk.map
SearchDisk.exe
Assembly OK .
请问该如何引用这个API,用相同的方法为何就是这个不能用呢?,它同样也在KENELL32.DLL中?????
for (j=0;j<i;j+=4)
{
cdbuf=&buf[j];
switch( GetDriveType( cdbuf) )
{
case DRIVE_UNKNOWN: printf("%s is 未知驱动器\n",cdbuf);break;
case DRIVE_NO_ROOT_DIR: printf("%s is 路径无效\n",cdbuf);break;
case DRIVE_REMOVABLE: printf("%s is 可移动媒体\n",cdbuf);break;
case DRIVE_FIXED: printf("%s is 硬盘\n",cdbuf);break;
case DRIVE_REMOTE: printf("%s is 网络驱动器\n",cdbuf);break;
case DRIVE_CDROM: printf("%s is CD-ROM\n",cdbuf);break;
case DRIVE_RAMDISK: printf("%s is RAM 驱动器\n",cdbuf);break;
default: break;
}
}