RtnGetPrivateProfileString

RtnGetPrivateProfileString is used to read the contents of an INI file in Windows standard format. Normally the INI file is read during the RtndInitialize routine, with the file name and section name passed to the RtndInitialize, to retrieve driver configuration data.

Syntax

int RtnGetPrivateProfileString(
    const WCHAR* fileName,
    char* pszSection,
    char* pszEntry,
    char* pszDefault,
    char* pszBuffer,
    int cbBuffer 
);

Parameters

filename

UNICODE file name of INI file. This is passed to RtndInitialize and can be used without changes.

pszSection

Section name to read from INI file. This is passed to RtndInitialize and can be used without changes.

pszEntry

Field name in ASCII to read from INI file.

pszDefault

Default field value in ASCII. The default value will be returned to the caller if no field is found. If no default is desired, pass a "" (i.e., an empty string) as the default. Do NOT pass NULL.

pszBuffer

Location to place string read from INI file.

cbBuffer

Size of the pszBuffer.

Return Values

The number of characters placed into the pszBuffer if string exists with pszEntry name.

The pszDefault string length will be returned if the string does not exist in INI file:

0 (zero) if no string exists and "" passed as default, or -1 if error reading INI file

Requirements

Header Drvutl.h
Library Rtxtcpip.lib
IntervalZero.com | Support | Give Feedback