description | title | ms.date | ms.topic | dev_langs | helpviewer_keywords | author | ms.author | manager | ms.subservice | ||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves the raw bytes of the named stream. | IDiaDataSourceEx::getStreamRawData | 7/2/2024 | reference |
|
| grantri | grantri | mijacobs | debug-diagnostics |
Retrieves the raw bytes of the named stream.
HRESULT getStreamRawData ( LPCOLESTR stream, ULONGLONG cbOffset, ULONGLONG cbRead, ULONGLONG* pcbRead, BYTE* pbData );
stream
[in] The name of the stream within the debug information.
cbOffset
[in] The offset within the stream to begin reading data from.
cbRead
[in] The number of bytes to retrieve.
pcbRead
[out] The number of bytes actually read from the stream.
pbData
[out] The location to store the read data. On input must be at least cbRead
bytes in size. Upon successful return *pcbRead
bytes will be valid.
If successful, returns S_OK
. If the named stream does not exist within the PDB, the API might fail, or it might return a length of 0.
Program Databases are made up of multiple streams of data. Some of those streams are named. You can use this method to gather information about these named streams.
To get the size of the stream, use the IDiaDataSourceEx::getStreamSize
method.
ULONGLONG countBytes = 0; LPCOLESTR stream = L"/names"; HRESULT hr = pSource->getStreamSize( stream, &countBytes ); if (SUCCEEDED(hr)) { for (ULONGLONG cbOffset = 0, cbRead = 0; cbOffset < countBytes; cbOffset += cbRead) { BYTE buffer[100]; cbRead = 0; hr = pSource->getStreamRawBytes( stream, cbOffset, std::min(countBytes - cbOffset, sizeof(buffer)), &cbRead, buffer); if (SUCCEEDED(hr)) { ...