This topic has not yet been rated - Rate this topic

IDiaDataSource::loadDataForExe Method

Opens and prepares the debug data associated with the .exe/.dll file. The debug header of the .exe/.dll file names the associated debug data location.

HRESULT loadDataForExe (
   LPCOLESTR executable,
   LPCOLESTR searchPath,
   IUnknown* pCallback
);

Parameters

executable
[in] Path to the .exe or .dll file.
searchPath
[in] Alternate path to search for debug data.
pCallback
[in] Pointer to an IUnknown for an object that supports a debug callback interface, such as IDiaLoadCallback, IDiaReadExeAtOffsetCallback, and/or IDiaReadExeAtRVACallback.

Return Value

The following table shows possible HRESULT return values for loadDataForExe.

Value Description
S_OK Success.
E_PDB_NOT_FOUND Failed to open the file, or the file has an invalid format.
E_PDB_FORMAT Attempted to access a file with an obsolete format.
E_PDB_INVALID_SIG Signature does not match.
E_PDB_INVALID_AGE Age does not match.
E_INVALIDARG Invalid wszPDB pointer.
E_UNEXPECTED Data source has already been prepared.

Remarks

This method reads the debug header and then searches for and prepares the debug data. The progress of the search may, optionally, be reported through callbacks. For example, IDiaLoadCallback::NotifyDebugDir is invoked when IDiaDataSource::loadDataForExe finds and processes a debug directory. Optional callbacks also support reading data from the executable file when this file cannot be accessed directly through file I/O.

Example

class MyCallBack: public IDiaLoadCallback
{

};
MyCallBack callback;

pSource->loadDataForExe( L"myprog.pdb", L".\debug", (IUnknown*)&callback);

See Also

IDiaDataSource | IDiaLoadCallback | IDiaLoadCallback::NotifyDebugDir | IDiaReadExeAtOffsetCallback | IDiaReadExeAtRVACallback

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.