-1

I am trying to run a custom made kernel mode driver on a windows 7(64 bit) machine. The driver service was started but the IO control request returns error.

DeviceIoControl(hDevice, OPEN_PHYSICAL_MEMORY, NULL, 0, ph, sizeof(HANDLE), cb, NULL)

and #define OPEN_PHYSICAL_MEMORY __CTL_CODE(0x8124, 0x801, 0, FILE_READ_DATA ).

The getlasterror() returns error code 24.

ERROR_BAD_LENGTH

24 (0x18)

The program issued a command but the command length is incorrect.

The function runs perfectly in 32 bit OS. Please help me to solve this error.

Thank you.

shijin
  • 51
  • 1
  • 10

1 Answers1

0

sizeof(HANDLE) - this is 4 byte for 32bit app, but from 64bit driver view - this is 8 byte. here and error

RbMm
  • 31,280
  • 3
  • 35
  • 56