RasSetEntryPropertiesA function (ras.h)

The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.

Syntax

DWORD RasSetEntryPropertiesA(
       LPCSTR      ,
       LPCSTR      ,
       LPRASENTRYA ,
       DWORD       ,
       LPBYTE      ,
       DWORD       
);

Parameters

[in] unnamedParam1

Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.

[in] unnamedParam2

Pointer to a null-terminated string that specifies an entry name.

If the entry name matches an existing entry, RasSetEntryProperties modifies the properties of that entry.

If the entry name does not match an existing entry, RasSetEntryProperties creates a new phone-book entry. For new entries, call the RasValidateEntryName function to validate the entry name before calling RasSetEntryProperties.

[in] unnamedParam3

Pointer to the RASENTRY structure that specifies the new connection data to be associated with the phone-book entry indicated by the lpszEntry parameter.

The caller must provide values for the following members in the RASENTRY structure.

  • dwSize
  • szLocalPhoneNumber
  • szDeviceName
  • szDeviceType
  • dwFramingProtocol
  • dwfOptions
  • dwType
Windows XP or later:  dwType is supported.

If values are not provided for these members, RasSetEntryProperties fails with ERROR_INVALID_PARAMETER.

The structure might be followed by an array of null-terminated alternate phone number strings. The last string is terminated by two consecutive null characters. The dwAlternateOffset member of the RASENTRY structure contains the offset to the first string.

[in] unnamedParam4

Specifies the size, in bytes, of the buffer identified by the lpRasEntry parameter.

[in] unnamedParam5

Pointer to a buffer that specifies device-specific configuration information. This is opaque TAPI device configuration information. For more information about TAPI device configuration, see the lineGetDevConfig function in Telephony Application Programming Interfaces (TAPI) in the Platform SDK.

Windows XP:  This parameter is unused. The calling function should set this parameter to NULL.

[in] unnamedParam6

Specifies the size, in bytes, of the lpbDeviceInfo buffer.

Windows XP:  This parameter is unused. The calling function should set this parameter to zero.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes or a value from Routing and Remote Access Error Codes or WinError.h.

Value Meaning
ERROR_ACCESS_DENIED
The user does not have the correct privileges. Only an administrator can complete this task.
ERROR_BUFFER_INVALID
The address or buffer specified by lpRasEntry is invalid.
ERROR_CANNOT_OPEN_PHONEBOOK
The phone book is corrupted or missing components.
ERROR_INVALID_PARAMETER
The RASENTRY structure pointed to by the lpRasEntry parameter does not contain adequate information, or the specified entry does not exist in the phone book. See the description for lpRasEntry to see what information is required.

Remarks

When setting properties for an all-users connection, if the calling application specifies a non-NULL value for the phone-book parameter, lpszPhonebook, the phone-book file must be located in the phone-book directory beneath the all-users application data path. To obtain the correct location for the phone-book file, first call SHGetFolderPath with a CSIDL value of CSIDL_COMMON_APPDATA. SHGetFolderPath returns the all-users application data path. Append the following string to this path:

Microsoft\Network\Connections\Pbk

The combined path is the correct location for the phone-book file.

Note  Specifying a non-NULL value for the lpszPhonebook parameter may not be supported in versions of Windows later than Windows XP.
 

Note

The ras.h header defines RasSetEntryProperties as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ras.h
Library Rasapi32.lib
DLL Rasapi32.dll

See also

RASENTRY

RasCreatePhonebookEntry

RasGetEntryProperties

RasValidateEntryName

Remote Access Service (RAS) Overview

Remote Access Service Functions