Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > added FltRegisterFilter to the WDK kbdFilter example..get linker e

Reply
Thread Tools Display Modes

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

 
 
unclepauly
Guest
Posts: n/a

 
      05-12-2010
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.
 
Reply With Quote
 
 
 
 
Scott Noone
Guest
Posts: n/a

 
      05-12-2010
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" <> wrote in message
news:22BD9D99-53C0-45EE-A642-...
> 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.


 
Reply With Quote
 
unclepauly
Guest
Posts: n/a

 
      05-12-2010
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/libr...77(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 ) if you read the above and think my
approach is wrong please let me know..
thank you.



"Scott Noone" wrote:

> 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
>

 
Reply With Quote
 
Scott Noone
Guest
Posts: n/a

 
      05-12-2010
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" <> wrote in message
news:C2C34593-F70D-44CD-A6DF-...
> 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/libr...77(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 ) if you read the above and think
> my
> approach is wrong please let me know..
> thank you.
>
>
>
> "Scott Noone" wrote:
>
>> 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
>>

 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      05-12-2010
> 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

http://www.storagecraft.com

 
Reply With Quote
 
Doron Holan [MSFT]
Guest
Posts: n/a

 
      05-12-2010
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" <> wrote in message
news:C2C34593-F70D-44CD-A6DF-...
> 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/libr...77(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 ) if you read the above and think
> my
> approach is wrong please let me know..
> thank you.
>
>
>
> "Scott Noone" wrote:
>
>> 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
>>

 
Reply With Quote
 
unclepauly
Guest
Posts: n/a

 
      05-13-2010
thanks folks, i downloaded the latest wdk and got it working with the new
kbfiltr sample....
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No network drive mapping after joining Active Directory ? Patrick Active Directory 29 05-05-2010 12:21 PM
WMP- Removing songs from 'Recently Added' playlist? nowhereman42 Windows Media Player 2 04-05-2010 02:16 AM
2nd Domain in a 2 domain forest cannot be contacted David Alge DNS Server 30 01-21-2010 05:26 AM
Error code 0x80071A30 Anjomaba Windows Update 8 11-13-2009 10:59 PM
Windows Media Player (11) is not installed properly. Reinstall... Godenjoyer Windows Media Player 19 10-28-2009 10:50 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59