How to resolve the build problem in minifilter?

my code is as following:

/***********************************************************************************************/
// Com.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#include <fltuser.h>
#define COMM_PORT_NAME L"\CommPort <file:></file:>“;
typedef enum _READ_DIR_COMMAND {
FStart
} READ_DIR_COMMAND;
struct READ_DIR_MESSAGE {
READ_DIR_COMMAND Command;
};

int main(int argc, char* argv)
{
HRESULT hResult = S_OK;
HANDLE port = INVALID_HANDLE_VALUE;
DWORD bytesReturned = 0;
READ_DIR_MESSAGE command;
command.Command = FStart;

hResult = FilterConnectCommunicationPort(L”\CommPort <file:></file:>",
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 0;
}

/ *********************************************************************************************** /

In above program, i want to send a message to driver, but when I build the
entire solution in VC6, I get the
following build error for several of the projects:

--------------------Configuration: Com - Win32 Debug--------------------
Compiling…
Com.cpp
c:\winddk\6000\inc\ddk\fltuserstructures.h(22) : fatal error C1012:
unmatched parenthesis : missing ‘)’
of course, when i build it with wdk, it’s ok. But in my client program,
there are some code can’t be builded with WDK, so i want to build them in
VC6, but get above build problem, how can i do?</fltuser.h>

Ok - VC6 is very old for user mode. You should be using 2005 or 2008
releases of VS. That said what I’ve done for my user mode apps is to wrap
the fltuser stuff in a library I build with the WDK and then call the
library from my visual studio apps. The benefit in this approach is that I
only have to deal with the include file from my library and I do not
consequently have to disentangle the include file mess between WDK and SDK
and VS include files.

I’m sure that you can probably manage to contain the incompatabilities some
other way, that was just the path of least resistance for me.

On Jan 13, 2008 9:58 PM, $BJvU-(B wrote:

> my code is as following:
>
>
> //
> // Com.cpp : Defines the entry point for the console application.
> //
> #include “stdafx.h”
> #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;
> };
>
> int main(int argc, char* argv[])
> {
> 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 0;
> }
>
>
> /
/
>
> In above program, i want to send a message to driver, but when I build the
> entire solution in VC6, I get the
> following build error for several of the projects:
>
> --------------------Configuration: Com - Win32 Debug--------------------
> Compiling…
> Com.cpp
> c:\winddk\6000\inc\ddk\fltuserstructures.h(22) : fatal error C1012:
> unmatched parenthesis : missing ‘)’
> of course, when i build it with wdk, it’s ok. But in my client program,
> there are some code can’t be builded with WDK, so i want to build them in
> VC6, but get above build problem, how can i do?
> — NTFSD is sponsored by OSR For our schedule debugging and file system
> seminars (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars You are currently subscribed to ntfsd as:
> xxxxx@hollistech.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com


Mark Roddy</fltuser.h>

You can build minifilters from your preferred environment by slightly modifying fltuser.h. Constants such as NTDDI_VER are likely not to be defined, you just need to remove a couple of IFDEFs and that’s it. I heard it is not recommended to not built with the WDK but there is really very little required to get the filter manager API going from any language or usermode development environment.

/Daniel

“峰姚” wrote in message news:xxxxx@ntfsd…
my code is as following:

//
// Com.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#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;
};

int main(int argc, char* argv[])
{
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 0;
}

/
/

In above program, i want to send a message to driver, but when I build the entire solution in VC6, I get the
following build error for several of the projects:

--------------------Configuration: Com - Win32 Debug--------------------
Compiling…
Com.cpp
c:\winddk\6000\inc\ddk\fltuserstructures.h(22) : fatal error C1012: unmatched parenthesis : missing ‘)’

of course, when i build it with wdk, it’s ok. But in my client program, there are some code can’t be builded with WDK, so i want to build them in VC6, but get above build problem, how can i do?</fltuser.h>

I would have to agree that you shouldn’t do this… build what you need with the wdk - Mark’s method is the best.

When I forced this threw, there was more than just modifying a few defines, I ended up having to change my build
enviroment - specifically regarding my header and lib search paths. VS looks at the highest level path first for an
include or header, so i had to raise the WDK paths above the default ones… (it’s what those up/down arrows are for)

I ended up with a ‘frankin build’ setup - it wasn’t friendly to work with at all. Getting it to build with VC6 was rather
time consuming and wasn’t worth the effort.

