Share via


NetUpgradeAddLineToSection function

This function is obsolete for Microsoft Windows XP (SP1 and later), Microsoft Windows Server 2003, and later operating systems.

NetUpgradeAddLineToSection adds a line to a specified section of the AnswerFile.

Syntax

LONG __stdcall NetUpgradeAddLineToSection(
  _In_ LPCTSTR szSectionName,
  _In_ LPCTSTR szLine
);

Parameters

  • szSectionName [in]
    AnswerFile section to which the line is to be added.

  • szLine [in]
    Line to add to the specified AnswerFile section.

Return value

The NetUpgradeAddLineToSection function can return one of the following:

Return code Description
ERROR_SUCCESS

The specified line was added to the specified section of the AnswerFile.

ERROR_INVALID_PARAMETER

The szSectionName is invalid.

ERROR_INVALID_PARAMETER

The szSectionName was not found in the AnswerFile.

 

Any other return value indicates a fatal error.

Remarks

A network migration DLL calls NetUpgradeAddLineToSection in the context of its DoPreUpgradeProcessing function to add a line to a section in the AnswerFile ( winnt.sif). NetSetup uses the AnswerFile during the operating system upgrade to migrate network components to the upgraded operating system.

After creating a section in the AnswerFile by calling NetUpgradeAddSection, a network migration DLL calls NetUpgradeAddLineToSection one or more times to add entries to this section. Each call to NetUpgradeAddLineToSection adds a single entry.

A network migration DLL can optionally write either or both of the following keys to a component's OEM-section([ params.component_name.OemSection]) in the AnswerFile:

  • InfToRunBeforeInstall

    Specifies an INF file and an INF file section. NetSetup loads the specified INF file from the temporary directory that contains the network migration DLL. NetSetup executes the commands in the specified INF file section before the upgrade operating system is installed.

This key has the following format:

InfToRunBeforeInstall= INF-filename,section-name

One possible use of this key is to specify a section that contains a DelFile command that deletes the preupgrade version of a network driver file. If the preupgrade and upgrade versions of such a file have different names, NetSetup does not delete the preupgrade version unless directed to do so by a DelFile command.

The following example of an InfToRunBeforeInstall key specifies a section that contains a DelFile command:

InfToRunBeforeInstall=xyz.inf,DeleteFile

InfToRunAfterInstall

Specifies an optional INF file and a section that contains INF commands. If INF-filename is specified, NetSetup looks for the section-name in the specified INF file. NetSetup loads the INF file from the temporary directory that contains the network migration DLL. If a pair of quotation marks ("") is specified for INF-filename, NetSetup looks for the specified section-name in the AnswerFile. NetSetup executes the commands in section-name after the upgrade operating system is installed.

This key has the following format:

InfToRunAfterInstall= INF-filename,section-name

A network migration DLL can call NetUpgradeAddLineToSection to add other types of entries to other sections in the AnswerFile. For example, after adding an Add-registry-section to the AnswerFile, the DLL can add keys and values that NetSetup writes to the registry. The following example shows ISDN keys and values written by the DLL to the AnswerFile:

[adapter2.SectionToRun.AddReg] ; //AddReg section created by DLL
HKR,0\0,IsdnPhoneNumber,0,"111-1111" ; //AddReg entries written by DLL
HKR,0\1,IsdnPhoneNumber,0,"222-2222"
HKR,0\0,IsdnSpid,0,"111"
HKR,0\1,IsdnSpid,0,"222"
HKR,0,IsdnSwitchType,0x00010001,1

Requirements

Target platform

Desktop

Version

Obsolete for Microsoft Windows XP with SP1 and later service packs, Microsoft Windows Server 2003, and later operating systems.

Header

Oemupgex.h (include OemUpGex.h)

See also

NetUpgradeAddSection

 

 

Send comments about this topic to Microsoft