Hi,

I am writing a file system minifilter driver.
When I fail the create file operation from preoperation callback
routine, a windows error message pops up saying "file is not a valid
win32 application". and it restricts file from opening successfully.

But I want that no popup should be displayed on successfully blocking
a file. How can I hide this system popup?
Can anybody help me?

Thanks in advance.
- Vikas sangani

Re: How to hide system error messages. by dataman

dataman
Mon Aug 27 04:12:18 CDT 2007

On Aug 27, 9:29 am, Vicks <vikas.sang...@gmail.com> wrote:
> Hi,
>
> I am writing a file system minifilter driver.
> When I fail the create file operation from preoperation callback
> routine, a windows error message pops up saying "file is not a valid
> win32 application". and it restricts file from opening successfully.
>
> But I want that no popup should be displayed on successfully blocking
> a file. How can I hide this system popup?
> Can anybody help me?
>
> Thanks in advance.
> - Vikas sangani

Try:


{
DWORD oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);

<Your code>

SetErrorMode(oldErrorMode);
}


Re: How to hide system error messages. by Vicks

Vicks
Mon Aug 27 04:41:30 CDT 2007

Thanks dataman,
But this wont do because I havent wrote user mode code.
Its system code.
For example i wanted to block the notepad.exe file to open so I fail
its creation in minifilter driver.
That action displays system error message. I wanted to hide this error
message.

Reply me if you need more clarification.

- vikas sangani


Re: How to hide system error messages. by Maxim

Maxim
Mon Aug 27 08:10:19 CDT 2007

Choose another error code for failure, and note - even this will give you
no guarantees - it's the app's will on whether to show the popup or not, not
your driver's will.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Vicks" <vikas.sangani@gmail.com> wrote in message
news:1188199759.338769.181170@m37g2000prh.googlegroups.com...
> Hi,
>
> I am writing a file system minifilter driver.
> When I fail the create file operation from preoperation callback
> routine, a windows error message pops up saying "file is not a valid
> win32 application". and it restricts file from opening successfully.
>
> But I want that no popup should be displayed on successfully blocking
> a file. How can I hide this system popup?
> Can anybody help me?
>
> Thanks in advance.
> - Vikas sangani
>


Re: How to hide system error messages. by Tim

Tim
Wed Aug 29 01:01:44 CDT 2007

Vicks <vikas.sangani@gmail.com> wrote:
>
>But this wont do because I havent wrote user mode code.
>Its system code.
>For example i wanted to block the notepad.exe file to open so I fail
>its creation in minifilter driver.
>That action displays system error message. I wanted to hide this error
>message.

Why? This is strictly an application decision. If an application gets an
error while creating a file, then it clearly is not going to be able to
provide the services that the user expects, and it is entirely appropriate
for it to display an error message.

What do you expect notepad to do?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.