Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

added FltRegisterFilter to the WDK kbdFilter example..get linker e

276 views
Skip to first unread message

unclepauly

unread,
May 12, 2010, 9:46:01 AM5/12/10
to
hello,

i have built and have successfuly installed and used the sample mini filter
keyboard driver from the WDK samples.

i have modified the DriverEntry function to call FltRegisterFilter....and i
get a linker error....'unresolved external symbol _FltRegisterFilter@12'.

i am sure this function lives in fltMgr.lib, and i have used dumpbin.exe on
this lib file and i have seen FltRegisterFilter in there.

so, i have tried two things, both of which have had no effect:

1) in the SOURCES file (which is called from the MAKEFILE) i have added the
line:

LIBRARIES=C:\WinDDK\6777\lib\wlh\i386\fltMgr.lib

2) added a pragma in the c file:

#pragma comment(lib, "C:\\WinDDK\\6777\\lib\\wlh\\i386\\fltMgr.lib")

as you can see i have put the full path to the lib just to make sure.

i am using the following command line to build the driver:

build -cewgZ

i have tried with the checked and free build environments.
i am on vista home premium 32 bit.

can anyone please explain what i am doing wrong...if i have not given enough
info let me know...
thanks in advance.

Scott Noone

unread,
May 12, 2010, 10:46:48 AM5/12/10
to
Keyboard filter drivers and file system minifilters are entirely different
beasts. What are you trying to do?

-scott

--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com


"unclepauly" <uncle...@discussions.microsoft.com> wrote in message
news:22BD9D99-53C0-45EE...@microsoft.com...

unclepauly

unread,
May 12, 2010, 11:06:05 AM5/12/10
to
hi and thanks for replying ! well i am (trying to) write a mini keyboard
filter driver. i have no experience doing this, i started it all yesterday.
anyway like i say i have got the WDK mini keyboard filter driver example up
and running, ive got it logging to debugview just fine. what i need to do is
really simple, just disable/enable the keyboard. i am disabling it by
consuming all the packets in the KbFilter_ServiceCallback, where i just do a
test for some global flag...ie

if(g_DISABLE)
//drop all the packets
else
//just send the IRP up the stack

so now the question is, how do i set the driver's global flag from a normal
user/gui application ? so this is where i am at now, and the way i am going
about it is by using the Fltxxxxx functions that i found on msdn :
http://msdn.microsoft.com/en-us/library/ff539277(VS.85).aspx

then when i added these functions to the kbfiltr sample, i got the linker
error as i said my orignial post. but i have solved that now though ! in the
makefile i had "LIBRARIES=...." and it should have been "TARGETLIBS=....". so
its built now. so it looks like #pragma comment(lib, "lib.lib") doesn't work
for drivers ? anyway...

but now that ive got your attention :o) if you read the above and think my
approach is wrong please let me know..
thank you.

Scott Noone

unread,
May 12, 2010, 1:33:29 PM5/12/10
to
The Flt API are for file system minifilters, so unless you're writing a
Filter Manager minifilter that filters file system activity then you need to
stay away from them.

The kbfiltr sample in the latest WDK shows how to communicate with the
filter driver from a user mode application.

-scott

--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

"unclepauly" <uncle...@discussions.microsoft.com> wrote in message

news:C2C34593-F70D-44CD...@microsoft.com...

Maxim S. Shatskih

unread,
May 12, 2010, 1:41:30 PM5/12/10
to
> The Flt API are for file system minifilters, so unless you're writing a
> Filter Manager minifilter that filters file system activity then you need to
> stay away from them.

Nevertheless, tcpip.sys in Vista+ uses fltmgr!FltGetFileNameInformationUnsafe

--
Maxim S. Shatskih
Windows DDK MVP
ma...@storagecraft.com
http://www.storagecraft.com

Doron Holan [MSFT]

unread,
May 12, 2010, 5:18:14 PM5/12/10
to
use the KMDF versoin of this sample which enumerates a raw PDO. that raw PDO
can talk to the app

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"unclepauly" <uncle...@discussions.microsoft.com> wrote in message

news:C2C34593-F70D-44CD...@microsoft.com...

unclepauly

unread,
May 13, 2010, 12:04:01 PM5/13/10
to
thanks folks, i downloaded the latest wdk and got it working with the new
kbfiltr sample....
0 new messages