4428|0

74

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

请教使用wdk编译MiniFilter驱动中通信用的客户端代码出错问题 [复制链接]

程序编译成动态链接库,编译出错,说是FilterSendMessage and FilterConnectCommunic找不到,可我已经包含了头文件FltUser.h,郁闷,请高手指点一下,代码如下:

CommClient.cpp
/**************************************************************/
#include
#include
#include "FltUser.h"

#define COMM_PORT_NAME  L"\\CommPort"

typedef enum _READ_DIR_COMMAND {
     FStart
} READ_DIR_COMMAND;

struct READ_DIR_MESSAGE {
     READ_DIR_COMMAND Command;
};

extern "C" _declspec(dllexport) bool SendReadMessage(void)
{
        HRESULT hResult = S_OK;
        HANDLE port = INVALID_HANDLE_VALUE;
        DWORD bytesReturned = 0;
        READ_DIR_MESSAGE command;

        command.Command = FStart;
        hResult = FilterConnectCommunicationPort(L"\\CommPort", 0,NULL,0,NULL,&port );

    if (IS_ERROR( hResult )) {

        printf( "Could not connect to filter: 0x%08x\n", hResult );
        return 0;
    }
        else
        {
                printf("connect ok \n");
        }

        /*hResult = FilterSendMessage( port, &command, sizeof(READ_DIR_COMMAND), 0, 0, &bytesReturned ); */

     
        return TRUE;
};

CommClient.def
/*********************************************************************/
LIBRARY CommClient

EXPORTS
    SendReadMessage

sources
/*********************************************************************/
TARGETNAME=CommClient
TARGETTYPE=DYNLINK
DLLENTRY=_DllMainCRTStartup
DLLDEF=CommClient.def
USE_MSVCRT=1


TARGETPATH=..\lib\$(BUILD_ALT_DIR)

TARGETLIBS=$(TARGETLIBS) \
           $(IFSKIT_LIB_PATH)\fltLib.lib \
           $(SDK_LIB_PATH)\kernel32.lib

C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE

INCLUDES=$(INCLUDES);         \
        $(IFSKIT_INC_PATH);  \
        $(DDK_INC_PATH);


SOURCES=CommClient.cpp

build时出错,说是找不到'FilterConnectCommunicationPort'和'FilterSendMessage',但我明明已经包含了#include "FltUser.h"头文件的,不知道是什么原因。请高手明示。谢谢

D:\incubator\user>build
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\6000\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Wed Jan 16 14:15:30 2008
BUILD: Examining d:\incubator\user directory for files to compile.
    d:\incubator\user - 1 source files (42 lines)
BUILD: Saving c:\winddk\6000\build.dat...
BUILD: Compiling d:\incubator\user directory
_NT_TARGET_VERSION SET TO WINXP
Compiling - commclient.cpp
errors in directory d:\incubator\user
d:\incubator\user\commclient.cpp(25) : error C3861: 'FilterConnectCommunicationP
ort': identifier not found
d:\incubator\user\commclient.cpp(37) : error C3861: 'FilterSendMessage': identif
ier not found
Building Library - d:\incubator\lib\chk_wxp_x86\i386\commclient.lib
link : error LNK1181: cannot open input file 'objchk_wxp_x86\i386\commclient.obj
'
BUILD: Compile errors: not linking d:\incubator\user directory
BUILD: Finish time: Wed Jan 16 14:15:31 2008
BUILD: Done
点赞 关注

回复
举报
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/8 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表