This code should invalidate the cached partition table and re-enumerate the
device so that this operation is used in synchronizing the system view of
the specified disk device when the partition table of the disk is directly

I have two hard disks, disk 0 and 1. F drive is on disk 1. I tried two

  1. \.\F <file:> :
    2) \\.\PhysicalDrive1
    Using Createfile to get the handle, I call the
    bResult = DeviceIoControl(hDevice, // handle to device


    NULL, // lpInBuffer

    0, // nInBufferSize

    NULL, // lpOutBuffer

    0, // nOutBufferSize

    &returnLength, // lpBytesReturned


    In the first case, I get error of wrong parameters. In the second case, I
    succeeded partially. Although I directly updated the meta data of F drive,
    the file explore of WinXP didn’t see that change. That means the cached
    partition talbe on F drive didn’t update.

    If that method didn’t work, can I use oplock level 2 to do so in the kernel
    mode via a file filter? According to the doc of oplock level 2, it should

    Appreciate any help.


    This email has been scanned for all viruses by the MessageLabs SkyScan
    service. For more information on a proactive anti-virus service working
    around the clock, around the globe, visit http://www.messagelabs.com