Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

stringsp.c File Reference

#include "nt.h"
#include "ntrtl.h"

Go to the source code of this file.

Functions

VOID RtlInitAnsiString (OUT PANSI_STRING DestinationString, IN PSZ SourceString OPTIONAL)
VOID RtlInitUnicodeString (OUT PUNICODE_STRING DestinationString, IN PWSTR SourceString OPTIONAL)


Function Documentation

VOID RtlInitAnsiString OUT PANSI_STRING  DestinationString,
IN PSZ SourceString  OPTIONAL
 

Definition at line 27 of file stringsp.c.

References SHORT, SourceString, and USHORT.

00034 : 00035 00036 The RtlInitAnsiString function initializes an NT counted string. 00037 The DestinationString is initialized to point to the SourceString 00038 and the Length and MaximumLength fields of DestinationString are 00039 initialized to the length of the SourceString, which is zero if 00040 SourceString is not specified. 00041 00042 Arguments: 00043 00044 DestinationString - Pointer to the counted string to initialize 00045 00046 SourceString - Optional pointer to a null terminated string that 00047 the counted string is to point to. 00048 00049 00050 Return Value: 00051 00052 None. 00053 00054 --*/ 00055 00056 { 00057 USHORT Length; 00058 Length = 0; 00059 DestinationString->Length = 0; 00060 DestinationString->Buffer = SourceString; 00061 if (ARGUMENT_PRESENT( SourceString )) { 00062 while (*SourceString++) { 00063 Length++; 00064 } 00065 00066 DestinationString->Length = Length; 00067 00068 DestinationString->MaximumLength = (SHORT)(Length+1); 00069 } 00070 else { 00071 DestinationString->MaximumLength = 0; 00072 } 00073 }

VOID RtlInitUnicodeString OUT PUNICODE_STRING  DestinationString,
IN PWSTR SourceString  OPTIONAL
 

Definition at line 77 of file stringsp.c.

References SourceString, and USHORT.

00084 : 00085 00086 The RtlInitUnicodeString function initializes an NT counted 00087 unicode string. The DestinationString is initialized to point to 00088 the SourceString and the Length and MaximumLength fields of 00089 DestinationString are initialized to the length of the SourceString, 00090 which is zero if SourceString is not specified. 00091 00092 Arguments: 00093 00094 DestinationString - Pointer to the counted string to initialize 00095 00096 SourceString - Optional pointer to a null terminated unicode string that 00097 the counted string is to point to. 00098 00099 00100 Return Value: 00101 00102 None. 00103 00104 --*/ 00105 00106 { 00107 USHORT Length = 0; 00108 DestinationString->Length = 0; 00109 DestinationString->Buffer = SourceString; 00110 if (ARGUMENT_PRESENT( SourceString )) { 00111 while (*SourceString++) { 00112 Length += sizeof(*SourceString); 00113 } 00114 00115 DestinationString->Length = Length; 00116 00117 DestinationString->MaximumLength = Length+(USHORT)sizeof(UNICODE_NULL); 00118 } 00119 else { 00120 DestinationString->MaximumLength = 0; 00121 } 00122 } }


Generated on Sat May 15 19:45:42 2004 for test by doxygen 1.3.7