The call searches the profile for a key matching the name specified by the pszKey parameter under the application heading specified by the pszApp parameter. If the key is found, the corresponding string is copied. If the key does not exist, the default character string, specified by the pszDefault parameter, is copied.
If the enumerated application names exceed the available buffer space, the enumerated names are truncated, the enumerated list is not terminated with 2 bytes of zeros, and the ulLength parameter is set to the number of bytes copied into the pBuffer parameter. In this instance, the pszKey parameter is ignored.
Note: If the enumeration cannot be performed for any reason, the default character string is not copied.
This function returns the length of the list, up to, but not including, the final null. If the enumerated key names exceed the available buffer space, the enumerated names are truncated, the enumerated list is not terminated with 2 bytes of zeros, and the ulLength parameter is set to the number of bytes copied into the pBuffer parameter.
This function is case-dependent; thus the strings in the pszApp parameter and the pszKey parameter must match exactly. This avoids any code-page dependency. The application storing the data must do any case-independent matching.
The enumeration call does not distinguish between data written with the PrfWriteProfileString function and the PrfWriteProfileData function.