mini filter Exclusive rights during preCreate

Hi all.

I’m using the IFS sample, filtering the preCreate call back.

I want a specific file to be opened in exclusive rights - it should be opened one and all other create file should return some error code, to indicate it is exclusively opened.

I tried modifying the FLT_CALLBACK_DATA * (Data) parameter to my call back method in many ways, none of which lead to the desired outcome:

Data->Iopb->Parameters.Create.SecurityContext->DesiredAccess = FILE_WRITE_DATA;
Data->Iopb->Parameters.Create.Options =
(FILE_OPEN_IF << 24) |
FILE_COMPLETE_IF_OPLOCKED;
Data->Iopb->Parameters.Create.FileAttributes = FILE_ATTRIBUTE_NORMAL;
Data->Iopb->Parameters.Create.ShareAccess = 0;

Does anyone know how should something like the above be done?

Thanks,
Ariel.

oh, and I naturally call

FltSetCallbackDataDirty(Data);

at the end of the changes