failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an
instance context during the instance setup handler callback. The status
code is C01C0016 which means that (according to fltNtStatus.h) the mini
is not registered to handle the specified context. I have everything set
up for handling an instance context and can’t find any glaring problems.
Has anyone else seen this before?

Note, this is the first time this particular filter has been tested and
it’s always failed with this error so I’ve not been able to yet get an
instance context allocated. All the required setup routines completed
successfully before this and the last thing being done in DriverEntry is
to start filtering. When FltStartFiltering is called, I immediately
start getting the instance callbacks and that’s when this error occurs.
This mini is only attaching to local disk volumes.

My FLT_CONTEXT_REGISTRATION struct defines the type as
FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size,
and the tag. No allocation or free routines are specified.

Jerry

Jerry,
Are you sure the fourth parameter of your FLT_REGISTRATION struct is
actually pointing to the FLT_CONTEXT_REGISTRATION?
Ramon,
Panda Software

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kelley, Jerry
Sent: Monday, April 26, 2004 3:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an
instance context during the instance setup handler callback. The status
code is C01C0016 which means that (according to fltNtStatus.h) the mini
is not registered to handle the specified context. I have everything set
up for handling an instance context and can’t find any glaring problems.
Has anyone else seen this before?
Note, this is the first time this particular filter has been tested and
it’s always failed with this error so I’ve not been able to yet get an
instance context allocated. All the required setup routines completed
successfully before this and the last thing being done in DriverEntry is
to start filtering. When FltStartFiltering is called, I immediately
start getting the instance callbacks and that’s when this error occurs.
This mini is only attaching to local disk volumes.
My FLT_CONTEXT_REGISTRATION struct defines the type as
FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size,
and the tag. No allocation or free routines are specified.
Jerry—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to xxxxx@lists.osr.com

RE: [ntfsd] failure allocating instance contextYes, it is.
“Ramon Royo” wrote in message news:xxxxx@ntfsd…
Jerry,
Are you sure the fourth parameter of your FLT_REGISTRATION struct is actually pointing to the FLT_CONTEXT_REGISTRATION?
Ramon,
Panda Software

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Kelley, Jerry
Sent: Monday, April 26, 2004 3:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an instance context during the instance setup handler callback. The status code is C01C0016 which means that (according to fltNtStatus.h) the mini is not registered to handle the specified context. I have everything set up for handling an instance context and can’t find any glaring problems. Has anyone else seen this before?

Note, this is the first time this particular filter has been tested and it’s always failed with this error so I’ve not been able to yet get an instance context allocated. All the required setup routines completed successfully before this and the last thing being done in DriverEntry is to start filtering. When FltStartFiltering is called, I immediately start getting the instance callbacks and that’s when this error occurs. This mini is only attaching to local disk volumes.

My FLT_CONTEXT_REGISTRATION struct defines the type as FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size, and the tag. No allocation or free routines are specified.

Jerry—
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to xxxxx@lists.osr.com

Then I think the bug is located in FltAllocateContext call. Is the second parameter set to FLT_INSTANCE_CONTEXT?. It?s easy to set this parameter incorrectly with the type of our own instance context.

Ramon,
Panda Software


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jerry Kelley
Sent: Monday, April 26, 2004 5:04 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] failure allocating instance context

Yes, it is.

“Ramon Royo” wrote in message news:xxxxx@ntfsd…

Jerry,
Are you sure the fourth parameter of your FLT_REGISTRATION struct is actually pointing to the FLT_CONTEXT_REGISTRATION?
Ramon,
Panda Software

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com mailto:xxxxx] On Behalf Of Kelley, Jerry
Sent: Monday, April 26, 2004 3:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an instance context during the instance setup handler callback. The status code is C01C0016 which means that (according to fltNtStatus.h) the mini is not registered to handle the specified context. I have everything set up for handling an instance context and can’t find any glaring problems. Has anyone else seen this before?

Note, this is the first time this particular filter has been tested and it’s always failed with this error so I’ve not been able to yet get an instance context allocated. All the required setup routines completed successfully before this and the last thing being done in DriverEntry is to start filtering. When FltStartFiltering is called, I immediately start getting the instance callbacks and that’s when this error occurs. This mini is only attaching to local disk volumes.

My FLT_CONTEXT_REGISTRATION struct defines the type as FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size, and the tag. No allocation or free routines are specified.

Jerry—
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 https:

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to xxxxx@lists.osr.com</https:></mailto:xxxxx>

Is the size you pass into FltAllocateContext exactly the same size you
specified when registering your instance context in the
FLT_CONTEXT_REGISTRATION structure? If not, Filter Manager will fail
your allocation with this error. If you registered multiple instance
context definitions and want Filter Manager to find the “best fit”, you
need to specify the FLTFL_CONTEXT_REGISTRATION_NO_EXACT_SIZE_MATCH flag
in your context registration structures.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jerry Kelley
Sent: Monday, April 26, 2004 8:04 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] failure allocating instance context

Yes, it is.

“Ramon Royo” wrote in message
news:xxxxx@ntfsd…

