About Virtual Display Driver on Windows 7

Hello,
I have a issue for my virtual dispaly driver on windows 7.
I is happened when I try to attach it to extend desktop by ChangeDisplaySettingsEx, the code is the follow lines
lResult = ChangeDisplaySettingsEx(deviceName,&devmode, NULL, CDS_GLOBAL|CDS_UPDATEREGISTRY,NULL);
It works well on Windows XP.

The follow lines are the information about this issue,

*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************

Unknown bugcheck code (0)
Unknown bugcheck description
Arguments:
Arg1: 00000000
Arg2: 00000000
Arg3: 00000000
Arg4: 00000000

Debugging Details:

PROCESS_NAME: dwm.exe

FAULTING_IP:
win32k!MulConvertChildRedirectionDfbSurfaceToDib+38
95b4c3a8 f6404c01 test byte ptr [eax+4Ch],1

EXCEPTION_RECORD: ffffffff – (.exr 0xffffffffffffffff)
ExceptionAddress: 95b4c3a8 (win32k!MulConvertChildRedirectionDfbSurfaceToDib+0x00000038)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 0000003c
Attempt to read from address 0000003c

ERROR_CODE: (NTSTATUS) 0xc0000005 - “0x%08lx”

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - “0x%08lx”

EXCEPTION_PARAMETER1: 00000000

EXCEPTION_PARAMETER2: 0000003c

READ_ADDRESS: 0000003c

FOLLOWUP_IP:
win32k!MulConvertChildRedirectionDfbSurfaceToDib+38
95b4c3a8 f6404c01 test byte ptr [eax+4Ch],1

BUGCHECK_STR: ACCESS_VIOLATION

DEFAULT_BUCKET_ID: NULL_CLASS_PTR_DEREFERENCE

CURRENT_IRQL: 0

LAST_CONTROL_TRANSFER: from 95a911d9 to 95b4c3a8

STACK_TEXT:
974e8c78 95a911d9 00000001 01050979 8567baa8 win32k!MulConvertChildRedirectionDfbSurfaceToDib+0x38
974e8c8c 95a909f5 fe427b58 00000000 95b899c4 win32k!pConvertDfbSurfaceToDib+0x36
974e8cb8 95a980f7 ffb71748 876c6390 00000000 win32k!bDynamicRemoveAllDriverRealizations+0x49
974e8cd0 95a95974 ffb71748 00000000 95a98607 win32k!GreRemoveDisplayDriverRealizations+0x15e
974e8cf0 95a95810 876c6390 00001944 0153f780 win32k!zzzDecomposeDesktop+0xdb
974e8d1c 95a98648 876c6390 00000000 0153f738 win32k!xxxDwmStopRedirection+0x51
974e8d2c 82a5544a 0153f780 76ec64f4 badb0d00 win32k!NtUserDwmStopRedirection+0x41
974e8d2c 76ec64f4 0153f780 76ec64f4 badb0d00 nt!KiFastCallEntry+0x12a
WARNING: Stack unwind information not available. Following frames may be wrong.
0153f780 00087aac 00094228 00000000 00000000 ntdll!KiFastSystemCallRet
0153f798 00087a6b 00000000 00000001 00000001 Dwm!CRedirectionState::StopRedirection+0x17
0153f7a8 00087a42 00094228 00000000 00000000 Dwm!CRedirectionState::RestartTransportAndRedirection+0x15
0153f7b8 00087a18 00094228 80000000 00094228 Dwm!CRedirectionState::RestartRedirection+0x16
0153f7c8 0008268a 00094a50 00000000 00000000 Dwm!CRedirectionState::HandlePolicyOrModeChange+0xde
0153f7e0 00082983 00094228 00000000 00000000 Dwm!CRedirectionState::ProcessInput+0x141
0153f7f8 00082bb0 00000000 00000000 00240b08 Dwm!CSessionPort::SwitchRedirectionState+0x32
0153f818 0008785d 00240b08 00000000 00000000 Dwm!CDwmAppHost::ProcessModeChange+0x96
0153f830 000877dc 00094ee8 00240af0 00094228 Dwm!CDwmAppHost::OnDisplayChange+0xf9
0153f884 00081719 00094228 00240af0 00000000 Dwm!CRedirectionState::ProcessCommand+0x2c6
0153f8b4 000818d1 00240af0 00000000 000941c8 Dwm!CSessionPort::ProcessCommand+0x1e3
0153f8d4 000815d0 00000000 0153f910 00094f60 Dwm!CPortBase::InternalProcessCommand+0x56
0153f8f0 00081577 00000000 0153f910 00000000 Dwm!CPortBase::RoutePacket+0x52
0153f91c 000852be 000941c8 0153f934 756e1194 Dwm!CPortBase::PortThreadInternal+0xa9
0153f928 756e1194 000941c8 0153f974 76edb495 Dwm!CPortBase::PortThread+0xe
0153f934 76edb495 000941c8 77a788f1 00000000 kernel32!BaseThreadInitThunk+0xe
0153f974 76edb468 000852b0 000941c8 00000000 ntdll!RtlInitializeExceptionChain+0x63
0153f98c 00000000 000852b0 000941c8 00000000 ntdll!RtlInitializeExceptionChain+0x36

