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

PVOID WINAPI FlatBuf_Arg_WriteString ( IN OUT PULONG_PTR  Position,
IN OUT PSIZE_T  FreeSize,
IN PVOID  String,
IN BOOLEAN  IsUnicode 
)

Definition at line 82 of file flatbuf.c.

{
    PVOID Destination;
    SIZE_T StringLength;
    ULONG Align;

    /* Calculate the string length */
    if (IsUnicode)
    {
        /* Get the length in bytes and use WCHAR alignment */
        StringLength = (wcslen((LPWSTR)String) + 1) * sizeof(WCHAR);
        Align = sizeof(WCHAR);
    }
    else
    {
        /* Get the length in bytes and use CHAR alignment */
        StringLength = strlen((LPSTR)String) + 1;
        Align = sizeof(CHAR);
    }

    /* Now reserve the memory */
    Destination = FlatBuf_Arg_Reserve(Position, FreeSize, StringLength, Align);
    if (Destination)
    {
        /* We have space, do the copy */
        RtlCopyMemory(Destination, String, StringLength);
    }

    /* Return the pointer to the data */
    return Destination;
}

Generated on Fri May 25 2012 06:01:27 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.