Jerry,
Are you sure the fourth parameter of your FLT_REGISTRATION
struct is actually pointing to the FLT_CONTEXT_REGISTRATION?
Ramon,
Panda Software

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com
mailto:xxxxx] On Behalf Of Kelley, Jerry
Sent: Monday, April 26, 2004 3:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an
instance context during the instance setup handler callback. The status
code is C01C0016 which means that (according to fltNtStatus.h) the mini
is not registered to handle the specified context. I have everything set
up for handling an instance context and can’t find any glaring problems.
Has anyone else seen this before?

Note, this is the first time this particular filter has been
tested and it’s always failed with this error so I’ve not been able to
yet get an instance context allocated. All the required setup routines
completed successfully before this and the last thing being done in
DriverEntry is to start filtering. When FltStartFiltering is called, I
immediately start getting the instance callbacks and that’s when this
error occurs. This mini is only attaching to local disk volumes.

My FLT_CONTEXT_REGISTRATION struct defines the type as
FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size,
and the tag. No allocation or free routines are specified.

Jerry—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
https:

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com

To unsubscribe send a blank email to xxxxx@lists.osr.com</https:></mailto:xxxxx>

RE: [ntfsd] failure allocating instance contextYes, it’s the correct context type.
“Ramon Royo” wrote in message news:xxxxx@ntfsd…
Then I think the bug is located in FltAllocateContext call. Is the second parameter set to FLT_INSTANCE_CONTEXT?. It?s easy to set this parameter incorrectly with the type of our own instance context.

Ramon,
Panda Software

------------------------------------------------------------------------------
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jerry Kelley
Sent: Monday, April 26, 2004 5:04 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] failure allocating instance context

Yes, it is.
“Ramon Royo” wrote in message news:xxxxx@ntfsd…
Jerry,
Are you sure the fourth parameter of your FLT_REGISTRATION struct is actually pointing to the FLT_CONTEXT_REGISTRATION?
Ramon,
Panda Software

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Kelley, Jerry
Sent: Monday, April 26, 2004 3:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an instance context during the instance setup handler callback. The status code is C01C0016 which means that (according to fltNtStatus.h) the mini is not registered to handle the specified context. I have everything set up for handling an instance context and can’t find any glaring problems. Has anyone else seen this before?

Note, this is the first time this particular filter has been tested and it’s always failed with this error so I’ve not been able to yet get an instance context allocated. All the required setup routines completed successfully before this and the last thing being done in DriverEntry is to start filtering. When FltStartFiltering is called, I immediately start getting the instance callbacks and that’s when this error occurs. This mini is only attaching to local disk volumes.

My FLT_CONTEXT_REGISTRATION struct defines the type as FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size, and the tag. No allocation or free routines are specified.

Jerry—
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to xxxxx@lists.osr.com

No it’s not. That’s the problem then. It seems obvious now but that’s a
subtle one to watch out for.

The difference is that when I allocate the context I was rounding up the
structure size to a pointer integral for alignment purposes and in the
context registration structure I was just using the sizeof for the
structure. I’ve seen where the 64-bit platforms are very picky about
allocation sizes.

Thanks once again Molly.

jerry

“Molly Brown” wrote in message
news:xxxxx@ntfsd…
Is the size you pass into FltAllocateContext exactly the same size you
specified when registering your instance context in the
FLT_CONTEXT_REGISTRATION structure? If not, Filter Manager will fail
your allocation with this error. If you registered multiple instance
context definitions and want Filter Manager to find the “best fit”, you
need to specify the FLTFL_CONTEXT_REGISTRATION_NO_EXACT_SIZE_MATCH flag
in your context registration structures.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

________________________________

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jerry Kelley
Sent: Monday, April 26, 2004 8:04 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] failure allocating instance context

Yes, it is.

“Ramon Royo” wrote in message
news:xxxxx@ntfsd…

Jerry,
Are you sure the fourth parameter of your FLT_REGISTRATION
struct is actually pointing to the FLT_CONTEXT_REGISTRATION?
Ramon,
Panda Software

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com
mailto:xxxxx] On Behalf Of Kelley, Jerry
Sent: Monday, April 26, 2004 3:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] failure allocating instance context

I’ve got a minifilter that is consistently unable to allocate an
instance context during the instance setup handler callback. The status
code is C01C0016 which means that (according to fltNtStatus.h) the mini
is not registered to handle the specified context. I have everything set
up for handling an instance context and can’t find any glaring problems.
Has anyone else seen this before?

Note, this is the first time this particular filter has been
tested and it’s always failed with this error so I’ve not been able to
yet get an instance context allocated. All the required setup routines
completed successfully before this and the last thing being done in
DriverEntry is to start filtering. When FltStartFiltering is called, I
immediately start getting the instance callbacks and that’s when this
error occurs. This mini is only attaching to local disk volumes.

My FLT_CONTEXT_REGISTRATION struct defines the type as
FLT_INSTANCE_CONTEXT, no flags, the cleanup callback routine, the size,
and the tag. No allocation or free routines are specified.

Jerry—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
https:

You are currently subscribed to ntfsd as: xxxxx@pandasoftware.es
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com

To unsubscribe send a blank email to xxxxx@lists.osr.com</https:></mailto:xxxxx>