Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
PrfQueryProfileSize (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINSHELLDATA
BOOL PrfQueryProfileSize(hini, pszAppName, pszKeyName, pcb)
HINI hini; /* initialization-file handle */
PSZ pszAppName; /* pointer to application name */
PSZ pszKeyName; /* pointer to keyname */
PULONG pcb; /* pointer to variable with data length */
The PrfQueryProfileSize function retrieves the size of the data stored at a
specified location in the profile file.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hini Identifies the file to query. This parameter can be a file
handle 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 the user profile only.
HINI_SYSTEMPROFILE Search the system profile only.
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, the length returned in
the variable pointed to by the pcb parameter is the length
required to contain a list of all application names for the
pszKeyName parameter.
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, the length returned in the variable pointed
to by the pcb parameter is the length required to contain a list
of all keynames.
pcb Points to the variable that receives the length of the data. If
an error occurs, the length is not returned.
Return Value
The return value is TRUE if the function is successful.
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
The location of the data stored in the profile file is determined by the
application name and keyname passed to this function. This function is
typically called to determine how much memory to allocate before calling
PrfQueryProfileData.
The count returned by this function will be 1 greater than that returned by
PrfQueryProfileData or PrfQueryProfileString in cases where these functions
will return a list. This is due to an additional null character used as a
terminator for the entire list.
See Also
PrfQueryProfileData, PrfQueryProfileString, WinQueryProfileSize
♦