我怎么可以检索有关磁盘卷的信息? [英] How can I retrieve information about disk volumes?

查看:123
本文介绍了我怎么可以检索有关磁盘卷的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我四处寻找监控我的软件RAID在Windows 2003 Server的状态的工具,但找不到合适的东西(即不是的过大的或的不必要复杂)。所以我决定只是做我自己,没什么壮观困难。

I was looking around for a tool to monitor the status of my software raid under Windows 2003 Server, but couldn't find anything suitable (i.e. not grossly oversized or needlessly complicated). So I decided to just do it myself, it's nothing spectacularly difficult.

所以,我怎么可以检索编程卷的状态?因为我拨弄着Windows的API,我找不到任何东西马上使用谷歌蝙蝠它已经有一段时间。我知道我可以使用的diskpart / S 和解析它的输出,而是变得混乱很快(尽管它确实有一定的优势)。

So how can I retrieve the status of the volumes programmatically? It's been a while since I fiddled with the Windows API and I couldn't find anything right off the bat using Google. I know I can use diskpart /s and parse its output, but that gets messy fairly quickly (although it does have some advantages).

任何指针到正确的方向的高度赞赏:)

Any pointers into the right direction are highly appreciated :)

推荐答案

Win32 API可以是(显然只)的方式去这里,虚拟磁盘服务是神奇的字眼。

The Win32 API is the (apparently only) way to go here, Virtual Disk Service is the magic word.

这里是在C ++中一个很好的例子,将让你开始。不同的COM接口的数量是在第一次对我来说相当混乱,但的磁盘服务工程文章是的伟大的帮助越来越大的图片。

Here is a good example in C++ that will get you started. The number of different COM interfaces was pretty confusing for me at first, but the How Virtual Disk Service Works article was of great help getting the big picture.

这其实很容易。尽管从未做过任何严重的C ++编码和永远不必甚至在触及COM,我仍然能够获得基本的功能在几个小时的工作。

It's actually pretty easy. Despite never having done any serious C++ coding and never having even touched COM before, I was still able to get the basic functionality to work in a few hours.

这篇关于我怎么可以检索有关磁盘卷的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