Condividi tramite


Funzione FreePortableDevicePnPIDs

La funzione helper FreePortableDevicePnPIDs libera gli identificatori Plug and Play (PnP) recuperati dai metodi IPortableDeviceManager::GetDevices o IPortableDeviceServiceManager::GetDeviceServices.

Sintassi

void FreePortableDevicePnPIDs(
   LPWSTR *pPnPIDs,
   DWORD  cPnPIDs
);

Parametri

pPnPIDs

Matrice di identificatori Plug and Play (PnP) da liberare.

cPnPIDs

Numero di identificatori nella matrice specificata dal parametro pPnPIDs .

Valore restituito

Questa funzione non restituisce un valore.

Commenti

L'applicazione è responsabile della liberazione della matrice di puntatori allocati.

Esempio

// Allocate an array of LPWSTR pointers.
    LPWSTR* pPnpDeviceIDs = new LPWSTR[cPnpDeviceIDs];
if (pPnpDeviceIDs != NULL)
{
    hr = pPortableDeviceManager->;GetDevices(pPnpDeviceIDs, &cPnpDeviceIDs);
    if (SUCCEEDED(hr))
    {
        // Free all returned PnPDeviceID strings allocated by IPortableDeviceManager::GetDevices.
     FreePortableDevicePnPIDs(pPnpDeviceIDs, cPnpDeviceIDs);
     // Application is responsible for deleting the array of LPWSTR pointers.
     delete [] pPnpDeviceIDs;
     pPnpDeviceIDs = NULL;      
 }
} 

Requisiti

Requisito Valore
Client minimo supportato
Windows 7 [app desktop | App UWP]
Server minimo supportato
Nessuno supportato
Intestazione
PortableDevice.h