Tim, Thank you for response,
Maxim thak you for joining.
Ok. I would like to make everything clear.
- Driver I want to filter is WDM driver (no frameworks is used) - that has two defined: IOCTL_GET_MAGIC_NUMBER , IOCTL_SET_MAGIC_NUMBER - both uses method_buffered.
First returns value from registry, seconf sets value in registry (as I mentioned before - this is only my exercises - so there is not much sense probably).
2.Driver is installed via OpenSCManager and CreateService from user space application.
- Driver is creating device object via IoCreateDevice() called RegDev0
- Driver do not handle any PnP codes (only two irps I’ve defined plus mj_create)
- My role is to create filter driver to driver I described before so that it will be attaching to RegDev0 and logging every kind of registry get/set operations. Filter should be activated dynamically - I mean by first loading filter driver as service and then when ‘real’ driver is loaded (via user space application) filter should be activated.
- Filter driver should be only targeted to RegDev0 driver - so not class od devices.
According to yours suggestions I’ve prepared this kind of inf file, but I still don;t understand how it really works:
;-------------------------------------------------------------------------
; RegDev0.INF – driver filter
;
;-------------------------------------------------------------------------
[version]
Signature = “$Windows NT$”
Provider = %DDDD%
DriverVer = 13/07/2011,6.0.5019.0
[Manufacturer]
%DDDD%=MEWS,NTx86,NTia64,NTamd64
;-------------------------------------------------------------------------
; Installation Section
;-------------------------------------------------------------------------
[Install]
AddReg=Inst_Flt
Characteristics = 0x40000
Copyfiles = regdev0flt.copyfiles.sys
[SourceDisksNames]
1=%REGDEV0FLT_Desc%,“”,
[SourceDisksFiles]
RegDev0Flt.sys=1
[DestinationDirs]
DefaultDestDir=12
RegDev0Flt.copyfiles.sys=12
[regdev0flt.copyfiles.sys]
RegDev0Flt.sys,2
;-------------------------------------------------------------------------
; installation support
;-------------------------------------------------------------------------
[Inst_Flt]
HKR,“UpperFilters”,0x00010000,“regdev0flt” ; REG_MULTI_SZ value
;-------------------------------------------------------------------------
; Service installation support
;-------------------------------------------------------------------------
[Install.Services]
AddService=RegDev0Flt,RegDev0Flt_Service_Inst
[RegDev0Flt_Service_Inst]
DisplayName = %REGDEV0FLT_Desc%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 2 ;SERVICE_DEMAND
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\RegDev0.sys
Description = %REGDEV0FLT_Desc%
[Install.Remove.Services]
DelService=RegDev0Flt,0x200
[Strings]
DDDD = “jojo”
REGDEV0FLT_Desc = “sample filter driver”
REGDEV0FLT_HelpText = “sample filter driver”
-------------------------------------------eof--------------------------------------
First - this is probably not working - I just prepared in text editor to give you where I am now - probably it won’t even be properly parsed.
-
First of all I don’t catch where is information about which device my filter driver will be filtering?
I undestand that somewhere here should be string like REgDev0 or somthin’?
-
I’m not really sure if AddReg is properly constructed - maybe in subkey I should put string in registry to RegDev0 service?
Can you help be?
Thank you for your patience.