この msdn の記事を確認してください。
http://msdn.microsoft.com/en-us/library/bb742655.aspx
具体的には、次の手順に従います。
Call SetupDiGetDeviceRegistryProperty to retrieve the size, in bytes, of the property value. Supply the following parameter values:
Set DeviceInfoSet to a handle to a device information set that contains the device instance for which to retrieve the requested property value.
Set DeviceInfoData to a pointer to an SP_DEVINFO_DATA structure that represents the device instance for which to retrieve the requested property value.
Set Property to an SPDRP_Xxx identifier. For a list of these identifiers and a description of the corresponding device properties, see the description of the Property parameter that is included with SetupDiSetDeviceRegistryProperty.
Set PropertyRegDataType to a pointer to a DWORD-typed variable.
Set PropertyBuffer to NULL.
Set PropertyBufferSize to zero.
Set RequiredSize to a pointer to a DWORD-typed variable that receives, the size, in bytes of the property value.
In response to the call to SetupDiSetDeviceRegistryProperty, SetupDiGetDeviceRegistryProperty sets *RequiredSize to the size, in bytes, of the buffer that is required to retrieve the property value, logs the error code ERROR_INSUFFICIENT_BUFFER, and returns FALSE. A subsequent call to GetLastError will return the most recently logged error code.
Call SetupDiGetDeviceRegistryProperty again and supply the same parameter values that were supplied in the first call, except for the following changes:
PropertyBuffer を、要求されたプロパティ値を受け取る BYTE 型のバッファーへのポインターに設定します。PropertyBufferSize を PropertyBuffer バッファーのサイズ (バイト単位) に設定します。SetupDiGetDeviceRegistryProperty への最初の呼び出しは、必要なサイズの PropertyBuffer バッファーを *RequiredSize で取得しました。
このリンクは、SetupDiGetDeviceRegistryProperty を呼び出すために必要な構造を取得する方法を示しています。
http://www.pinvoke.net/default.aspx/setupapi/SetupDiEnumDeviceInfo.html