Condividi tramite


Funzione DismAddDriver

Aggiunge un driver di terze parti (inf) a un'immagine windows offline.

Sintassi

HRESULT WINAPI DismAddDriver(
  _In_ DismSession Session,
  _In_ PCWSTR      DriverPath,
  _In_ BOOL        ForceUnsigned
);

Parametri

Sessione [in]
Una dismSession valida. La dismSession deve essere associata a un'immagine. È possibile associare una sessione a un'immagine usando la funzione DismOpenSession .

DriverPath [in]
Percorso relativo o assoluto del file con estensione inf del driver.

ForceUnsigned [in]
Valore booleano che specifica se accettare driver non firmati a un'immagine basata su x64. I driver non firmati verranno aggiunti automaticamente a un'immagine basata su x86.

Valore Descrizione
TRUE Aggiungere driver non firmati a un'immagine basata su x64.
FALSE Non aggiungere driver senza segno a un'immagine basata su x64.

Valore restituito

Se l'esito è positivo, restituisce S_OK .

Esempio

In questo esempio il driver aggiunto si trova nel computer tecnico nella cartella C:\drivers\. Il driver ha il nome file usb.inf nel computer tecnico, ma viene rinominato in "OEM1.inf" o "OEM2.inf" nell'immagine di destinazione. La numerazione dei file OEMx.inf dipende dal numero di driver aggiunti. Il nuovo nome, ad esempio OEM1.inf, viene restituito nella struttura DismDriverPackage quando si chiama DismGetDrivers. È consigliabile usare il nuovo nome OEM1.inf per specificare DriverPath quando si usa DismGetDriverInfo.

HRESULT hr = S_OK;
hr = DismAddDriver(Session, L"C:\\Drivers\\usb.inf", FALSE);

Requisiti

Requisito Descrizione
Piattaforme host supportate L'API GESTIONE e manutenzione immagini distribuzione può essere usata in qualsiasi sistema operativo supportato da Windows Assessment and Deployment Kit (Windows ADK). Per altre informazioni, vedere la Guida tecnica di Windows ADK.
Piattaforme di immagini supportate Windows 7, Windows Server 2008 R2, Windows PE 3.0, Windows 8, Windows Server 2012, Windows Preinstallation Environment (Windows PE) 4.0, Windows 8.1, Windows Server 2012 R2, Windows 10, Windows Server 2016
Client minimo supportato Windows 7 [solo app desktop]
Server minimo supportato Windows Server 2008 R2 [solo app desktop]
Intestazione DismAPI.h
Libreria DismAPI.lib
DLL DismAPI.dll