|
2 | 2 | title: "IDiaDataSource::loadDataFromPdb | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -dev_langs: |
| 5 | +dev_langs: |
6 | 6 | - "C++"
|
7 |
| -helpviewer_keywords: |
| 7 | +helpviewer_keywords: |
8 | 8 | - "IDiaDataSource::loadDataFromPdb method"
|
9 | 9 | ms.assetid: 02159073-8144-47f8-a0b0-aa0edcb92b5b
|
10 | 10 | author: "mikejo5000"
|
11 | 11 | ms.author: "mikejo"
|
12 | 12 | manager: jillfra
|
13 |
| -ms.workload: |
| 13 | +ms.workload: |
14 | 14 | - "multiple"
|
15 | 15 | ---
|
16 | 16 | # IDiaDataSource::loadDataFromPdb
|
17 |
| -Opens and prepares a program database (.pdb) file as a debug data source. |
18 |
| - |
19 |
| -## Syntax |
20 |
| - |
21 |
| -```C++ |
22 |
| -HRESULT loadDataFromPdb ( |
23 |
| - LPCOLESTR pdbPath |
24 |
| -); |
25 |
| -``` |
26 |
| - |
27 |
| -#### Parameters |
28 |
| - pdbPath |
29 |
| - [in] The path to the .pdb file. |
30 |
| - |
31 |
| -## Return Value |
32 |
| - If successful, returns `S_OK`; otherwise, returns an error code. The following table shows the possible return values for this method. |
33 |
| - |
34 |
| -|Value|Description| |
35 |
| -|-----------|-----------------| |
36 |
| -|E_PDB_NOT_FOUND|Failed to open the file, or determined that the file has an invalid format.| |
37 |
| -|E_PDB_FORMAT|Attempted to access a file with an obsolete format.| |
38 |
| -|E_INVALIDARG|Invalid parameter.| |
39 |
| -|E_UNEXPECTED|Data source has already been prepared.| |
40 |
| - |
41 |
| -## Remarks |
42 |
| - This method loads the debug data directly from a .pdb file. |
43 |
| - |
44 |
| - To validate the .pdb file against specific criteria, use the [IDiaDataSource::loadAndValidateDataFromPdb](../../debugger/debug-interface-access/idiadatasource-loadandvalidatedatafrompdb.md) method. |
45 |
| - |
46 |
| - To gain access to the data load process (through a callback mechanism), use the [IDiaDataSource::loadDataForExe](../../debugger/debug-interface-access/idiadatasource-loaddataforexe.md) method. |
47 |
| - |
48 |
| - To load a .pdb file directly from memory, use the [IDiaDataSource::loadDataFromIStream](../../debugger/debug-interface-access/idiadatasource-loaddatafromistream.md) method. |
49 |
| - |
50 |
| -## Example |
51 |
| - |
52 |
| -```C++ |
53 |
| -HRESULT hr = pSource->loadDataFromPdb( L"myprog.pdb" ); |
54 |
| -if (FAILED(hr)) |
55 |
| -{ |
56 |
| - // report error |
57 |
| -} |
58 |
| -``` |
59 |
| - |
60 |
| -## See Also |
61 |
| - [IDiaDataSource](../../debugger/debug-interface-access/idiadatasource.md) |
62 |
| - [IDiaDataSource::loadDataForExe](../../debugger/debug-interface-access/idiadatasource-loaddataforexe.md) |
63 |
| - [IDiaDataSource::loadAndValidateDataFromPdb](../../debugger/debug-interface-access/idiadatasource-loadandvalidatedatafrompdb.md) |
64 |
| - [IDiaDataSource::loadDataFromIStream](../../debugger/debug-interface-access/idiadatasource-loaddatafromistream.md) |
| 17 | +Opens and prepares a program database (.pdb) file as a debug data source. |
| 18 | + |
| 19 | +## Syntax |
| 20 | + |
| 21 | +```C++ |
| 22 | +HRESULT loadDataFromPdb ( |
| 23 | + LPCOLESTR pdbPath |
| 24 | +); |
| 25 | +``` |
| 26 | + |
| 27 | +#### Parameters |
| 28 | +pdbPath |
| 29 | +[in] The path to the .pdb file. |
| 30 | + |
| 31 | +## Return Value |
| 32 | +If successful, returns `S_OK`; otherwise, returns an error code. The following table shows the possible return values for this method. |
| 33 | + |
| 34 | +|Value|Description| |
| 35 | +|-----------|-----------------| |
| 36 | +|E_PDB_NOT_FOUND|Failed to open the file, or determined that the file has an invalid format.| |
| 37 | +|E_PDB_FORMAT|Attempted to access a file with an obsolete format.| |
| 38 | +|E_INVALIDARG|Invalid parameter.| |
| 39 | +|E_UNEXPECTED|Data source has already been prepared.| |
| 40 | + |
| 41 | +## Remarks |
| 42 | +This method loads the debug data directly from a .pdb file. |
| 43 | + |
| 44 | +To validate the .pdb file against specific criteria, use the [IDiaDataSource::loadAndValidateDataFromPdb](../../debugger/debug-interface-access/idiadatasource-loadandvalidatedatafrompdb.md) method. |
| 45 | + |
| 46 | +To gain access to the data load process (through a callback mechanism), use the [IDiaDataSource::loadDataForExe](../../debugger/debug-interface-access/idiadatasource-loaddataforexe.md) method. |
| 47 | + |
| 48 | +To load a .pdb file directly from memory, use the [IDiaDataSource::loadDataFromIStream](../../debugger/debug-interface-access/idiadatasource-loaddatafromistream.md) method. |
| 49 | + |
| 50 | +## Example |
| 51 | + |
| 52 | +```C++ |
| 53 | +HRESULT hr = pSource->loadDataFromPdb( L"myprog.pdb" ); |
| 54 | +if (FAILED(hr)) |
| 55 | +{ |
| 56 | + // report error |
| 57 | +} |
| 58 | +``` |
| 59 | +
|
| 60 | +## See Also |
| 61 | +[IDiaDataSource](../../debugger/debug-interface-access/idiadatasource.md) |
| 62 | +[IDiaDataSource::loadDataForExe](../../debugger/debug-interface-access/idiadatasource-loaddataforexe.md) |
| 63 | +[IDiaDataSource::loadAndValidateDataFromPdb](../../debugger/debug-interface-access/idiadatasource-loadandvalidatedatafrompdb.md) |
| 64 | +[IDiaDataSource::loadDataFromIStream](../../debugger/debug-interface-access/idiadatasource-loaddatafromistream.md) |
0 commit comments