想写一个枚举硬盘分区的dll

我想写一个枚举硬盘分区的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_x86
BUILD: Compile and Link for i386
BUILD: 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 directory
Compiling - enumpartition.c for i386
NMAKE :  U1073: don't know how to make 'enumpartition.def'
BUILD: nmake.exe failed - rc = 2
BUILD: Compile errors: not linking d:/enumpartition directory
BUILD: Done

    2 files compiled - 2 Warnings - 1 Error -   166 LPS





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值