Regards,
Matt
----- Original Message -----
From: xxxxx@resplendence.com
Newsgroups: ntfsd
To: Windows File Systems Devs Interest List
Sent: Monday, January 14, 2008 4:58 AM
Subject: Re:[ntfsd] How to resolve the build problem in minifilter?

You can build minifilters from your preferred environment by slightly modifying fltuser.h. Constants such as NTDDI_VER are likely not to be defined, you just need to remove a couple of IFDEFs and that’s it. I heard it is not recommended to not built with the WDK but there is really very little required to get the filter manager API going from any language or usermode development environment.

/Daniel

“峰姚” wrote in message news:xxxxx@ntfsd…
my code is as following:

//
// Com.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#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;
};

int main(int argc, char* argv[])
{
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 0;
}

/
/

In above program, i want to send a message to driver, but when I build the entire solution in VC6, I get the
following build error for several of the projects:

--------------------Configuration: Com - Win32 Debug--------------------
Compiling…
Com.cpp
c:\winddk\6000\inc\ddk\fltuserstructures.h(22) : fatal error C1012: unmatched parenthesis : missing ‘)’

of course, when i build it with wdk, it’s ok. But in my client program, there are some code can’t be builded with WDK, so i want to build them in VC6, but get above build problem, how can i do?


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</fltuser.h>

To prevent confusion it is better extract fltuser.h and fltuserstructures.h from there to another name and location and include that in your project instead so you can ignore the WDK altogether. Deleting a few lines is all there is to it. I have always been using the filter manager API from Delphi so I can’t see why one shouldn’t use VC.

/Daniel

“Matthew Martin” wrote in message news:xxxxx@ntfsd…
I would have to agree that you shouldn’t do this… build what you need with the wdk - Mark’s method is the best.

When I forced this threw, there was more than just modifying a few defines, I ended up having to change my build
enviroment - specifically regarding my header and lib search paths. VS looks at the highest level path first for an
include or header, so i had to raise the WDK paths above the default ones… (it’s what those up/down arrows are for)

I ended up with a ‘frankin build’ setup - it wasn’t friendly to work with at all. Getting it to build with VC6 was rather
time consuming and wasn’t worth the effort.

Regards,
Matt
----- Original Message -----
From: xxxxx@resplendence.com
Newsgroups: ntfsd
To: Windows File Systems Devs Interest List
Sent: Monday, January 14, 2008 4:58 AM
Subject: Re:[ntfsd] How to resolve the build problem in minifilter?

You can build minifilters from your preferred environment by slightly modifying fltuser.h. Constants such as NTDDI_VER are likely not to be defined, you just need to remove a couple of IFDEFs and that’s it. I heard it is not recommended to not built with the WDK but there is really very little required to get the filter manager API going from any language or usermode development environment.

/Daniel

“峰姚” wrote in message news:xxxxx@ntfsd…
my code is as following:

//
// Com.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#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;
};

int main(int argc, char* argv[])
{
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 0;
}

/
/

In above program, i want to send a message to driver, but when I build the entire solution in VC6, I get the
following build error for several of the projects:

--------------------Configuration: Com - Win32 Debug--------------------
Compiling…
Com.cpp
c:\winddk\6000\inc\ddk\fltuserstructures.h(22) : fatal error C1012: unmatched parenthesis : missing ‘)’

of course, when i build it with wdk, it’s ok. But in my client program, there are some code can’t be builded with WDK, so i want to build them in VC6, but get above build problem, how can i do?


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</fltuser.h>

I would agree in part here. I also ported the headers to delphi - and that was pretty easy. The only reason I wasn’t happy with that is the lack of an UInt64 in Delphi… That
has always pissed me off… Int64 does work, but just not happy with it… Perpahs there is a better way; I only use Delphi for service apps anyways (I love the tool, just only
have a intermediate knowledge with it).

Regarding VS, in paticular VC6 - it was indeed more trouble than what it was worth. Moving the headers to an alternate dir was a waste of time… There was just one problem
after another… Have a whack at it with VS and you’ll probably have the urge to break something… :slight_smile:

Kinda sad that using a non-microsoft tool with a non-microsoft language was 10x easier. I just downloaded VS '08 the other day, still no fltmgr support? WTF? The way I see it,
all usermode api should be easy to access from VS, especially in new versions… I don’t see a single excuse as to why this isn’t there.

This irritates me SOOOO much. Microsoft can take the time to create a CLR for all their .net crap, but they can’t unify headers and libs between the SDK, DDK, and VS. It’s
not f’ckin rocket science.

Regards,

