i want to open physical disk to read MBR form and write something in here.But this disk have minifilter so i decide use FltCreateFile to open this disk. But i try use \\.\PhysicalDrive1 to path parameter the return status is STATUS_OBJECT_NAME_INVALID,and i try to use ??\PhysicalDrive1 or “\Device\Harddisk1\DR2” the return status is STATUS_INVALID_DEVICE_OBJECT_PARAMETER .could you help me
my code is here .When i set bypassThreadID and use zwcreateFile i can open the phydisk
` g_dwBypassThreadID = PsGetCurrentThreadId();
InitializeObjectAttributes(&oa, &pInstanceContext->ustrPhyDeviceName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, 0, 0);
ntStatus = ZwCreateFile(&hFileHandle, GENERIC_READ | GENERIC_WRITE, &oa, &IoStatus, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);
g_dwBypassThreadID = 0;
if (STATUS_SUCCESS != ntStatus)
{
break;
}
if (hFileHandle != NULL)
{
ZwClose(hFileHandle);
hFileHandle = NULL;
}
InitializeObjectAttributes(&oa, &pInstanceContext->ustrPhyDeviceName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, 0, 0);
ntStatus = FltCreateFileEx(g_pFilterObj, pRetInstance, &hFileHandle, &pFileObject, GENERIC_READ | GENERIC_WRITE, &oa, &IoStatus, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT | FILE_WRITE_THROUGH | FILE_NO_INTERMEDIATE_BUFFERING, NULL, 0, 0);//
if (STATUS_SUCCESS != ntStatus)
{
break;
}`