Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Locked MPIO DSM for Windows Server 2008 R2

  • Tuesday, April 20, 2010 8:24 PM
     
     

    I have been trying to get my DSM driver to load on Windows Server 2008 R2. I followed all the instructions using the current sample Microsoft DSM from the Windows Driver Kit (WDK 7600.16385.1). The driver installs properly however it fails during DriverEntry when I call IoGetDeviceObjectPointer. I have written multiple DSMs for previous Windows operating systems and this function call has been the same in all samples as well as my DSM drivers. The IoGetDeviceObjectPointer function is attempting to get a device object pointer to the object name \\DosDevices\\MPIOControl. The error  code returned is

    STATUS_OBJECT_NAME_NOT_FOUND

    Has anyone encountered this condition? Below is the exact code I am using.

    NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath )

    {

    PDSM_CONTEXT dsmContext = NULL;

    PFILE_OBJECT fileObject;

    WCHAR dosDeviceName[64] = L

    "\\DosDevices\\MPIOControl";

    UNICODE_STRING mpUnicodeName;

    NTSTATUS status = STATUS_SUCCESS;

    MPIO_VERSION_INFO versionInfo = {0};

    DSM_TYPE dsmMode = DsmType3;

    DSM_MPIO_CONTEXT mpctlContext;

    IO_STATUS_BLOCK ioStatus;

    ......

     

        //

     

       // Build the mpio symbolic link name.

     

       //

       RtlInitUnicodeString( &mpUnicodeName, NULL );

       mpUnicodeName.MaximumLength =

    sizeof(dosDeviceName) + sizeof (UNICODE_NULL);

       mpUnicodeName.Buffer = DsmpAllocatePool( NonPagedPool, mpUnicodeName.MaximumLength, DSM_TAG_DEV_NAME );

     

       //

     

      // Make sure we have memory allocated for buffer section of the unicode string

     

      //

     

      if( mpUnicodeName.Buffer == NULL ) {

         status = STATUS_UNSUCCESSFUL;

     

         goto __Exit_DriverEntry;

       }

    RtlZeroMemory( mpUnicodeName.Buffer, mpUnicodeName.MaximumLength);

    RtlAppendUnicodeToString( &mpUnicodeName, dosDeviceName);

    RtlAppendUnicodeToString( &mpUnicodeName, UNICODE_NULL);

     

    //

     

    // Get a pointer to mpio's deviceObject.

     

    //

    status = IoGetDeviceObjectPointer(&mpUnicodeName,

    FILE_READ_ATTRIBUTES,

    &fileObject,

    &gMPIOControlObject);

     

    if (!NT_SUCCESS(status)) {

    TracePrint((TRACE_LEVEL_FATAL,

    TRACE_FLAG_INIT,

     

    "DriverEntry (DrvObj %p): Failed to communicate with MPIO control object. Status %x.\n",

    DriverObject,

    status));

     

    if ( status == STATUS_OBJECT_TYPE_MISMATCH ) {

    DbgPrint(

    "STATUS_OBJECT_TYPE_MISMATCH\n" );

    }

     

    else if (status == STATUS_INVALID_PARAMETER ) {

    DbgPrint(

    "STATUS_INVALID_PARAMETER\n" );

    }

     

    else if( status == STATUS_PRIVILEGE_NOT_HELD ) {

    DbgPrint(

    "STATUS_PRIVILEGE_NOT_HELD\n" );

    }

     

    else if( status == STATUS_INSUFFICIENT_RESOURCES ) {

    DbgPrint(

    "STATUS_INSUFFICIENT_RESOURCES\n" );

    }

     

    else if( status == STATUS_OBJECT_NAME_INVALID ) {

    DbgPrint(

    "STATUS_OBJECT_NAME_INVALID\n" );

    }

     

    else if( status == STATUS_OBJECT_NAME_NOT_FOUND ) {

    DbgPrint(

    "STATUS_OBJECT_NAME_NOT_FOUND\n" );

    }

    }

    ......

    return status;

    }