Matt
----- Original Message -----
From: xxxxx@resplendence.com
Newsgroups: ntfsd
To: Windows File Systems Devs Interest List
Sent: Monday, January 14, 2008 5:21 AM
Subject: Re:[ntfsd] Re:How to resolve the build problem in minifilter?

To prevent confusion it is better extract fltuser.h and fltuserstructures.h from there to another name and location and include that in your project instead so you can ignore the WDK altogether. Deleting a few lines is all there is to it. I have always been using the filter manager API from Delphi so I can’t see why one shouldn’t use VC.

/Daniel

“Matthew Martin” wrote in message news:xxxxx@ntfsd…
I would have to agree that you shouldn’t do this… build what you need with the wdk - Mark’s method is the best.

When I forced this threw, there was more than just modifying a few defines, I ended up having to change my build
enviroment - specifically regarding my header and lib search paths. VS looks at the highest level path first for an
include or header, so i had to raise the WDK paths above the default ones… (it’s what those up/down arrows are for)

I ended up with a ‘frankin build’ setup - it wasn’t friendly to work with at all. Getting it to build with VC6 was rather
time consuming and wasn’t worth the effort.

Regards,
Matt
----- Original Message -----
From: xxxxx@resplendence.com
Newsgroups: ntfsd
To: Windows File Systems Devs Interest List
Sent: Monday, January 14, 2008 4:58 AM
Subject: Re:[ntfsd] How to resolve the build problem in minifilter?

You can build minifilters from your preferred environment by slightly modifying fltuser.h. Constants such as NTDDI_VER are likely not to be defined, you just need to remove a couple of IFDEFs and that’s it. I heard it is not recommended to not built with the WDK but there is really very little required to get the filter manager API going from any language or usermode development environment.

/Daniel

“峰姚” wrote in message news:xxxxx@ntfsd…
my code is as following:

//
// Com.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#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;
};

int main(int argc, char* argv[])
{
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 0;
}

/
/

In above program, i want to send a message to driver, but when I build the entire solution in VC6, I get the
following build error for several of the projects:

--------------------Configuration: Com - Win32 Debug--------------------
Compiling…
Com.cpp
c:\winddk\6000\inc\ddk\fltuserstructures.h(22) : fatal error C1012: unmatched parenthesis : missing ‘)’

of course, when i build it with wdk, it’s ok. But in my client program, there are some code can’t be builded with WDK, so i want to build them in VC6, but get above build problem, how can i do?


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</fltuser.h>

http://bbs.driverdevelop.com/htm_data/39/0801/108655.html

thanks for the link, but I’m having trouble understanding what it say’s.

I think I played with one to many lead riddin’ toys as a kid…

Matt

----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Monday, January 14, 2008 5:46 AM
Subject: RE:[ntfsd] How to resolve the build problem in minifilter?

> http://bbs.driverdevelop.com/htm_data/39/0801/108655.html
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: matt-martin@tx.rr.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

>Kinda sad that using a non-microsoft tool with a non-microsoft language was
10x

MSVC6 is 10 years old. Nothing surprising it cannot compile the user-mode
FlrMgr headers.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Point taken, however I had the same experience with VS’05… I’m also
looking at the
headers and libs in VS’08 right now and still no fltmgr support. This is
ridiculous.

If management there doesn’t like CVS, perhaps someone should remind them
they
sell a product called Team Suite. I can not understand why there are so many
different
‘current’ versions of headers and libs.

Matt

----- Original Message -----
From: “Maxim S. Shatskih”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, January 14, 2008 11:22 AM
Subject: Re:[ntfsd] Re:Re:How to resolve the build problem in minifilter?

> >Kinda sad that using a non-microsoft tool with a non-microsoft language
> >was
> 10x
>
> MSVC6 is 10 years old. Nothing surprising it cannot compile the user-mode
> FlrMgr headers.
>
> –
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: matt-martin@tx.rr.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

As the VS distribution is only a partial SDK, and the DDK contains
components not found in the SDK, there are three overlapping and frequently
different distributions of user mode apis involved here. That is two too
many for me. Which is why I long ago decided to always use a WDK dll as a
barrier between VS apps and WDK interfaces. It is painfully stupid to wrap
an api in an api, but not nearly as painfull as trying to coordinate three
independently changing platform library and header distributions of the
Windows user apis.

On Jan 15, 2008 3:36 AM, Matthew Martin wrote:

