Your application can retrieve the names of the system initialization files by using the PrfQueryProfile function. Although the OS/2 initialization files are usually named os2.ini and os2sys.ini, you can use other files when starting the system.
The following example retrieves the names of the initialization files and copies their names to the strings szUserName and szSysName. Once you know the names of the OS/2 initialization files, you can use them to open the files and read settings.
CHAR szUserName[CCHMAXPATH]; CHAR szSysName[CCHMAXPATH]; HINI hini; PRFPROFILE prfpro = { sizeof(szUserName), szUserName, sizeof(szSysName), szSysName }; PrfQueryProfile(hini, &prfpro);
You can change the OS/2 initialization files to files of your choice by using the PrfReset function. This function requires the names of two initialization files and uses them as replacements for the os2.ini and os2sys.ini files. The system is then reset by using the settings in the new files.