Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FreePortableDevicePnPIDs function

The FreePortableDevicePnPIDs helper function frees the Plug and Play (PnP) identifiers that are retrieved by the IPortableDeviceManager::GetDevices or IPortableDeviceServiceManager::GetDeviceServices methods.

Syntax


void FreePortableDevicePnPIDs(
   LPWSTR *pPnPIDs,
   DWORD  cPnPIDs
);

Parameters

pPnPIDs

The array of Plug and Play (PnP) identifiers to be freed.

cPnPIDs

The number of identifiers in the array specified by the pPnPIDs parameter.

Return value

This function does not return a value.

Remarks

The application is responsible for freeing the array of pointers that it allocates.

Examples



// 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;		
 }
} 

Requirements

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

None supported

Header

PortableDevice.h

 

 

Community Additions

Show:
© 2016 Microsoft