Platform SDK: Performance Monitoring |
The PdhSelectDataSource function displays a dialog window that prompts the user to specify where the performance data will be collected.
PDH_STATUS PdhSelectDataSource( HWND hWndOwner, DWORD dwFlags, LPTSTR szDataSource, LPDWORD pcchBufferLength );
Value | Meaning |
---|---|
PDH_FLAGS_FILE_BROWSER_ONLY | Display the file browser only. |
0 | Display the data source selection dialog containing a button that can be clicked to display the file browser. |
This function can prompt for the data source in two ways. If the value of this parameter is zero, then a dialog is displayed prompting the user to select performance data input from either a log file or a real-time source. If the user specified that data is to be collected from a log file, a file browser is displayed for the user to specify the name and location of the log file.
If the value of this parameter is PDH_FLAGS_FILE_BROWSER_ONLY, the file browser only will be displayed. This flag would be set when this function is used solely to prompt for the name and location of a log file.
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, the return value is an error status defined in PDHMsg.h. The following are possible error values.
Error value | Description |
---|---|
PDH_INVALID_ARGUMENT | The length of the buffer passed in the pcchBufferLength is not equal to the actual length of the szDataSource parameter. |
PDH_MEMORY_ALLOCATION_FAILURE | A zero-length buffer was passed in the szDataSource parameter. |
Windows NT/2000: Requires Windows 2000.
Header: Declared in Pdh.h.
Library: Use Pdh.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows 2000.