在使用VS2005 + DXSDK9 + XP编译WebRTC出现
2>dxguid.lib(dxguid.obj) : fatal error LNK1103: debugging information corrupt; recompile module问题的解决方法
找到下面的文件\trunk\src\modules\video_render\main\source\windows\video_render_windows_impl.cc
找到函数void VideoRenderWindowsImpl::LogOSAndHardwareDetails()
改为如下,也就是注释掉,这个函数没有使用
该问题是由于#pragma comment(lib, "dxguid.lib")引起的,CLSID_DxDiagProvider包含在dxguid.lib里面,这个lib版本不兼容
void VideoRenderWindowsImpl::LogOSAndHardwareDetails()
{
MessageBox(NULL, _T("XXXX"), _T("*****"), MB_OK);
#if 1
HRESULT hr;
IDxDiagProvider* m_pDxDiagProvider = NULL;
IDxDiagContainer* m_pDxDiagRoot = NULL;
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
bool coUninitializeIsRequired = true;
if (FAILED(hr))
{
// Avoid calling CoUninitialize() since CoInitializeEx() failed.
coUninitializeIsRequired = false;
if (hr == RPC_E_CHANGED_MODE)
{
// Calling thread has already initialized COM to be used in a single-threaded
// apartment (STA). We are then prevented from using STA.
// Details: hr = 0x80010106 <=> "Cannot change thread mode after it is set".
//
WEBRTC_TRACE(
kTraceWarning,
kTraceVideoRenderer,
_id,
"VideoRenderWindowsImpl::LogOSAndHardwareDetails() CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) => RPC_E_CHANGED_MODE, error 0x%x",
hr);
}
}
hr = CoCreateInstance(CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER,
IID_IDxDiagProvider, (LPVOID*) &m_pDxDiagProvider);
if (FAILED(hr) || m_pDxDiagProvider == NULL)
{
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
// Fill out a DXDIAG_INIT_PARAMS struct and pass it to IDxDiagContainer::Initialize
// Passing in TRUE for bAllowWHQLChecks, allows dxdiag to check if drivers are
// digital signed as logo'd by WHQL which may connect via internet to update
// WHQL certificates.
DXDIAG_INIT_PARAMS dxDiagInitParam;
ZeroMemory(&dxDiagInitParam, sizeof(DXDIAG_INIT_PARAMS));
dxDiagInitParam.dwSize = sizeof(DXDIAG_INIT_PARAMS);
dxDiagInitParam.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION;
dxDiagInitParam.bAllowWHQLChecks = TRUE;
dxDiagInitParam.pReserved = NULL;
hr = m_pDxDiagProvider->Initialize(&dxDiagInitParam);
if (FAILED(hr))
{
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
hr = m_pDxDiagProvider->GetRootContainer(&m_pDxDiagRoot);
if (FAILED(hr) || m_pDxDiagRoot == NULL)
{
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
IDxDiagContainer* pObject = NULL;
hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_SystemInfo", &pObject);
if (FAILED(hr) || pObject == NULL)
{
m_pDxDiagRoot->Release();
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
TCHAR m_szDirectXVersionLongEnglish[100];
TCHAR m_szOSLocalized[100];
TCHAR m_szProcessorEnglish[200];
TCHAR m_szSystemManufacturerEnglish[200];
ZeroMemory(m_szDirectXVersionLongEnglish, sizeof(TCHAR) * 100);
ZeroMemory(m_szOSLocalized, sizeof(TCHAR) * 100);
ZeroMemory(m_szProcessorEnglish, sizeof(TCHAR) * 200);
ZeroMemory(m_szSystemManufacturerEnglish, sizeof(TCHAR) * 200);
GetStringValue( pObject, L"szDirectXVersionLongEnglish",
EXPAND(m_szDirectXVersionLongEnglish) );
GetStringValue(pObject, L"szOSLocalized", EXPAND(m_szOSLocalized) );
GetStringValue(pObject, L"szProcessorEnglish", EXPAND(m_szProcessorEnglish) );
GetStringValue( pObject, L"szSystemManufacturerEnglish",
EXPAND(m_szSystemManufacturerEnglish) );
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"System Manufacturer --- %s",
m_szSystemManufacturerEnglish);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Processor --- %s", m_szProcessorEnglish);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Operating System --- %s", m_szOSLocalized);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"DirectX Version --- %s",
m_szDirectXVersionLongEnglish);
if (pObject)
pObject->Release();
struct DisplayInfo
{
TCHAR m_szDescription[200];
TCHAR m_szManufacturer[200];
TCHAR m_szChipType[100];
TCHAR m_szDisplayMemoryEnglish[100];
TCHAR m_szDisplayModeEnglish[100];
TCHAR m_szDriverName[100];
TCHAR m_szDriverVersion[100];
TCHAR m_szDDStatusEnglish[100];
TCHAR m_szD3DStatusEnglish[100];
BOOL m_bDDAccelerationEnabled;
BOOL m_bNoHardware;
BOOL m_b3DAccelerationExists;
BOOL m_b3DAccelerationEnabled;
};
WCHAR wszContainer[256];
IDxDiagContainer* pContainer = NULL;
DWORD nInstanceCount = 0;
DWORD nItem = 0;
DWORD nCurCount = 0;
// Get the IDxDiagContainer object called "DxDiag_DisplayDevices".
// This call may take some time while dxdiag gathers the info.
if (FAILED(hr = m_pDxDiagRoot->GetChildContainer(L"DxDiag_DisplayDevices",
&pContainer)))
{
m_pDxDiagRoot->Release();
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
if (FAILED(hr = pContainer->GetNumberOfChildContainers(&nInstanceCount)))
{
pContainer->Release();
m_pDxDiagRoot->Release();
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
DisplayInfo *pDisplayInfo = new DisplayInfo;
if (pDisplayInfo == NULL)
return;
ZeroMemory(pDisplayInfo, sizeof(DisplayInfo));
hr = pContainer->EnumChildContainerNames(nItem, wszContainer, 256);
if (FAILED(hr))
{
delete pDisplayInfo;
pContainer->Release();
m_pDxDiagRoot->Release();
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
hr = pContainer->GetChildContainer(wszContainer, &pObject);
if (FAILED(hr) || pObject == NULL)
{
delete pDisplayInfo;
pContainer->Release();
m_pDxDiagRoot->Release();
m_pDxDiagProvider->Release();
if (coUninitializeIsRequired)
CoUninitialize();
return;
}
GetStringValue( pObject, L"szDescription",
EXPAND(pDisplayInfo->m_szDescription) );
GetStringValue( pObject, L"szManufacturer",
EXPAND(pDisplayInfo->m_szManufacturer) );
GetStringValue(pObject, L"szChipType", EXPAND(pDisplayInfo->m_szChipType) );
GetStringValue( pObject, L"szDisplayMemoryEnglish",
EXPAND(pDisplayInfo->m_szDisplayMemoryEnglish) );
GetStringValue( pObject, L"szDisplayModeEnglish",
EXPAND(pDisplayInfo->m_szDisplayModeEnglish) );
GetStringValue( pObject, L"szDriverName",
EXPAND(pDisplayInfo->m_szDriverName) );
GetStringValue( pObject, L"szDriverVersion",
EXPAND(pDisplayInfo->m_szDriverVersion) );
GetBoolValue(pObject, L"bDDAccelerationEnabled",
&pDisplayInfo->m_bDDAccelerationEnabled);
GetBoolValue(pObject, L"bNoHardware", &pDisplayInfo->m_bNoHardware);
GetBoolValue(pObject, L"bDDAccelerationEnabled",
&pDisplayInfo->m_bDDAccelerationEnabled);
GetBoolValue(pObject, L"b3DAccelerationExists",
&pDisplayInfo->m_b3DAccelerationExists);
GetBoolValue(pObject, L"b3DAccelerationEnabled",
&pDisplayInfo->m_b3DAccelerationEnabled);
GetStringValue( pObject, L"szDDStatusEnglish",
EXPAND(pDisplayInfo->m_szDDStatusEnglish));
GetStringValue( pObject, L"szD3DStatusEnglish",
EXPAND(pDisplayInfo->m_szD3DStatusEnglish));
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Device Name --- %s",
pDisplayInfo->m_szDescription);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Device Manufacturer --- %s",
pDisplayInfo->m_szManufacturer);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Device ChipType --- %s",
pDisplayInfo->m_szChipType);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Approx. Total Device Memory --- %s",
pDisplayInfo->m_szDisplayMemoryEnglish);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Current Display Mode --- %s",
pDisplayInfo->m_szDisplayModeEnglish);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Device Driver Name --- %s",
pDisplayInfo->m_szDriverName);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"Device Driver Version --- %s",
pDisplayInfo->m_szDriverVersion);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"DirectDraw Acceleration Enabled --- %s",
pDisplayInfo->m_szDescription ? "Enabled" : "Disabled");
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"bNoHardware --- %s",
pDisplayInfo->m_bNoHardware ? "Enabled" : "Disabled");
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"b3DAccelerationExists Enabled --- %s",
pDisplayInfo->m_b3DAccelerationExists ? "Enabled" : "Disabled");
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"b3DAccelerationEnabled Enabled --- %s",
pDisplayInfo->m_b3DAccelerationEnabled ? "Enabled"
: "Disabled");
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"DDraw Status --- %s",
pDisplayInfo->m_szDDStatusEnglish);
WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, -1,
"D3D Status --- %s",
pDisplayInfo->m_szD3DStatusEnglish);
// Get OS version
OSVERSIONINFOEX osvie;
osvie.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
GetVersionEx((LPOSVERSIONINFO) & osvie);
/*
Operating system Version number dwMajorVersion dwMinorVersion
Windows 7 6.1 6 1
Windows Server 2008 R2 6.1 6 1
Windows Server 2008 6.0 6 0
Windows Vista 6.0 6 0
Windows Server 2003 R2 5.2 5 2
Windows Server 2003 5.2 5 2
Windows XP 5.1 5 1
Windows 2000 5.0 5 0
*/
//RDP problem exists only when XP is involved
if (osvie.dwMajorVersion < 6)
{
WEBRTC_TRACE(kTraceStateInfo, kTraceVideoRenderer, _id,
"Checking for RDP driver");
if (_tcsncmp(pDisplayInfo->m_szDriverName, _T("RDPDD.dll"), 9) == 0)
{
//
}
}
if (pObject)
{
pObject->Release();
pObject = NULL;
}
if (pContainer)
pContainer->Release();
if (m_pDxDiagProvider)
m_pDxDiagProvider->Release();
if (m_pDxDiagRoot)
m_pDxDiagRoot->Release();
if (pDisplayInfo)
delete pDisplayInfo;
if (coUninitializeIsRequired)
CoUninitialize();
#endif
return;
}