> Point taken, however I had the same experience with VS’05… I’m also
> looking at the
> headers and libs in VS’08 right now and still no fltmgr support. This is
> ridiculous.
>
> If management there doesn’t like CVS, perhaps someone should remind them
> they
> sell a product called Team Suite. I can not understand why there are so
> many
> different
> ‘current’ versions of headers and libs.
>
> Matt
>
> ----- Original Message -----
> From: “Maxim S. Shatskih”
> Newsgroups: ntfsd
> To: “Windows File Systems Devs Interest List”
> Sent: Monday, January 14, 2008 11:22 AM
> Subject: Re:[ntfsd] Re:Re:How to resolve the build problem in minifilter?
>
>
> > >Kinda sad that using a non-microsoft tool with a non-microsoft language
> > >was
> > 10x
> >
> > MSVC6 is 10 years old. Nothing surprising it cannot compile the
> user-mode
> > FlrMgr headers.
> >
> > –
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> > —
> > NTFSD is sponsored by OSR
> >
> > For our schedule debugging and file system seminars
> > (including our new fs mini-filter seminar) visit:
> > http://www.osr.com/seminars
> >
> > You are currently subscribed to ntfsd as: matt-martin@tx.rr.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: xxxxx@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Mark Roddy

thanks

now i want to build my client program with wdk, my code is as following:

//CommClient.h

/**************************************************************************************/
extern “C” {
bool __declspec(dllexport) SendReadMessage(void);
};
/**************************************************************************************/

//CommClient.cpp

/**************************************************************************************/
#include “Stdafx.h”
#include “CommClient.h”
#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;
};

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;
};
/**************************************************************************************/

sources file
/**************************************************************************************/
TARGETNAME=CommClient
TARGETTYPE=DYNLINK
UMTYPE=nt

C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE

LINKLIBS=$(SDK_LIB_PATH)\shell32.lib

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

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

SOURCES=StdAfx.cpp \
CommClient.cpp

!if “$(DDK_TARGET_OS)”==“WinLH”
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
!endif

/***************************************************************************************/

But i can’t build them successfully, i think there exists problem in my
sources file, but i don’t know why? can you tell me??

my code is as following:

CommClient.cpp
/***********************************************************************/
#include “CommClient.h”
#include <windows.h>
#include <fltuser.h>
#include <stdio.h>

#define COMM_PORT_NAME L"\CommPort"

typedef enum _READ_DIR_COMMAND {
FStart
} READ_DIR_COMMAND;

struct READ_DIR_MESSAGE {
READ_DIR_COMMAND Command;
};

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.h
/****************************************************************************/

extern “C” {
bool __declspec(dllexport) SendReadMessage(void);
};

Sources
/*****************************************************************************/
TARGETNAME=CommClient

TARGETPATH=obj

TARGETTYPE=DYNLINK

UMTYPE=windows

USE_MSVCRT=1

#TARGETLIBS=$(TARGETLIBS) <br># $(IFSKIT_LIB_PATH)\fltLib.lib

TARGETLIBS=$(TARGETLIBS) <br> $(IFSKIT_LIB_PATH)\fltLib.lib <br> $(SDK_LIB_PATH)\kernel32.lib <br> $(SDK_LIB_PATH)\advapi32.lib

INCLUDES=$(INCLUDES); <br> $(IFSKIT_INC_PATH); <br> $(DDK_INC_PATH); <br> …\inc

DEFFILE=CommClient.def

SOURCES = CommClient.cpp

The build result is as following:
D:\incubator\CommClient>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 10:14:57 2008
BUILD: Examining d:\incubator\commclient directory for files to compile.
d:\incubator\commclient - 1 source files (41 lines)
BUILD: Saving c:\winddk\6000\build.dat…
BUILD: Compiling d:\incubator\commclient directory
_NT_TARGET_VERSION SET TO WINXP
Compiling - commclient.cpp
errors in directory d:\incubator\commclient
d:\incubator\commclient\commclient.cpp(24) : error C3861:
‘FilterConnectCommunic
ationPort’: identifier not found
d:\incubator\commclient\commclient.cpp(36) : error C3861:
‘FilterSendMessage’: i
dentifier not found
Building Library - objchk_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\commclient directory
BUILD: Finish time: Wed Jan 16 10:14:58 2008
BUILD: Done

3 files compiled - 2 Errors
1 library built - 1 Error

D:\incubator\CommClient>

The declare of FilterSendMessage and FilterConnectCommunic is in FltUser.h.
error C3861: ‘FilterConnectCommunicationPort’: identifier not found
error C3861: ‘FilterSendMessage’: identifier not found

why??</stdio.h></fltuser.h></windows.h>