Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 76 of file rtl.c.
{ ULONG Length; PUCHAR WideString; USHORT i; Length = AnsiSource->Length * sizeof(WCHAR); if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; UniDest->Length = (USHORT)Length; if (AllocateDestinationString) { UniDest->MaximumLength = (USHORT)Length + sizeof(WCHAR); UniDest->Buffer = (PWSTR) malloc(UniDest->MaximumLength); if (!UniDest->Buffer) return STATUS_NO_MEMORY; } else if (UniDest->Length >= UniDest->MaximumLength) { return STATUS_BUFFER_OVERFLOW; } WideString = (PUCHAR)UniDest->Buffer; for (i = 0; i <= AnsiSource->Length; i++) { WideString[2 * i + 0] = AnsiSource->Buffer[i]; WideString[2 * i + 1] = 0; } return STATUS_SUCCESS; }