sprintf( str, "0x%X\n", someU32Address );
When I try this I get a Second Chance (Access Error), which I assume is
because I'm not calling sprintf from user space. Is there some method
for using a printf style string specification in NT kernel land?
TIA,
Bill Ryder
Bill Ryder wrote in message <35DB43BA...@bugs.cs.wcupa.edu>...
wsprintf()?
-zi
-Bill
Could it be because you're passing a function that expects a kernel-space
address a user-space one?
I think you need to map the memory pointed to by 'someU32Address' into
kernel-space and then pass the address of *that* to your kernel sprintf().
Otherwise, you're just passing it a bogus address.
Regards,
Matt Arnold
Professional Music Products
Mark of the Unicorn, Inc.
http://www.motu.com
Remove all the X's from Reply-To: to obtain my valid e-mail address.
---------
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
any and all unsolicited commercial e-mail sent to this address is
subject to a download and archival fee in the amount of $500 US.
E-mailing this address denotes acceptance of these terms.
>Jamey Kirby wrote:
>
>> Yes, sprintf()
>>
>> Bill Ryder wrote in message <35DB43BA...@bugs.cs.wcupa.edu>...
>> >Another kernel newbie question. Is there a kernel mode version of
>> >sprintf? I want to initialize a UCHAR str[100] using a format string,
>> >ie:
>> >
>> >sprintf( str, "0x%X\n", someU32Address );
>> >
>> >When I try this I get a Second Chance (Access Error), which I assume is
>> >because I'm not calling sprintf from user space. Is there some method
>> >for using a printf style string specification in NT kernel land?
[snip]
The problem is, the error I get when it fails is damn vague. It literally
says "Stopped at unexpected exception: code=80000003
address:81-something." Not "page fault" or "bad IRQL" or "bad pointer" or
anything that might give me a clue.
So my general question at this point is, is there any way to locally
allocate a small chunk of memory that I can allocate, access, and
deallocate regardless of IRQL? And, if anyone has comments specific to
what I descibe, please chime in, but I think its getting to the point where
someone who implimented the kernel itself might be the only one to know
what my problem is off the top of their head.
And BTW - I really appreciate all the replies up until this point but
nothing has worked. I verified things, tried alternate calls, etc. No
dice. Quite frustrating when everyone says there should be no problem
using sprintf in the kernel.
If I get no replies I'll know I'm boring eveyone w/ this discussion and
drop it.
Thanks again,
Bill
Bill Ryder wrote:
> Another kernel newbie question. Is there a kernel mode version of
> sprintf? I want to initialize a UCHAR str[100] using a format string,
> ie:
>
> sprintf( str, "0x%X\n", someU32Address );
>
> When I try this I get a Second Chance (Access Error), which I assume is
> because I'm not calling sprintf from user space. Is there some method
> for using a printf style string specification in NT kernel land?
>
> TIA,
> Bill Ryder
HTH
Bill Ryder (wry...@bugs.cs.wcupa.edu) wrote:
: Okay, let me ask you guys this: I think I have this narrowed down to being
:
:
:
--
--
/* Andrew */
WWW: http://www.halcyon.com/ast
Email: a...@halcyon.com