想写一个枚举硬盘分区的dll
来源:互联网 发布:linux登录界面循环 编辑:程序博客网 时间:2024/05/22 07:53
我想写一个枚举硬盘分区的dll,代码如下enumpartition.h
#ifndef _ENUMPARTITION_H_
#define _ENUMPARTITION_H_
#define DLLIMPORT __declspec (dllexport)
typedef struct _EtParition
{
CHAR *path;
} EtPartition;
EtPartition et_pis[20];
ULONG et_np=0;
DLLIMPORT ULONG et_init();
DLLIMPORT CHAR* et_path(ULONG i);
DLLIMPORT UCHAR et_type(ULONG i);
DLLIMPORT LONGLONG et_size(ULONG i);
#endif
enumpartition.c
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <windows.h>
#include <initguid.h> // Guid definition
#include <devguid.h> // Device guids
#include <setupapi.h> // for SetupDiXxx functions.
#include <cfgmgr32.h> // for SetupDiXxx functions.
#include <devioctl.h>
#include <ntdddisk.h>
#include <ntddscsi.h>
#include <enumpartition.h>
BOOL APIENTRY DllMain(HINSTANCE hInstance,
DWORD reason,
{
return TRUE;
}
BOOL GetDeviceProperty(HDEVINFO IntDevInfo, DWORD Index )
{
SP_DEVICE_INTERFACE_DATA interfaceData;
}
DLLIMPORT ULONG et_init()
{
HDEVINFO hDevInfo, hIntDevInfo;
}
DLLIMPORT CHAR* et_path(ULONG i)
{
if(i>=et_np)return NULL;
}
DLLIMPORT UCHAR et_type(ULONG i)
{
if(i>=et_np)return NULL;
}
DLLIMPORT LONGLONG et_size(ULONG i)
{
if(i>=et_np)return NULL;
}
sources
TARGETNAME=enumpartition
TARGETTYPE=DYNLINK
TARGETPATH=obj
TARGETLIBS=$(DDK_LIB_PATH)/setupapi.lib
INCLUDES=$(BASEDIR)/inc;
SOURCES=enumpartition.c
我在ddk的build环境下用build编译,却出现如下错误BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.BUILD: Object root set to: ==> objchk_wxp_x86BUILD: Compile and Link for i386BUILD: Loading C:/WINDDK/3790/build.dat...BUILD: Computing Include file dependencies:BUILD: Examining d:/enumpartition directory for files to compile. d:/enumpartition - 1 source files (166 lines)BUILD: Compiling d:/enumpartition directoryCompiling - enumpartition.c for i386NMAKE : U1073: don't know how to make 'enumpartition.def'BUILD: nmake.exe failed - rc = 2BUILD: Compile errors: not linking d:/enumpartition directoryBUILD: Done 2 files compiled - 2 Warnings - 1 Error - 166 LPS
- 想写一个枚举硬盘分区的dll
- 写Dll时遇到的一个错误
- WPF写的一个使用Log4net.dll库的demo
- C++ COM写一个DLL
- 自己写了一个操作端口的DLL文件
- DDK中生成一个DLL source文件写的例子
- C++如何写一个简单的DLL文件
- 打算写一个vbnet调用vc编译出的dll
- 枚举进程使用的DLL
- 关于一个枚举IE表单的DLL,编译无错,但是得不到想到的结果。
- 关于一个枚举IE表单的DLL,编译无错,但是得不到想到的结果。
- 给用C++写的dll写一个接口函数供C#使用
- CentOS添加一个新的硬盘分区到挂载的过程
- CentOS添加一个新的硬盘分区到挂载的过程
- CentOS添加一个新的硬盘分区到挂载的过程
- 自己写的一个杀system.dll和autorun的一个批处理
- 硬盘分区属性显示格式变成RAW格式的一个解决方法
- 一个枚举的例子
- ArcGIS Server9.3安装
- 我居然还没有写博客
- 在android平台上使用录音设备
- Intent的用法以及原理实现
- matlab与c(c++)混合编程
- 想写一个枚举硬盘分区的dll
- Basic principle of Unix like system
- Vmware workstation 中三种联网方式的区别分析
- 反省
- 按钮单击事件写法
- C++笔试题汇总(1)
- 只要上路,就会收获风景
- samba实例
- linux0.11分析之内存分配(结合uCos和VxWorks)