Why would the code bug check - 0x000000be

I have the following code in filter driver. Every time it loads, for an
operation it bug checks all the time at the same location. I can’t
understand why it thinks that a write is being attempted on “READ_ONLY”
buffer. Intersting thing is that FREE compilation of driver does not bug
check. Its only the checked version.
The call is being made at PASSIVE IRQL.

Thanks.

******************************************
UNICODE_STRING strNode = {0, 0, NULL};
UNICODE_STRING strRemainder = {0, 0, NULL};
UNICODE_STRING strLink = {0, 0, NULL};

FsRtlDissectName(*pstrUserPath, &strNode, &strRemainder);
RtlInitUnicodeString(&strLink, L"\??\C:");
strLink.Buffer[4] = strNode.Buffer[0]; ------------> Bug check
*********************************************

*** Fatal System Error: 0x000000be
(0xF5FB4978,0x0C4DC121,0xF6172858,0x0000000B)

Probably because the code is trying to modify the literal string
L"\??\C:". The compiler will create one copy of this string probably in
the .data section. And every time your code is executed, this one copy of
the string will be modified.

The different behavior between CHECKED and FREE may be due to the flags used
on the .data section. The CHECKED build environment may implement a strict
"Read Only" flag on the section where the FREE environment may flag it "Read
Write".

Directly modifying initialized data is usually inadvertent behavior of the
code.

-----Original Message-----
From: Kohli, Naveen [mailto:xxxxx@CriticalSites.com]
Sent: Wednesday, August 27, 2003 10:53 AM
To: File Systems Developers
Subject: [ntfsd] Why would the code bug check - 0x000000be

I have the following code in filter driver. Every time it loads, for an
operation it bug checks all the time at the same location. I can't
understand why it thinks that a write is being attempted on "READ_ONLY"
buffer. Intersting thing is that FREE compilation of driver does not bug
check. Its only the checked version.
The call is being made at PASSIVE IRQL.
Thanks.
******************************************
UNICODE_STRING strNode = {0, 0, NULL};
UNICODE_STRING strRemainder = {0, 0, NULL};
UNICODE_STRING strLink = {0, 0, NULL};
FsRtlDissectName(*pstrUserPath, &strNode, &strRemainder);
RtlInitUnicodeString(&strLink, L"\??\C:");
strLink.Buffer[4] = strNode.Buffer[0]; ------------> Bug check
*********************************************
*** Fatal System Error: 0x000000be
(0xF5FB4978,0x0C4DC121,0xF6172858,0x0000000B)

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