win12.hlp (Table of Contents; Topic list)
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.
PrfQueryProfile (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINSHELLDATA
 
BOOL PrfQueryProfile(hab, pprfprofile)
HAB hab;                    /* anchor-block handle                   */
PPRFPROFILE pprfprofile;    /* address of structure for profile data */
 
The PrfQueryProfile function retrieves the fully qualified filenames of the
two MS OS/2 profile (initialization) files.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
hab          Identifies the anchor block.
 
pprfprofile  Points to the PRFPROFILE structure that receives information
             about the profile filenames.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
Comments
 
If either length field (cchUserName or cchSysName) of the PRFPROFILE
structure is set to zero when calling this function, the length field is set
to the number of bytes required to hold the corresponding filename, and that
filename field is not filled in.
 
Example
 
This example calls PrfQueryProfile to retrieve the size of the filenames,
allocates the memory needed for each string, and calls PrfQueryProfile again
to retrieve the filenames.
 
PRFPROFILE prfpro;
SEL selUser;
SEL selSys;
 
prfpro.cchUserName = 0L;
prfpro.cchSysName =  0L;
PrfQueryProfile(hab, &prfpro);            /* gets size of filenames */
DosAllocSeg(prfpro.cchUserName, &selUser, SEG_NONSHARED);
DosAllocSeg(prfpro.cchSysName, &selSys, SEG_NONSHARED);
prfpro.pszUserName = MAKEP(selUser, 0);   /* initializes pointers   */
prfpro.pszSysName = MAKEP(selSys, 0);
PrfQueryProfile(hab, &prfpro);
 
See Also
 
PrfReset, PRFPROFILE