0
我有使用DeviceIOControl
把128字节的缓冲区,以我的驱动程序有问题,我用这个代码:的DeviceIoControl与输入的无符号字符缓冲区C++
int Initialize(unsigned char* public_signature, int size)
{
int ret = DeviceIoControl(
DeviceFileHandle,
2236440,
public_signature,
size,
NULL,
0,
NULL,
NULL);
if(ret != 0)
return 0;
wprintf(L"Format message failed with 0x%x\n", GetLastError()); // always error 0x6!
return 1;
}
我总是为0x6的错误,我在做什么错?
UPD 我把手创建功能:
int CreateFileHandle()
{
DeviceFileHandle = CreateFile(L"\Device\test",
GENERIC_WRITE,
GENERIC_READ | GENERIC_WRITE,
NULL,
OPEN_EXISTING,
0,
0);
if(DeviceFileHandle)
return 0;
return 1;
}