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

ULONG NTAPI PciIdPrintfAppend ( IN PPCI_ID_BUFFER  IdBuffer,
IN PCCH  Format,
  ... 
)

Definition at line 158 of file id.c.

Referenced by PciQueryId().

{
    ULONG NextId, Size, Length, MaxLength;
    PANSI_STRING AnsiString;
    va_list va;
    va_start(va, Format);
    ASSERT(IdBuffer->Count);
  
    /* Choose the next static ANSI_STRING to use */
    NextId = IdBuffer->Count - 1;
  
    /* Max length is from the end of the buffer up until the current pointer */
    MaxLength = (PCHAR)(IdBuffer + 1) - IdBuffer->CharBuffer; 
    
    /* Do the actual append, and return the length this string took */
    Length = vsprintf(IdBuffer->CharBuffer - 1, Format, va);
    ASSERT(Length < MaxLength);

    /* Select the static ANSI_STRING, and update its length information */
    AnsiString = &IdBuffer->Strings[NextId];
    AnsiString->Length += Length;
    AnsiString->MaximumLength += Length;
  
    /* Calculate the final size of the string, in Unicode */
    Size = RtlAnsiStringToUnicodeSize(AnsiString);
  
    /* Update the buffer with the size, and update the character pointer */
    IdBuffer->StringSize[NextId] = Size;
    IdBuffer->TotalLength += Size;
    IdBuffer->CharBuffer += Length;
    
    /* Return the size */
    return Size;
}

Generated on Sat May 26 2012 05:22:12 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.