---
UID: NF:setupapi.SetupInstallServicesFromInfSectionExA
title: SetupInstallServicesFromInfSectionExA function (setupapi.h)
description: The SetupInstallServicesFromInfSectionEx function performs service installation and deletion operations that are specified in the Service Install sections listed in the Service section of an INF file. (ANSI)
helpviewer_keywords: ["SPSVCINST_ASSOCSERVICE", "SPSVCINST_CLOBBER_SECURITY", "SPSVCINST_DELETEEVENTLOGENTRY", "SPSVCINST_NOCLOBBER_DEPENDENCIES", "SPSVCINST_NOCLOBBER_DESCRIPTION", "SPSVCINST_NOCLOBBER_DISPLAYNAME", "SPSVCINST_NOCLOBBER_ERRORCONTROL", "SPSVCINST_NOCLOBBER_LOADORDERGROUP", "SPSVCINST_NOCLOBBER_REQUIREDPRIVILEGES", "SPSVCINST_NOCLOBBER_STARTTYPE", "SPSVCINST_STARTSERVICE", "SPSVCINST_STOPSERVICE", "SPSVCINST_TAGTOFRONT", "SetupInstallServicesFromInfSectionExA", "setupapi/SetupInstallServicesFromInfSectionExA"]
old-location: setup\setupinstallservicesfrominfsectionex.htm
tech.root: setup
ms.assetid: c0bf6442-56dc-41f1-8a21-ff7b92b1ef0f
ms.date: 12/20/2024
ms.keywords: SPSVCINST_ASSOCSERVICE, SPSVCINST_CLOBBER_SECURITY, SPSVCINST_DELETEEVENTLOGENTRY, SPSVCINST_NOCLOBBER_DEPENDENCIES, SPSVCINST_NOCLOBBER_DESCRIPTION, SPSVCINST_NOCLOBBER_DISPLAYNAME, SPSVCINST_NOCLOBBER_ERRORCONTROL, SPSVCINST_NOCLOBBER_LOADORDERGROUP, SPSVCINST_NOCLOBBER_REQUIREDPRIVILEGES, SPSVCINST_NOCLOBBER_STARTTYPE, SPSVCINST_STARTSERVICE, SPSVCINST_STOPSERVICE, SPSVCINST_TAGTOFRONT, SetupInstallServicesFromInfSectionEx, SetupInstallServicesFromInfSectionEx function [Setup API], SetupInstallServicesFromInfSectionExA, SetupInstallServicesFromInfSectionExW, _setupapi_setupinstallservicesfrominfsectionex, setup.setupinstallservicesfrominfsectionex, setupapi/SetupInstallServicesFromInfSectionEx, setupapi/SetupInstallServicesFromInfSectionExA, setupapi/SetupInstallServicesFromInfSectionExW
req.header: setupapi.h
req.include-header:
req.target-type: Windows
req.target-min-winverclnt: Windows XP [desktop apps only]
req.target-min-winversvr: Windows Server 2003 [desktop apps only]
req.kmdf-ver:
req.umdf-ver:
req.ddi-compliance:
req.unicode-ansi: SetupInstallServicesFromInfSectionExW (Unicode) and SetupInstallServicesFromInfSectionExA (ANSI)
req.idl:
req.max-support:
req.namespace:
req.assembly:
req.type-library:
req.lib: Setupapi.lib
req.dll: Setupapi.dll
req.irql:
targetos: Windows
req.typenames:
req.redist:
ms.custom: 19H1
f1_keywords:
- SetupInstallServicesFromInfSectionExA
- setupapi/SetupInstallServicesFromInfSectionExA
dev_langs:
- c++
topic_type:
- APIRef
- kbSyntax
api_type:
- DllExport
api_location:
- Setupapi.dll
api_name:
- SetupInstallServicesFromInfSectionEx
- SetupInstallServicesFromInfSectionExA
- SetupInstallServicesFromInfSectionExW
---
# SetupInstallServicesFromInfSectionExA function
## -description
[This function is available for use in the operating systems indicated in the Requirements section. It may be altered or unavailable in subsequent versions. SetupAPI should no longer be used for installing applications. Instead, use the Windows Installer for developing application installers. SetupAPI continues to be used for installing device drivers.]
The
SetupInstallServicesFromInfSectionEx function performs service installation and deletion operations that are specified in the Service Install sections listed in the Service section of an INF file.
A caller of this function is required to have access to the
Service Control Manager, and privileges to modify services.
## -parameters
### -param InfHandle [in]
A handle to the INF file that contains the Service section.
### -param SectionName [in]
The name of the Service section to process. You should use a null-terminated string.
### -param Flags [in]
The controls for the installation.
Flag |
Meaning |
- SPSVCINST_TAGTOFRONT
- 0x001
|
Move the service tag to the front of its group order list.
|
- SPSVCINST_ASSOCSERVICE
- 0x002
|
AddService section: Mark this service as the function driver for the device being installed.
|
- SPSVCINST_DELETEEVENTLOGENTRY
- 0x004
|
Delete the event log entry for a specified service.
|
- SPSVCINST_NOCLOBBER_DISPLAYNAME
- 0x008
|
Do not overwrite the display name if one already exists.
|
- SPSVCINST_NOCLOBBER_STARTTYPE
- 0x010
|
Do not overwrite the start type value if the service already exists.
|
- SPSVCINST_NOCLOBBER_ERRORCONTROL
- 0x020
|
Do not overwrite the error control value if the service already exists.
|
- SPSVCINST_NOCLOBBER_LOADORDERGROUP
- 0x040
|
Do not overwrite the load order group if it already exists.
|
- SPSVCINST_NOCLOBBER_DEPENDENCIES
- 0x080
|
Do not overwrite the dependencies list if it already exists.
|
- SPSVCINST_NOCLOBBER_DESCRIPTION
- 0x100
|
AddService section: mark this service as the function driver for the device being installed.
|
- SPSVCINST_STOPSERVICE
- 0x200
|
DelService section: Stop the associated service specified in the entry before deleting the service.
|
- SPSVCINST_CLOBBER_SECURITY
- 0x400
|
AddService section: Security settings the service are overwritten if the service already exists in the system.
Note Available starting with Windows Server 2003 and Windows XP.
|
- SPSVCINST_STARTSERVICE
- 0x800
|
AddService section: Start the service after the service is installed. This flag cannot be used to start a service that implements a Plug and Play (PnP) function driver or filter driver for a device. Otherwise, this flag can be used to start a user-mode or kernel-mode service that is managed by the Service Control Manager (SCM.)
Note Available starting with Windows Server 2008 and Windows Vista.
|
- SPSVCINST_NOCLOBBER_REQUIREDPRIVILEGES
- 0x1000
|
AddService section: Do not overwrite the given service's required privileges if the service already exists in the system.
Note Available starting with Windows Server 2008 R2 and Windows 7.
|
### -param DeviceInfoSet [in]
An optional pointer to a handle to a device information set. For more information, see the DDK Programmer's Guide. (This resource may not be available in some languages
and countries.)
### -param DeviceInfoData [in]
An optional pointer to the SP_DEVINFO_DATA structure that provides a context to a specific element in the set that DeviceInfoSet specifies. For more information, see the DDK Programmer's Guide. (This resource may not be available in some languages and countries.)
### -param Reserved1
Reserved.
### -param Reserved2
Reserved.
## -returns
If the function succeeds, the return value is nonzero. The function calls SetLastError with ERROR_SUCCESS_REBOOT_REQUIRED if a reboot of the system is required.
If the function fails, the return value is 0 (zero). To get extended error information, call
GetLastError.
## -see-also
Functions
Overview
SetupInstallFilesFromInfSection
SetupInstallFromInfSection
SetupInstallServicesFromInfSection
## -remarks
> [!NOTE]
> The setupapi.h header defines SetupInstallServicesFromInfSectionEx as an alias that 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 is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).
SetupInstallServicesFromInfSectionEx will log diagnostic information to the [SetupAPI application installation text log](/windows-hardware/drivers/install/setupapi-text-logs). This log file is generally off by default. It can be enabled by modifying the *General logging levels* part of the SetupAPI `LogLevel` value as described at [Setting SetupAPI Logging Levels](/windows-hardware/drivers/install/setting-setupapi-logging-levels). For performance reasons, you should only enable this log file when troubleshooting an issue. When the log file is enabled, you can find it at `%windir%\inf\setupapi.app.log`.