C4028 for CmRegisterCallback

LARGE_INTEGER CallbackId;
NTSTATUS RegistryCallback(IN PVOID Context,IN REG_NOTIFY_CLASS RegNotifyClass,IN PVOID Param);

NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegPath)
{
:
:
status = CmRegisterCallback(RegistryCallback,NULL,&CallbackId);
}

For the above code, i am getting:
“error C4028: formal parameter 2 different from declaration”
for line CmRegisterCallback(…)

CmUnRegisterCallback is ok.

I am using W2k3 Free build.

any clue why?

There is difference in definition for callback function between DDK headers and DDK help,

in wdm.h:

typedef NTSTATUS (*PEX_CALLBACK_FUNCTION ) (
IN PVOID CallbackContext,
IN PVOID Argument1,
IN PVOID Argument2
);

ih DDK help:

NTSTATUS
RegistryCallback(
IN PVOID CallbackContext,
IN REG_NOTIFY_CLASS Argument1,
IN PVOID Argument2
);

As you can see second parameters in this definitions are different.

“Mani” wrote in message news:xxxxx@ntfsd…
LARGE_INTEGER CallbackId;
NTSTATUS RegistryCallback(IN PVOID Context,IN REG_NOTIFY_CLASS RegNotifyClass,IN PVOID Param);

NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegPath)
{
:
:
status = CmRegisterCallback(RegistryCallback,NULL,&CallbackId);
}

For the above code, i am getting:
“error C4028: formal parameter 2 different from declaration”
for line CmRegisterCallback(…)

CmUnRegisterCallback is ok.

I am using W2k3 Free build.

any clue why?

Thanks a lot, that helped.

Mani

“Slava Imameyev” wrote in message news:xxxxx@ntfsd…
There is difference in definition for callback function between DDK headers and DDK help,

in wdm.h:

typedef NTSTATUS (*PEX_CALLBACK_FUNCTION ) (
IN PVOID CallbackContext,
IN PVOID Argument1,
IN PVOID Argument2
);

ih DDK help:

NTSTATUS
RegistryCallback(
IN PVOID CallbackContext,
IN REG_NOTIFY_CLASS Argument1,
IN PVOID Argument2
);

As you can see second parameters in this definitions are different.

“Mani” wrote in message news:xxxxx@ntfsd…
LARGE_INTEGER CallbackId;
NTSTATUS RegistryCallback(IN PVOID Context,IN REG_NOTIFY_CLASS RegNotifyClass,IN PVOID Param);

NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegPath)
{
:
:
status = CmRegisterCallback(RegistryCallback,NULL,&CallbackId);
}

For the above code, i am getting:
“error C4028: formal parameter 2 different from declaration”
for line CmRegisterCallback(…)

CmUnRegisterCallback is ok.

I am using W2k3 Free build.

any clue why?