CmUnRegisterCallback hangs...

Hi,

Introduction:
*********************
I am writing some kind of registry monitoring tool, this tool uses
CmRegisterCallback/CmUnRegisterCallback API to hook to the registry ( WinXP and above )

Problem description:
*****************************
Calling CmUnRegisterCallback hangs, I wonder… what may cause this problem?.. CmUnRegisterCallback is being called in the following flow:

  1. Usermode call to DeviceIoControl
  2. Inter-driver call to IoBuildDeviceIoControlRequest and IoCallDriver
  3. CmUnRegisterCallback call in the context of IRP_MJ_INTERNAL_DEVICE_CONTROL

CmRegisterCallback documentation notes that: “Callers of CmUnregisterCallback must be running at IRQL <= APC_LEVEL”, the CmUnRegisterCallback call was initially triggered by a user-mode call to ‘DeviceIoControl’, doesn’t it mean that the CmUnRegisterCallback call is executed at PASSIVE_LEVEL < APC_LEVEL ??? If indeed my assumption is true, what else may cause shuch a problem ???

Many ThanX
Nadav.


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com