win12.hlp (Table of Contents; Topic list)
PrfQueryProfileData (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINSHELLDATA
 
BOOL PrfQueryProfileData(hini, pszAppName, pszKeyName, pvBuf, pcbBuf)
HINI hini;         /* initialization-file handle  */
PSZ pszAppName;    /* pointer to application name */
PSZ pszKeyName;    /* pointer to keyname          */
PVOID pvBuf;       /* pointer to buffer           */
PULONG pcbBuf;     /* buffer length               */
 
The PrfQueryProfileData function retrieves binary data from the profile
file. The location of the data is determined by the application name and
keyname that are passed to the function.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
hini        Identifies the file to query. This parameter can be a file
            handle obtained with PrfOpenProfile or one of the following
            values:
 
            Value               Meaning
            ────────────────────────────────────────────────────────────────
            HINI_PROFILE        Search the user profile, and if no matching
                                entries are found, search the system
                                profile.
 
            HINI_USERPROFILE    Search only the user profile.
 
            HINI_SYSTEMPROFILE  Search only the system profile.
 
pszAppName  Points to the null-terminated string that contains the
            application name. The string must be less than 1024 bytes long,
            including the terminating null character. The application name
            is case-sensitive. If pszAppName is NULL, a list of all
            application names in the profile specified by the hini parameter
            is returned.
 
pszKeyName  Points to the null-terminated string that contains the keyname.
            The string must be less than 1024 bytes long, including the
            terminating null character. The keyname is case-sensitive. If
            pszKeyName is NULL, all keynames in the profile specified by the
            hini parameter are enumerated.
 
pvBuf       Points to the buffer that receives the data.
 
pcbBuf      Points to a variable. When this function is called, the variable
            specifies the size (in bytes) of the buffer pointed to by the
            pvBuf parameter. When the function returns, this variable
            contains the actual number of bytes placed in the buffer.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INVALID_PARM
     PMERR_MEMORY_ALLOC
     PMERR_MEMORY_ALLOCATION_ERR
     PMERR_MEMORY_DEALLOCATION_ERR
 
Comments
 
When NULL is used in pszKeyName, if the application name specified by
pszAppName is not found, PrfQueryProfileData returns FALSE.
 
The size of the data can be determined by calling the PrfQueryProfileSize
function. In cases where pvBuf points to a list of values, the value
returned by PrfQueryProfileSize will include a NULL byte at the end of the
list, used as a terminator.
 
See Also
 
PrfQueryProfileSize, PrfWriteProfileData, WinQueryProfileData,
WinGetLastError