Hi All,
I’m developing a PCI video card driver based on WDK6000.
In App, I Created a DirectDraw object[m_lpDD2] and a DirectDrawSurface object[m_pOverlayOffback].
Then I get the physical address of the surface memory[called function MmGetPhysicalAddress],
It[the physical address] is a parameter to do video preview.
Error happens:
When Our Graphics is Nvidia Series and OS is Vista,blue screen happend when I do video preview.
But when OS is XP or Our Graphics is ATI Series,no error happened,
I can do video preview and our video card works properly.
I updated the latest Nvidia Graphics driver in Vista,error happened also.
Then I traced the “physicalAddr” in XP and Vista used the same Nvidia Graphics to do video preview.
Found that In XP “physicalAddr” is somthing like “0xc030e000”,in Vista it is somthing like “0x13f9f000”.
I opend “Device Manager->Display adapters->Nvidia Grahics”,choose “Properties->Resources”,
it shows “Memory Range C0000000-CFFFFFFF”.
So I guessed:In XP,“0xc030e000”[physicalAddr] is between “C0000000” and “CFFFFFFF”.
In Vista,“0x13f9f000” is not in the range,“physicalAddr” is illegal so blue screen happend.
Is my guess reasonable?
How can I do to help to solve this problem?
Any help is appreciated.Thanks.
Best Regards
Zhou ChengJun
Related to the code below[Simplify]:
LPDIRECTDRAW7 m_lpDD2 ;
DDSURFACEDESC2 ddsd;
LPDIRECTDRAWSURFACE7 m_pOverlayOffback;
ULONG m_nVirtualAddress;
UINT physicalAddr;
App:
…
DirectDrawCreateEx(NULL, (void **)&m_lpDD2, IID_IDirectDraw7,NULL);
…
memset((&ddsd),sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
…
m_lpDD2->CreateSurface(&ddsd, &m_pOverlayOffback,NULL)
m_pOverlayOffback->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL)
m_nVirtualAddress = (ULONG)ddsd.lpSurface;
…
MapVirtualAddrToPhysicalAddr(m_nVirtualAddress,physicalAddr);
//defined DeviceIoControl
Driver[IOCTL]:
physicalAddr = MmGetPhysicalAddress((void *)m_nVirtualAddress).LowPart;
…