直接写的,楼主看一下
DWORD ** GetConnEntryType()
{
DWORD ** pcType = NULL;
DWORD iLoopTime = 0;
HRESULT hr = E_FAIL;
//
// Get the the required size of the buffer
// with which the function needs to be called on the next attempt.
//
hr = ConnMgrQueryDetailedStatus(NULL, &dwSize);
if(STRSAFE_E_INSUFFICIENT_BUFFER != hr)
return pcDescription;
LPBYTE pBuffer = new BYTE[dwSize]; //for total size
if(NULL == pBuffer)
return pcType
//
// Get the connection information
//
hr = ConnMgrQueryDetailedStatus((CONNMGR_CONNECTION_DETAILED_STATUS*)pBuffer, &dwSize);