I hook the NtGdiBitBlt from shadowSSDT,in other OS(win2K,winXP,vista) is OK.
On win7(x86),it also OK in a lot of situations,but sometimes it will BSOD.
My NewNtGdiBitBlt is very simple:
DWORD NewNtGdiBitBlt(
HANDLE hDCDest,int XDest,int YDest,int Width,int Height,
HANDLE hDCSrc,int XSrc,int YSrc,
DWORD ROP,DWORD crBackColor,DWORD fl)
{
return ((NTGDIBITBLT)(OldNtGdiBitBlt)) (
hDCDest, XDest, YDest, Width, Height,
hDCSrc, XSrc, YSrc, ROP|CAPTUREBLT,
crBackColor,fl );
}
In my test,when BSOD,the hDCDest and hDCSrc both are DT_RASDISPLAY,and the hDCDest==hDCSrc.
1: kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
KERNEL_MODE_EXCEPTION_NOT_HANDLED (8e)
This is a very common bugcheck. Usually the exception address pinpoints
the driver/function that caused the problem. Always note this address
as well as the link date of the driver/image that contains this address.
Some common problems are exception code 0x80000003. This means a hard
coded breakpoint or assertion was hit, but this system was booted
/NODEBUG. This is not supposed to happen as developers should never have
hardcoded breakpoints in retail code, but …
If this happens, make sure a debugger gets connected, and the
system is booted /DEBUG. This will let us see why this breakpoint is
happening.
Arguments:
Arg1: c0000046, The exception code that was not handled
Arg2: 83e5b8f8, The address that the exception occurred at
Arg3: 9bf67618, Trap Frame
Arg4: 00000000
Debugging Details:
Page 60ea9 not present in the dump file. Type “.hh dbgerr004” for details
*** ERROR: Module load completed but symbols could not be loaded for LMEFS.sys
PEB is paged out (Peb.Ldr = 7ffdf00c). Type “.hh dbgerr001” for details
PEB is paged out (Peb.Ldr = 7ffdf00c). Type “.hh dbgerr001” for details
EXCEPTION_CODE: (NTSTATUS) 0xc0000046 -
FAULTING_IP:
nt!KeReleaseMutant+215
83e5b8f8 cc int 3
TRAP_FRAME: 9bf67618 – (.trap 0xffffffff9bf67618)
ESP EDITED! New esp=9bf679c8
ErrCode = 00000000
eax=c0000046 ebx=89a9c578 ecx=899b0b00 edx=00000000 esi=899b0b38 edi=00000000
eip=83e5b8f8 esp=9bf6768c ebp=9bf67a00 iopl=0 nv up ei ng nz na po nc
cs=0000 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000282
nt!KeReleaseMutant+0x215:
83e5b8f8 cc int 3
Resetting default scope
DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT
BUGCHECK_STR: 0x8E
PROCESS_NAME: irsetup.exe
CURRENT_IRQL: 0
LAST_CONTROL_TRANSFER: from 83ed8382 to 83ef7d10
STACK_TEXT:
9bf67114 83ed8382 0000008e c0000046 83e5b8f8 nt!KeBugCheckEx+0x1e
9bf67534 83e4db08 9bf6796c 00000000 9bf67618 nt!KiDispatchException+0x1ac
9bf675e8 83e61fe7 9bf6796c 9bf6769c 00000000 nt!KiRaiseException+0x185
9bf67604 83e5e44a 9bf6796c 9bf6769c 00000000 nt!NtRaiseException+0x33
9bf67604 83e5b8f8 9bf6796c 9bf6769c 00000000 nt!KiFastCallEntry+0x12a
9bf67a00 83e5b6da 899b0b38 00000001 00000000 nt!KeReleaseMutant+0x215
9bf67a18 9b02ed93 899b0b38 00000000 9b02d2a5 nt!KeReleaseMutex+0x14
9bf67a24 9b02d2a5 ffb93748 9aff0aa9 00000000 win32k!W32PIDLOCK::vUnlockSingleThread+0xf
9bf67a2c 9aff0aa9 00000000 fda6f728 180108f6 win32k!SURFACE::bUnMap+0x1b
9bf67ba0 9b04c5e2 180108f6 00000017 00000003 win32k!GreStretchBltInternal+0x3fb
9bf67c98 9b034e1e 180108f6 00000017 00000003 win32k!NtGdiBitBltInternal+0x52
9bf67ccc 8c22535d 180108f6 00000017 00000003 win32k!NtGdiBitBlt+0x2f
WARNING: Stack unwind information not available. Following frames may be wrong.
9bf67d00 83e5e44a 180108f6 00000017 00000003 MyTestHook+0xa35d
9bf67d00 771364f4 180108f6 00000017 00000003 nt!KiFastCallEntry+0x12a
0012f0b0 00000000 00000000 00000000 00000000 0x771364f4
-----------------------------------------------------------
//
// MessageId: STATUS_MUTANT_NOT_OWNED
//
// MessageText:
//
// An attempt to release a mutant object was made by a thread that was not the owner of the mutant object.
//
#define STATUS_MUTANT_NOT_OWNED ((NTSTATUS)0xC0000046L)
-----------------------------------------------------------
anybody can clear it?thanks.
And what should I do?I’m crazy ~~~~~