Re: how can i handle string operation in kernel mini driver?

It would be a simple matter to build a standard C library that’s kernel-side
safe. Standard code should always be preferred over proprietary interfaces !

But in this case, I would write my own routine. Faster, safer, and keeps to
a minimum the number of strings attached to a project.

Alberto.

-----Original Message-----
From: Christiaan Ghijselinck
[mailto:xxxxx@CompaqNet.be]
Sent: Tuesday, July 15, 2003 5:28 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

Normally, these libraries are used to build property sheets/installers etc…
not drivers. Use them at your own risk and test
carefully and instensively ! I don’t know what *4.lib and 4d.lib should be
( P4 variant ? ). The *d.lib 's are debug versions.
Thus, to avoid problems, use msvcrt.lib only, and be careful …

----- Original Message -----
From: “Kevin Liang”
To: “Windows System Software Developers Interest List”
Sent: Tuesday, July 15, 2003 10:19 AM
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

>
> i am using XP DDK 2600, i add ntdll.lib and sscanf() can be found.
>
> then i add msvcrt.lib, and strtok() can be found too.
>
> another question is: i found several lib file can be used to cover
strtok()
> problem, such as msvcrt4d.lib, msvcrt4.lib, msvcrtd.lib, which is most
> suitable? now, i choose the smallest one, msvcrt.lib.
>
> Best Regards
>
> Kevin Liang
>
>
>
>
>
> “Christiaan Ghijselinck” To: "Windows
System Software Developers
> <christiaan.ghijselinck interest list>
> mpaqNet.be> cc:
> Sent by: Subject: [ntdev]
Re: how can i handle string
> xxxxx@lists.os operation in
kernel mini driver?
> r.com
>
>
> 2003-07-15 15:27
> Please respond to “Windows
> System Software Developers
> Interest List”
>
>
>
>
>
>
> What is the DDK version are you using ?
>
> It should work with XP DDK and Server 2003 DDK. Use ntdll.lib instead of
> libcntpr.lib ( sorry, my fault ) and be sure you included
> stdio.h
>
>
> ----- Original Message -----
> From: “Kevin Liang”
> To: “Windows System Software Developers Interest List”
>
> Sent: Tuesday, July 15, 2003 8:44 AM
> Subject: [ntdev] Re: how can i handle string operation in kernel mini
> driver?
>
>
> >
> > thanks for your help.
> >
> > however, after i add following line to my sources file, the ‘unresolved
> > symbol’ error still occured for the two functions.
> >
> > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\libcntpr.lib
> >
> > Best Regards
> >
> > Kevin Liang
> >
> >
> >
> >
> >
> >
> > “Christiaan Ghijselinck” To:
> "Windows System Software Developers
> > <christiaan.ghijselinck interest list>>
> > mpaqNet.be> cc:
> > Sent by: Subject:
[ntdev]
> Re: how can i handle string
> > xxxxx@lists.os operation in
> kernel mini driver?
> > r.com
> >
> >
> > 2003-07-14 17:52
> > Please respond to “Windows
> > System Software Developers
> > Interest List”
> >
> >
> >
> >
> >
> > Correction :
> >
> > use libcntpr.lib instead of ntddl.lib :slight_smile: , thus :
> >
> > > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\libcntpr.lib
> >
> >
> > ----- Original Message -----
> > From: “Christiaan Ghijselinck”
> > To: “Windows System Software Developers Interest List”
> >
> > Sent: Monday, July 14, 2003 11:30 AM
> > Subject: [ntdev] Re: how can i handle string operation in kernel mini
> > driver?
> >
> >
> > >
> > > 1. include : stdio.h
> > > 2. add following line to your “sources” file :
> > >
> > > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\ntdll.lib
> > >
> > > success !
> > >
> > > ----- Original Message -----
> > > From: “Kevin Liang”
> > > To: “Windows System Software Developers Interest List”
> >
> > > Sent: Monday, July 14, 2003 9:48 AM
> > > Subject: [ntdev] how can i handle string operation in kernel mini
> driver?
> > >
> > >
> > > > i want to do some string operation in my mini driver, using sscanf()
> > and
> > > > strtok(). but build result indicate that resolved external symbol.
> > > >
> > > > can i do this? if yes, how to do?
> > > >
> > > > any comment is appreciated.
> > > >
> > > > thanks in advance.
> > > >
> > > > Best Regards
> > > >
> > > > Kevin Liang
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as:
> > xxxxx@compaqnet.be
> > > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as:
> > xxxxx@compaqnet.be
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@accton.com.cn
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as:
> xxxxx@compaqnet.be
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@accton.com.cn
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as:
xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


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

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.</christiaan.ghijselinck></christiaan.ghijselinck>

Actually you should never include msvc* whatever in a driver.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Christiaan Ghijselinck [mailto:xxxxx@CompaqNet.be]
Sent: Tuesday, July 15, 2003 5:28 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

Normally, these libraries are used to build property sheets/installers etc…
not drivers. Use them at your own risk and test carefully and instensively !
I don’t know what *4.lib and 4d.lib should be ( P4 variant ? ). The *d.lib
's are debug versions. Thus, to avoid problems, use msvcrt.lib only, and be
careful …

----- Original Message -----
From: “Kevin Liang”
To: “Windows System Software Developers Interest List”
Sent: Tuesday, July 15, 2003 10:19 AM
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

>
> i am using XP DDK 2600, i add ntdll.lib and sscanf() can be found.
>
> then i add msvcrt.lib, and strtok() can be found too.
>
> another question is: i found several lib file can be used to cover
> strtok() problem, such as msvcrt4d.lib, msvcrt4.lib, msvcrtd.lib,
> which is most suitable? now, i choose the smallest one, msvcrt.lib.
>
> Best Regards
>
> Kevin Liang
>
>
>
>
>
> “Christiaan Ghijselinck” To: "Windows
System Software Developers
> <christiaan.ghijselinck interest list>
> mpaqNet.be> cc:
> Sent by: Subject: [ntdev]
Re: how can i handle string
> xxxxx@lists.os operation in
kernel mini driver?
> r.com
>
>
> 2003-07-15 15:27
> Please respond to “Windows
> System Software Developers
> Interest List”
>
>
>
>
>
>
> What is the DDK version are you using ?
>
> It should work with XP DDK and Server 2003 DDK. Use ntdll.lib instead
> of libcntpr.lib ( sorry, my fault ) and be sure you included stdio.h
>
>
> ----- Original Message -----
> From: “Kevin Liang”
> To: “Windows System Software Developers Interest List”
>
> Sent: Tuesday, July 15, 2003 8:44 AM
> Subject: [ntdev] Re: how can i handle string operation in kernel mini
> driver?
>
>
> >
> > thanks for your help.
> >
> > however, after i add following line to my sources file, the
> > ‘unresolved symbol’ error still occured for the two functions.
> >
> > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\libcntpr.lib
> >
> > Best Regards
> >
> > Kevin Liang
> >
> >
> >
> >
> >
> >
> > “Christiaan Ghijselinck” To:
> "Windows System Software Developers
> > <christiaan.ghijselinck interest list>>
> > mpaqNet.be> cc:
> > Sent by: Subject:
[ntdev]
> Re: how can i handle string
> > xxxxx@lists.os operation in
> kernel mini driver?
> > r.com
> >
> >
> > 2003-07-14 17:52
> > Please respond to “Windows
> > System Software Developers
> > Interest List”
> >
> >
> >
> >
> >
> > Correction :
> >
> > use libcntpr.lib instead of ntddl.lib :slight_smile: , thus :
> >
> > > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\libcntpr.lib
> >
> >
> > ----- Original Message -----
> > From: “Christiaan Ghijselinck”
> > To: “Windows System Software Developers Interest List”
> >
> > Sent: Monday, July 14, 2003 11:30 AM
> > Subject: [ntdev] Re: how can i handle string operation in kernel
> > mini driver?
> >
> >
> > >
> > > 1. include : stdio.h
> > > 2. add following line to your “sources” file :
> > >
> > > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\ntdll.lib
> > >
> > > success !
> > >
> > > ----- Original Message -----
> > > From: “Kevin Liang”
> > > To: “Windows System Software Developers Interest List”
> >
> > > Sent: Monday, July 14, 2003 9:48 AM
> > > Subject: [ntdev] how can i handle string operation in kernel mini
> driver?
> > >
> > >
> > > > i want to do some string operation in my mini driver, using
> > > > sscanf()
> > and
> > > > strtok(). but build result indicate that resolved external
> > > > symbol.
> > > >
> > > > can i do this? if yes, how to do?
> > > >
> > > > any comment is appreciated.
> > > >
> > > > thanks in advance.
> > > >
> > > > Best Regards
> > > >
> > > > Kevin Liang
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as:
> > xxxxx@compaqnet.be
> > > > To unsubscribe send a blank email to
> > > > xxxxx@lists.osr.com
> > > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as:
> > xxxxx@compaqnet.be
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@accton.com.cn
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as:
> xxxxx@compaqnet.be
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@accton.com.cn To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com</christiaan.ghijselinck></christiaan.ghijselinck>

You should use only documented ways until you really know what you’re doing.
All libraries you tried are for user mode only, none is suitable for kernel
mode. Do you expect your driver should load and call user mode DLL?

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@accton.com.cn[SMTP:xxxxx@accton.com.cn]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, July 15, 2003 10:19 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

i am using XP DDK 2600, i add ntdll.lib and sscanf() can be found.

then i add msvcrt.lib, and strtok() can be found too.

another question is: i found several lib file can be used to cover
strtok()
problem, such as msvcrt4d.lib, msvcrt4.lib, msvcrtd.lib, which is most
suitable? now, i choose the smallest one, msvcrt.lib.

Best Regards

Kevin Liang

“Christiaan Ghijselinck” To: "Windows
System Software Developers
<christiaan.ghijselinck interest list>>
> mpaqNet.be> cc:
>
> Sent by: Subject: [ntdev]
> Re: how can i handle string
> xxxxx@lists.os operation in
> kernel mini driver?
> r.com
>
>
>
>
>
> 2003-07-15 15:27
>
> Please respond to “Windows
>
> System Software Developers
>
> Interest List”
>
>
>
>
>
>
>
>
>
> What is the DDK version are you using ?
>
> It should work with XP DDK and Server 2003 DDK. Use ntdll.lib instead of
> libcntpr.lib ( sorry, my fault ) and be sure you included
> stdio.h
>
>
> ----- Original Message -----
> From: “Kevin Liang”
> To: “Windows System Software Developers Interest List”
>
> Sent: Tuesday, July 15, 2003 8:44 AM
> Subject: [ntdev] Re: how can i handle string operation in kernel mini
> driver?
>
>
> >
> > thanks for your help.
> >
> > however, after i add following line to my sources file, the ‘unresolved
> > symbol’ error still occured for the two functions.
> >
> > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\libcntpr.lib
> >
> > Best Regards
> >
> > Kevin Liang
> >
> >
> >
> >
> >
> >
> > “Christiaan Ghijselinck” To:
> "Windows System Software Developers
> > <christiaan.ghijselinck interest list>>
> > mpaqNet.be> cc:
> > Sent by: Subject:
> [ntdev]
> Re: how can i handle string
> > xxxxx@lists.os operation in
> kernel mini driver?
> > r.com
> >
> >
> > 2003-07-14 17:52
> > Please respond to “Windows
> > System Software Developers
> > Interest List”
> >
> >
> >
> >
> >
> > Correction :
> >
> > use libcntpr.lib instead of ntddl.lib :slight_smile: , thus :
> >
> > > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\libcntpr.lib
> >
> >
> > ----- Original Message -----
> > From: “Christiaan Ghijselinck”
> > To: “Windows System Software Developers Interest List”
> >
> > Sent: Monday, July 14, 2003 11:30 AM
> > Subject: [ntdev] Re: how can i handle string operation in kernel mini
> > driver?
> >
> >
> > >
> > > 1. include : stdio.h
> > > 2. add following line to your “sources” file :
> > >
> > > TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\ntdll.lib
> > >
> > > success !
> > >
> > > ----- Original Message -----
> > > From: “Kevin Liang”
> > > To: “Windows System Software Developers Interest List”
> >
> > > Sent: Monday, July 14, 2003 9:48 AM
> > > Subject: [ntdev] how can i handle string operation in kernel mini
> driver?
> > >
> > >
> > > > i want to do some string operation in my mini driver, using sscanf()
> > and
> > > > strtok(). but build result indicate that resolved external symbol.
> > > >
> > > > can i do this? if yes, how to do?
> > > >
> > > > any comment is appreciated.
> > > >
> > > > thanks in advance.
> > > >
> > > > Best Regards
> > > >
> > > > Kevin Liang
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as:
> > xxxxx@compaqnet.be
> > > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as:
> > xxxxx@compaqnet.be
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@accton.com.cn
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as:
> xxxxx@compaqnet.be
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@accton.com.cn
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: michal.vodicka@st.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
></christiaan.ghijselinck></christiaan.ghijselinck>

You must admit that in can be pretty hard for us to reproduce a problem that
occurs when you try to package symbols with source code, if either symbols,
source code, or both, is not available. But I’ll prod our support people,
when did you interact with them, and which DriverStudio release was that ?

Alberto.

-----Original Message-----
From: Nick Ryan [mailto:xxxxx@nryan.com]
Sent: Wednesday, July 16, 2003 4:39 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

Haven’t tried DS 3.0 much yet, but SoftIce crashing when translating and
then quickly loading symbols has been a bug for 3-4 years that’s never
been resolved. Last time I remember interacting with support on it they
wanted us to send them our source code. :confused:

