ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

string.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS NDIS library
00004  * FILE:        ndis/string.c
00005  * PURPOSE:     String management routines
00006  * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
00007  *              Vizzini (vizzini@plasmic.com)
00008  * REVISIONS:
00009  *   CSH 01/08-2000 Created
00010  *   Vizzini 08-Oct-2003  Error checking, documentation, and formatting
00011  */
00012 
00013 #include "ndissys.h"
00014 
00015 
00016 /*
00017  * @implemented
00018  */
00019 #undef NdisAnsiStringToUnicodeString
00020 NDIS_STATUS
00021 EXPORT
00022 NdisAnsiStringToUnicodeString(
00023     IN OUT  PNDIS_STRING   DestinationString,
00024     IN      PANSI_STRING   SourceString)
00025 /*
00026  * FUNCTION: Converts an ANSI string to an NDIS (unicode) string
00027  * ARGUMENTS:
00028  *     DestinationString = Address of buffer to place converted string in
00029  *     SourceString      = Pointer to ANSI string to be converted
00030  * NOTES:
00031  *     - caller must be running at IRQL = PASSIVE_LEVEL
00032  */
00033 {
00034   PAGED_CODE();
00035   ASSERT(DestinationString);
00036   ASSERT(SourceString);
00037 
00038   return (NDIS_STATUS)RtlAnsiStringToUnicodeString(
00039       (PUNICODE_STRING)DestinationString,
00040       (PANSI_STRING)SourceString, FALSE);
00041 }
00042 
00043 
00044 
00045 /*
00046  * @implemented
00047  */
00048 #undef NdisEqualString
00049 BOOLEAN
00050 EXPORT
00051 NdisEqualString(
00052     IN  PNDIS_STRING    String1,
00053     IN  PNDIS_STRING    String2,
00054     IN  BOOLEAN         CaseInsensitive)
00055 /*
00056  * FUNCTION: Tests two strings for equality
00057  * ARGUMENTS:
00058  *     String1         = Pointer to first string
00059  *     String2         = Pointer to second string
00060  *     CaseInsensitive = TRUE if the compare should be case insensitive
00061  * NOTES:
00062  *     - caller must be at IRQL = PASSIVE_LEVEL
00063  */
00064 {
00065   PAGED_CODE();
00066   ASSERT(String1);
00067   ASSERT(String2);
00068 
00069   return RtlEqualUnicodeString((PUNICODE_STRING)String1,
00070       (PUNICODE_STRING)String2,
00071       CaseInsensitive);
00072 }
00073 
00074 
00075 /*
00076  * @implemented
00077  */
00078 #undef NdisInitAnsiString
00079 VOID
00080 EXPORT
00081 NdisInitAnsiString(
00082     IN OUT  PANSI_STRING   DestinationString,
00083     IN      PCSTR          SourceString)
00084 /*
00085  * FUNCTION: Initializes an ANSI string
00086  * ARGUMENTS:
00087  *     DestinationString = Address of buffer to place string in
00088  *     SourceString      = Pointer to null terminated ANSI string
00089  * NOTES:
00090  *     - Caller must be at IRQL <= DISPATCH_LEVEL
00091  */
00092 {
00093   ASSERT(DestinationString);
00094   ASSERT(SourceString);
00095 
00096   RtlInitString((PANSI_STRING)DestinationString, (PCSZ)SourceString);
00097 }
00098 
00099 
00100 /*
00101  * @implemented
00102  */
00103 VOID
00104 EXPORT
00105 NdisInitializeString(
00106     IN OUT  PNDIS_STRING    DestinationString,
00107     IN      PUCHAR          SourceString)
00108 /*
00109  * FUNCTION: Initializes an NDIS (unicode) string
00110  * ARGUMENTS:
00111  *     DestinationString = Address of buffer to place string in
00112  *     SourceString      = Pointer to null terminated ANSI string
00113  * NOTES:
00114  *     - Must be called at IRQL = PASSIVE_LEVEL
00115  */
00116 {
00117   ANSI_STRING AnsiString;
00118 
00119   PAGED_CODE();
00120   ASSERT(DestinationString);
00121   ASSERT(SourceString);
00122 
00123   RtlInitAnsiString(&AnsiString, (PCSZ)SourceString);
00124 
00125   RtlAnsiStringToUnicodeString((PUNICODE_STRING)DestinationString, &AnsiString, TRUE);
00126 }
00127 
00128 
00129 /*
00130  * @implemented
00131  */
00132 #undef NdisInitUnicodeString
00133 VOID
00134 EXPORT
00135 NdisInitUnicodeString(
00136     IN OUT  PNDIS_STRING    DestinationString,
00137     IN      PCWSTR          SourceString)
00138 /*
00139  * FUNCTION: Initializes an unicode string
00140  * ARGUMENTS:
00141  *     DestinationString = Address of buffer to place string in
00142  *     SourceString      = Pointer to null terminated unicode string
00143  * NOTES:
00144  *     - call with IRQL <= DISPATCH_LEVEL
00145  */
00146 {
00147   ASSERT(DestinationString);
00148   ASSERT(SourceString);
00149 
00150   RtlInitUnicodeString((PUNICODE_STRING)DestinationString, SourceString);
00151 }
00152 
00153 
00154 /*
00155  * @implemented
00156  */
00157 #undef NdisUnicodeStringToAnsiString
00158 NDIS_STATUS
00159 EXPORT
00160 NdisUnicodeStringToAnsiString(
00161     IN OUT  PANSI_STRING   DestinationString,
00162     IN      PNDIS_STRING   SourceString)
00163 /*
00164  * FUNCTION: Converts an NDIS (unicode) string to an ANSI string
00165  * ARGUMENTS:
00166  *     DestinationString = Address of buffer to place converted string in
00167  *     SourceString      = Pointer to unicode string to be converted
00168  * NOTES:
00169  *     - must be called at IRQL = PASSIVE_LEVEL
00170  */
00171 {
00172   PAGED_CODE();
00173   ASSERT(DestinationString);
00174   ASSERT(SourceString);
00175 
00176   return (NDIS_STATUS)RtlUnicodeStringToAnsiString(
00177       (PANSI_STRING)DestinationString,
00178       (PUNICODE_STRING)SourceString,
00179       FALSE);
00180 }
00181 
00182 
00183 /*
00184  * @implemented
00185  */
00186 #undef NdisUpcaseUnicodeString
00187 NTSTATUS
00188 EXPORT
00189 NdisUpcaseUnicodeString(
00190     OUT PUNICODE_STRING DestinationString,
00191     IN  PUNICODE_STRING SourceString)
00192 /*
00193  * FUNCTION: Uppercase a UNICODE string
00194  * ARGUMENTS:
00195  *     DestinationString: caller-allocated space for the uppercased string
00196  *     SourceString: string to be uppercased
00197  * NOTES:
00198  *     - Currently requires caller to allocate destination string - XXX is this right?
00199  *     - callers must be running at IRQL = PASSIVE_LEVEL
00200  */
00201 {
00202   PAGED_CODE();
00203   ASSERT(SourceString);
00204   ASSERT(DestinationString);
00205 
00206   return RtlUpcaseUnicodeString (DestinationString, SourceString, FALSE );
00207 }
00208 
00209 /* EOF */
00210 

Generated on Sat May 26 2012 04:16:32 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.