String comparison

Hi,

Again a question on strings.
I want to compare 2 strings (char * and not PSTRING).

But I am facing following problems:

  1. memicmp and stricmp are not suggested to be used in drivers.
  2. The function RtlCompareString works on PSTRING.

I didn’t find any other function to do this task. Do I have to write my own
function ?
Or, is there any other method ?

TIA
Abhijit

RtlCompareMemory

Regards,
Gregory

-----Original Message-----
From: Abhijit [mailto:xxxxx@yahoo.com]
Sent: Wednesday, March 31, 2004 13:57
To: Windows System Software Devs Interest List
Subject: [ntdev] String comparison

Hi,

Again a question on strings.
I want to compare 2 strings (char * and not PSTRING).

But I am facing following problems:

  1. memicmp and stricmp are not suggested to be used in drivers.
  2. The function RtlCompareString works on PSTRING.

I didn’t find any other function to do this task. Do I have to write my own
function ?
Or, is there any other method ?

TIA
Abhijit


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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

*** IMPORTANT: Do not open attachments from unrecognized senders ***

******************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or the
sender immediately and do not disclose the contents to any one or make copies.

******************************************************************************************

************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************

If you already know their lengths you could build STRING structures for
each and call RtlCompareString.

Alternately you could use the safe string functions (Windows
DDK\Kernel-Mode Driver Architecture\Reference\Driver Support
Routines\Safe String Functions in the ddk documentation)

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abhijit
Sent: Wednesday, March 31, 2004 3:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] String comparison

Hi,

Again a question on strings.
I want to compare 2 strings (char * and not PSTRING).

But I am facing following problems:

  1. memicmp and stricmp are not suggested to be used in drivers.
  2. The function RtlCompareString works on PSTRING.

I didn’t find any other function to do this task. Do I have to write my
own function ?
Or, is there any other method ?

TIA
Abhijit


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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