Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging

The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.

Check out The OSR Learning Library at:

Fetching token handle in FastIoQueryOpen() occasionally crashes system.

OSR_Community_UserOSR_Community_User Member Posts: 110,217
I've been recently testing remote access to my filter driver and seem to
occasionally get crashes in FastIoQueryOpen() when fetching a token handle in
order to get the user's SID. The code snippet and SoftICE stack trace follow:

currentProcessId = PsGetCurrentProcessId();

if (currentProcessId != 0) // Check to for Idle process

if (subjectContext.ClientToken != NULL)
accessToken = subjectContext.ClientToken;

else if (subjectContext.PrimaryToken != NULL)
accessToken = subjectContext.PrimaryToken;

else // This should hopefully never be reached!
return NULL;

ntStatus = ObOpenObjectByPointer(accessToken, 0, NULL
, TOKEN_QUERY, NULL, KernelMode, &token);

SoftICE Stack trace (read downwards):

The crash is as a result of a PageFault in ExEnumHandleTable. The thread &
process are always SYSTEM, and I've verified that most of the time,
FastIoQueryOpen works without any problems. This is running under NT4.0
(SP6a). Fortunately I can remove the code from this FastIO call, but I'd like
to make sure that this issue will not be found in any other FastIO function.
Any help would be appreciated.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE