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

  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
>

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
>

Write a state-machine-based parser yourself :slight_smile:

----- Original Message -----
From: “Kevin Liang”
To: “Windows System Software Developers Interest List”

Sent: Monday, July 14, 2003 11: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@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com

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</christiaan.ghijselinck>

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
></christiaan.ghijselinck>

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</christiaan.ghijselinck></christiaan.ghijselinck>

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
></christiaan.ghijselinck></christiaan.ghijselinck>

“Christiaan Ghijselinck” wrote in
message news:xxxxx@ntdev…
>
> 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 …

Your cautions are very well advised. Some relief is available in that
several of the string functions, such as strlen(), are available as
intrinsics, which doesn’t require a lib at all.

The msvcN(d).lib are the various flavors of the CRT shipped with the
different MSVC versions over the years. msvcrt71 is the current one for
VS.NET 2003, I believe. The d indicates the debug version.

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.