STACK_COMMAND: kb

SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: win32k!MulConvertChildRedirectionDfbSurfaceToDib+38

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: win32k

IMAGE_NAME: win32k.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 4c1c425a

FAILURE_BUCKET_ID: ACCESS_VIOLATION_win32k!MulConvertChildRedirectionDfbSurfaceToDib+38

BUCKET_ID: ACCESS_VIOLATION_win32k!MulConvertChildRedirectionDfbSurfaceToDib+38

Followup: MachineOwner

The follow lines are the disassambly about MulConvertChildRedirectionDfbSurfaceToDib,

win32k!MulConvertChildRedirectionDfbSurfaceToDib:
95b4c370 8bff mov edi,edi
95b4c372 55 push ebp
95b4c373 8bec mov ebp,esp
95b4c375 51 push ecx
95b4c376 53 push ebx
95b4c377 56 push esi
95b4c378 57 push edi
95b4c379 ff7508 push dword ptr [ebp+8]
95b4c37c 33db xor ebx,ebx
95b4c37e 8d4dfc lea ecx,[ebp-4]
95b4c381 895dfc mov dword ptr [ebp-4],ebx
95b4c384 e8a590e7ff call win32k!SURFREF::vAltLock (959c542e)
95b4c389 8b45fc mov eax,dword ptr [ebp-4]
95b4c38c 8b7010 mov esi,dword ptr [eax+10h]
95b4c38f 8b3e mov edi,dword ptr [esi]
95b4c391 c7450801000000 mov dword ptr [ebp+8],1
95b4c398 395f08 cmp dword ptr [edi+8],ebx
95b4c39b 7629 jbe win32k!MulConvertChildRedirectionDfbSurfaceToDib+0x56 (95b4c3c6)
95b4c39d 8b4604 mov eax,dword ptr [esi+4]
95b4c3a0 ff3498 push dword ptr [eax+ebx*4]
95b4c3a3 e8c4ffefff call win32k!SURFOBJ_TO_SURFACE_NOT_NULL (95a4c36c)
95b4c3a8 f6404c01 test byte ptr [eax+4Ch],1 ds:0023:0000003c=?? <<--------- Error in here, because the return value of the SURFOBJ_TO_SURFACE_NOT_NULL is 0xfffffff0(eax is 0xfffffff0).
95b4c3ac 740c je win32k!MulConvertChildRedirectionDfbSurfaceToDib+0x4a (95b4c3ba)
95b4c3ae 6a01 push 1
95b4c3b0 50 push eax

Who can tell me the reason or give the some suggestion. Thank you

Allen