Michal Vodicka wrote:

>----------
>From:
>xxxxx@compuware.com[SMTP:xxxxx@compuware.com]
>Reply To: xxxxx@lists.osr.com
>Sent: Wednesday, July 16, 2003 4:47 PM
>To: xxxxx@lists.osr.com
>Subject: [ntdev] Re: how can i handle string operation in kernel mini
>driver?
>
>Somehow I don’t think this is the right way of doing business. A device
>driver, by its very position in the hierarchy, should not have to worry
>about bad input, small stacks, or anything of that sort. After all, that’s
>why it’s trusted code, no ?
>

Ouch. Now I understand why SI crashes when NMS from newer version is
loaded.
Sorry, I couldn’t resist because haven’t received satisfying reply from
support.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


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

  • Nick Ryan (MVP for DDK)

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

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

What’s wrong with sending them all your source? :slight_smile:

-----Original Message-----
From: Nick Ryan [mailto:xxxxx@nryan.com]
Sent: Wednesday, July 16, 2003 1:39 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

Haven’t tried DS 3.0 much yet, but SoftIce crashing when translating and
then quickly loading symbols has been a bug for 3-4 years that’s never
been resolved. Last time I remember interacting with support on it they
wanted us to send them our source code. :confused:

Michal Vodicka wrote:

>----------
>From:
>xxxxx@compuware.com[SMTP:xxxxx@compuware.com]
>Reply To: xxxxx@lists.osr.com
>Sent: Wednesday, July 16, 2003 4:47 PM
>To: xxxxx@lists.osr.com
>Subject: [ntdev] Re: how can i handle string operation in kernel mini
>driver?
>
>Somehow I don’t think this is the right way of doing business. A device
>driver, by its very position in the hierarchy, should not have to worry
>about bad input, small stacks, or anything of that sort. After all, that’s
>why it’s trusted code, no ?
>

Ouch. Now I understand why SI crashes when NMS from newer version is
loaded.
Sorry, I couldn’t resist because haven’t received satisfying reply from
support.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


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

  • Nick Ryan (MVP for DDK)

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

Nick,

I get the word from the SoftICE-guru-in-charge that this has been fixed in
DS 3.0. If you have access to DS 3.0, maybe you could try and see if your
problem is indeed fixed ? If not, drop me an email and we’ll take another
look.

Alberto.

-----Original Message-----
From: Nick Ryan [mailto:xxxxx@nryan.com]
Sent: Wednesday, July 16, 2003 5:31 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

It happened as recently as a few weeks ago to a coworker running 2.7. I
recall it being an event that would repro maybe 1 in 10 times if you
translated a large binary and then immediately loaded the resulting NMS
(i.e. two lines in a batch file). The support interaction was maybe a
year and a half ago.

Moreira, Alberto wrote:

You must admit that in can be pretty hard for us to reproduce a problem
that
occurs when you try to package symbols with source code, if either
symbols,
source code, or both, is not available. But I’ll prod our support people,
when did you interact with them, and which DriverStudio release was that ?

Alberto.

-----Original Message-----
From: Nick Ryan [mailto:xxxxx@nryan.com]
Sent: Wednesday, July 16, 2003 4:39 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: how can i handle string operation in kernel mini
driver?

Haven’t tried DS 3.0 much yet, but SoftIce crashing when translating and
then quickly loading symbols has been a bug for 3-4 years that’s never
been resolved. Last time I remember interacting with support on it they
wanted us to send them our source code. :confused:

Michal Vodicka wrote:

>>----------
>>From:
>>xxxxx@compuware.com[SMTP:xxxxx@compuware.com]
>>Reply To: xxxxx@lists.osr.com
>>Sent: Wednesday, July 16, 2003 4:47 PM
>>To: xxxxx@lists.osr.com
>>Subject: [ntdev] Re: how can i handle string operation in kernel mini
>>driver?
>>
>>Somehow I don’t think this is the right way of doing business. A device
>>driver, by its very position in the hierarchy, should not have to worry
>>about bad input, small stacks, or anything of that sort. After all,
that’s
>>why it’s trusted code, no ?
>>
>
>Ouch. Now I understand why SI crashes when NMS from newer version is

loaded.

>Sorry, I couldn’t resist because haven’t received satisfying reply from
>support.
>
>Best regards,
>
>Michal Vodicka
>STMicroelectronics Design and Application s.r.o.
>[michal.vodicka@st.com, http:://www.st.com]
>
>
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@nryan.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>

  • Nick Ryan (MVP for DDK)

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

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.