Hello,
I am trying to make my first file system filter, it will not do anything useful for now just output some information (eg. when a file\dir is created).
I did this:
FltRegisterFilter(pDriverObject, &MY_FilterRegistration, &gFilterPointer); FltStartFiltering(gFilterPointer);
CONST FLT_OPERATION_REGISTRATION MY_Callbacks = {
{IRP_MJ_CREATE, 0, NULL, PostCreate},
{IRP_MJ_OPERATION_END}
};
CONST FLT_REGISTRATION MY_FilterRegistration = {
sizeof( FLT_REGISTRATION ), // Size
FLT_REGISTRATION_VERSION, // Version
0,
NULL, // ContextRegistration
MY_Callbacks, // OperationRegistration
MY_Unload, // FilterUnloadCallback
MY_InstanceSetup, // InstanceSetupCallback
NULL, // InstanceQueryTeardownCallback
NULL, // InstanceTeardownStartCallback
MY_InstanceTeardownComplete, // InstanceTeardownCompleteCallback
NULL, // GenerateFileNameCallback
NULL, // NormalizeNameComponentCallback
NULL // NormalizeContextCleanupCallback
};
But none of the callbacks gets actually called. Well, MY_Unload does work. :\
I have zipped the source (3KB), in case anyone wants to take a peak, and put it here http://bit.ly/8Dz5a9 - it is a direct link.