Windows API 第16篇 GetLogicalDrivers 获取驱动器位掩码
函数原型:
DWORD GetLogicalDrives(VOID);
The GetLogicalDrives function retrieves a bitmask representing the
currently available disk drives.
说明:
该函数用法简单,没有参数,返回值为DWORD类型,返回的是当前驱动器的位掩码,0位代表A盘,1位代表B盘,以此类推,以我的笔记本为例:我的笔记本盘符有C , D , E , F, 还有一个DVD RW驱动器(H). 当执行下面的函数:
DWORD dwBitMask = GetLogicalDrivers();
dwBitMask为0xbc,
而0xbc换算成二进制为1011 1100, 从右向左恰好对应我的盘符.
Windows API 第16篇 GetLogicalDrivers 获取驱动器位掩码的更多相关文章
- Windows API 第15篇 GetVolumeInformation 获取磁盘卷(驱动器)信息
先看定义:BOOL GetVolumeInformation( [IN] LPCTSTR lpRootPathName, // root directory 卷所在的根目 ...
- Windows API 第17篇 GetLogicalDriveStrings 获取本机所有逻辑驱动器,以根目录的形式表示
函数原型:DWORD GetLogicalDriveStrings( DWORD nBufferLength, // size of buffer ...
- windows API 第22篇 WTSGetActiveConsoleSessionId
函数原型:DWORD WTSGetActiveConsoleSessionId (VOID)先看一下原文介绍: The WTSGetActiveConsoleSessionId function re ...
- Windows API 第六篇 GetLocalTime
GetLocalTime获取系统时间信息.函数原型:VOID WINAPI GetLocalTime( __out LPSYSTEMTIME lpSystemTime ); 先来看S ...
- Windows API 第三篇
1.获得程序自身的路径: DWORD GetModuleFileName( HMODULE hModule, // handle to module LPTSTR lpFilename, // pat ...
- Windows API 第20篇 GetVolumeNameForVolumeMountPoint
函数原型: BOOL GetVolumeNameForVolumeMountPoint( ...
- Windows API 第19篇 FindFirstVolumeMountPoint FindNextVolumeMountPoint
相关函数:HANDLE FindFirstVolumeMountPoint( ...
- windows API 第 18篇 FindFirstVolume FindNextVolume
函数定义:Retrieves the name of a volume on a computer. FindFirstVolume is used to begin scanning the vol ...
- windows API 第13篇 MoveFileEx
上一篇介绍了MoveFile,这次分析MoveFileEx,它是MoveFile的扩展函数,功能还要更加强大些.先看定义: BOOL WINAPI MoveFileEx( _In_ LPCTS ...
随机推荐
- MySql General error:2006
当启用模块时发生Mysql数据库错误,错误信息见附件,实际是“General error: 2006 MySQL server has gone away......”错误. 解决方法:找到my.in ...
- AtCoder Beginner Contest 132 E - Hopscotch Addict
bfs 位置+状态 just need to calculate min value(only it is useful), so O(1*x) 挺有趣的一道题... #include <cst ...
- Python 输入字符串找(String)下标 没有返回-1
str = "abcdefg123456"a = input("请输入一个字母或数字:")num = 0result = -1while num < le ...
- VC++中的CString、char、int类型转换
1.如何将CString类型的变量赋给char*类型的变量 方法一:GetBuffer函数 使用CString::GetBuffer函数. char *p; CString str=&quo ...
- js 中继承方式小谈
题外话 前段时间面试中笔试题有这道题目: 请实现一个继承链,要求如下: 构造函数A():构造函数中有consoleA方法,可以实现console.log("a") 实例对象 a:a ...
- How to Hide Apache Tomcat Version Number from Error Pages
1. 进入tomcat lib目录 cd /usr/local/tomcat7/lib 2. 解压catalina.jar jar xvf catalina.jar 3. 修改ServerInfo.p ...
- 集中式日志分析平台 - ELK Stack - 安全解决方案 X-Pack
大数据之心 关注 0.6 2017.02.22 15:36* 字数 2158 阅读 16457评论 7喜欢 9 简介 X-Pack 已经作为 Elastic 公司单独的产品线,前身是 Shield, ...
- 关于priority_queue和sort()对结构体数组的排序
知乎的这个答案很清晰https://www.zhihu.com/question/35736022 #include <iostream> #include <algorithm&g ...
- 基于Java Properties类设置本地配置文件
一.Java Properties类介绍 Java中有个比较重要的类Properties(Java.util.Properties),主要用于读取Java的配置文件,各种语言都有自己所支持的配置文件, ...
- https://webpack.js.org/plugins/
有问题还是看源码 ,看官方文档吧,整一晚上终于整明白了