none
Problem with IoRegisterDeviceInterface RRS feed

  • Question

  • Hello,

    I should use IoRegisterDeviceInterface  for mountmgr work on my disk filesystem.

    HOW SETTED DeviceNode on my DeviceObject DCB disk file system ????
        PDEVOBJ_EXTENSION DeviceObjectExtension = (PDEVOBJ_EXTENSION)dev->DeviceObjectExtension;    
    /* 1st level: Presence of a Device Node */   
     if (DeviceObjectExtension->DeviceNode == NULL)   
     {        KdPrintfd2(("PhysicalDeviceObject 0x%p doesn't have a DeviceNode\n", dev));  
          return;    }



       
    
    NTSTATUS VDFSRegisterMountedDeviceInterface
    (__in PDEVICE_OBJECT DeviceObject,
        __in PPARAMVDF Dcb) {
        NTSTATUS status;
        UNICODE_STRING interfaceName;
        KdPrintfd2(("=> VDFSRegisterMountedDeviceInterface\n"));
    
        KdPrintfd2(("DeviceObject:"));
        KdCheckInterface(DeviceObject);
    
        status = IoRegisterDeviceInterface(
            DeviceObject, &MOUNTDEV_MOUNTED_DEVICE_GUID, NULL, &interfaceName);
    
        if (NT_SUCCESS(status)) {
            KdPrintfd2(("  InterfaceName:%wZ\n", &interfaceName));
    
            Dcb->MountedDeviceInterfaceName = interfaceName;
            status = IoSetDeviceInterfaceState(&interfaceName, TRUE);
    
            if (!NT_SUCCESS(status)) {
                KdPrintfd2(("  IoSetDeviceInterfaceState failed: 0x%x\n", status));
                RtlFreeUnicodeString(&interfaceName);
            }
        }
        else {
            KdPrintfd2(("  IoRegisterDeviceInterface failed: 0x%x\n", status));
        }
    
        if (!NT_SUCCESS(status)) {
            RtlInitUnicodeString(&(Dcb->MountedDeviceInterfaceName), NULL);
        }
        KdPrintfd2(("<= VDFSRegisterMountedDeviceInterface\n"));
        return status;
    }
    
    NTSTATUS
    VDFSRegisterDeviceInterface(__in PDRIVER_OBJECT DriverObject,
        __in PDEVICE_OBJECT DeviceObject,
        __in PPARAMVDF Dcb) {
        PDEVICE_OBJECT pnpDeviceObject = NULL;
        NTSTATUS status;
        KdPrintfd2(("=> VDFSRegisterDeviceInterface\n"));
    
        status = IoReportDetectedDevice(DriverObject, InterfaceTypeUndefined, 0, 0,
            NULL, NULL, FALSE, &pnpDeviceObject);
        pnpDeviceObject->DeviceExtension = Dcb;
        if (NT_SUCCESS(status)) {
            KdPrintfd2(("  IoReportDetectedDevice success\n"));
        }
        else {
            KdPrintfd2(("  IoReportDetectedDevice failed: 0x%x\n", status));
            return status;
        }
        PDEVICE_OBJECT pdattach = IoAttachDeviceToDeviceStack(pnpDeviceObject, DeviceObject);
        KdPrintfd2(("IoAttachDeviceToDeviceStack return :%x %x %x\n", pdattach, pnpDeviceObject, DeviceObject));
        if (pdattach != NULL) {
            KdPrintfd2(("pdattach:"));
            KdCheckInterface(pdattach);
            KdPrintfd2(("  IoAttachDeviceToDeviceStack success\n"));
        }
        else {
            KdPrintfd2(("  IoAttachDeviceToDeviceStack failed\n"));
        }
    
        status = IoRegisterDeviceInterface(pnpDeviceObject, &GUID_DEVINTERFACE_DISK,
            NULL, &Dcb->DiskDeviceInterfaceName);
    
        if (NT_SUCCESS(status)) {
            KdPrintfd2(("  IoRegisterDeviceInterface success: %wZ\n",
                &Dcb->DiskDeviceInterfaceName));
        }
        else {
            RtlInitUnicodeString(&Dcb->DiskDeviceInterfaceName, NULL);
            KdPrintfd2(("  IoRegisterDeviceInterface failed: 0x%x\n", status));
            return status;
        }
    
        status = IoSetDeviceInterfaceState(&Dcb->DiskDeviceInterfaceName, TRUE);
    
        if (NT_SUCCESS(status)) {
            KdPrintfd2(("  IoSetDeviceInterfaceState success\n"));
        }
        else {
            KdPrintfd2(("  IoSetDeviceInterfaceState failed: 0x%x\n", status));
            return status;
        }
    
        status =
            IoRegisterDeviceInterface(pnpDeviceObject, &MOUNTDEV_MOUNTED_DEVICE_GUID,
                NULL, &Dcb->MountedDeviceInterfaceName);
    
        if (NT_SUCCESS(status)) {
            KdPrintfd2(("  IoRegisterDeviceInterface success: %wZ\n",
                &Dcb->MountedDeviceInterfaceName));
        }
        else {
            KdPrintfd2(("  IoRegisterDeviceInterface failed: 0x%x\n", status));
            return status;
        }
    
        status = IoSetDeviceInterfaceState(&Dcb->MountedDeviceInterfaceName, TRUE);
    
        if (NT_SUCCESS(status)) {
            KdPrintfd2(("  IoSetDeviceInterfaceState success\n"));
        }
        else {
            RtlInitUnicodeString(&Dcb->MountedDeviceInterfaceName, NULL);
            KdPrintfd2(("  IoSetDeviceInterfaceState failed: 0x%x\n", status));
            return status;
        }
        KdPrintfd2(("pnpDeviceObject:"));
        KdCheckInterface(pnpDeviceObject);
        KdPrintfd2(("<= VDFSRegisterDeviceInterface\n"));
        return status;
    }


    VDFSRegisterMountedDeviceInterface don't work and return status 0xc0000010,

    because IoRegisterDeviceInterface fail!

    Why ???

    May be DeviceNode = NULL ????

    How setted DeviceNode ?

    What do I have to put in (Pointer DeviceNode) ?

    For information MountMgr return STATUS <(lower) 0x80000000 on function  IOCTL 'IOCTL_MOUNTMGR_CREATE_POINT'

    Thank.





    • Edited by Sizy458 Sunday, September 3, 2017 4:02 PM
    Sunday, September 3, 2017 3:58 PM

Answers

  • The simplest approach would probably be to have a simple KMDF driver that creates the DISK you need.  Then your file system would be a standard file system that is built above the volume that is created for your disk.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, September 4, 2017 12:38 PM

All replies

  • This is not a good usage of IoReportDetectedDevice. If you need a pdo, support pnp and be a bus driver

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Sunday, September 3, 2017 10:41 PM
  • Do I need implement DriverObject->DeviceExtension->AddDevice ?????
    Monday, September 4, 2017 7:18 AM
  • Yes you need to support AddDevice and all the other PnP calls. 


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, September 4, 2017 11:36 AM
  • Ok

    But this is to write kernel driver a disk file system for
    usermode process filesystem as does utility  'ElDos'
    Then Do I have to implement the AddDevice ??
    If yes to each disk created I should have call an
    IoAttachDeviceToDeviceStack (DcbDisk, PhysicalDeviceObject) ????
    The physicalObject  getted it in then handler DriverObject->AddDevice called by kernel.
    Should I call in the AddDevice Handler the function IoRegisterInterface MOUNTDEV_MOUNTED_DEVICE_GUID ???
    If I understood correctly at each disk creation filesystem, I just have to attach the DCB to the physicalDeviceObject, without doing it again IoRegisterInferface MOUNTDEV_MOUNTED_DEVICE_GUID in the Dcb ?????

    In french language :

    Mais Il s'agit d'écrire kernel driver un disk file system pour
    usermode process filesystem comme le fait  'ElDos'
    Est ce que je dois bien implementer le AddDevice ??
    Si oui à chaque disque créer je fais un IoAttachDeviceToDeviceStack (DcbDisk,PhysicalDeviceObject) ????
    Le physicalObject je le recupére dans AddDevice.
    Dois je appeller dans le AddDevice la fonction IoRegisterInterface MOUNTDEV_MOUNTED_DEVICE_GUID ???
    Si j'ai bien compris à chaque création de disque filesystem , je dois juste attacher le DCB au physicalDeviceObject , sans à refaire IoRegisterInferface MOUNTDEV_MOUNTED_DEVICE_GUID



    • Edited by yann458 Monday, September 4, 2017 12:28 PM
    Monday, September 4, 2017 12:28 PM
  • The simplest approach would probably be to have a simple KMDF driver that creates the DISK you need.  Then your file system would be a standard file system that is built above the volume that is created for your disk.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, September 4, 2017 12:38 PM
  • Big bug kernel !

    I do not want to be nasty, but still a bug in the windows kernel.
    1) The AddDevice is not calling
    2) When my driver is loading then  it  unload !

    NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT pdo)
    {
    	NTSTATUS status = STATUS_NOT_IMPLEMENTED;
    
    	UNICODE_STRING name, linkname;
    	
    	PDEVICE_EXTENSION_MOTHER h;
    	PFAST_IO_DISPATCH	fastIoDispatch;
    #ifdef FILESYSD
    	FS_FILTER_CALLBACKS FilterCallbacks;
    #endif
    	PAGED_CODE();
    	KdPrintf2(("Driver->ADDDevice\n"));
    	
    	RtlZeroMemory(&DiskGlobal, sizeof(DiskGlobal));
    
    
    	RtlInitUnicodeString(&name, namedriver);
    
    	status = IoCreateDevice(DriverObject,
    		sizeof(DEVICE_EXTENSION_MOTHER),
    		&name,
    		FILE_DEVICE_UNKNOWN,//FILE_DEVICE_VFUMS,
    		0,
    		FALSE,		// exclusive!
    		&g_devcontrol);
    	if (status != STATUS_SUCCESS) {
    		KdPrintf(("[VFUM] DriverEntry: IoCreateDevice: 0x%x!\n", status));
    		goto done;
    	}
    #ifdef FILESYSD
    	status = VDFSCreateGlobalDiskDevice(DriverObject, &DiskGlobal);
    	if ((!NT_SUCCESS(status)))
    	{
    		KdPrintf(("Initialization Failed Disk Volume\n"));
    		IoDeleteDevice(g_devcontrol);
    		goto done;
    
    	}
    #endif
    	//ZeroMemory(g_devcontrol,sizeof (DEVICE_EXTENSION_MOTHER));
    	memset(g_devcontrol->DeviceExtension, 0, sizeof(DEVICE_EXTENSION_MOTHER));
    	h = gm();
    	ExInitializeResourceLite(&h->ResourceCD);
    
    
    	ExInitializeResourceLite(&h->resservice);
    
    	InitializeListHead(&h->ListSendService);
    
    
    	//
    	// Initialize the driver object with this driver's entry points.
    	//
    
    	/*DriverObject->MajorFunction[IRP_MJ_CREATE]                   =
    	DriverObject->MajorFunction[IRP_MJ_CLOSE]                    =
    	DriverObject->MajorFunction[IRP_MJ_READ]                     =
    	DriverObject->MajorFunction[IRP_MJ_WRITE]                    =
    	DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION]        =
    	DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION]          =
    	DriverObject->MajorFunction[IRP_MJ_QUERY_EA]                 =
    	DriverObject->MajorFunction[IRP_MJ_SET_EA]                   =
    	DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS]            =
    	DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] =
    	DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION]   =
    	DriverObject->MajorFunction[IRP_MJ_CLEANUP]                  =
    	DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL]        =
    	DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL]      =
    	DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL]             =
    	DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]           =
    	DriverObject->MajorFunction[IRP_MJ_SHUTDOWN]                 =
    	DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY]		=
    	DriverObject->MajorFunction[IRP_MJ_SET_SECURITY]		=
    	DriverObject->MajorFunction[IRP_MJ_PNP]                      = (PDRIVER_DISPATCH)DrvDispatch;*/
    
    
    #ifdef FILESYSD
    
    	fastIoDispatch = ExAllocatePool(NonPagedPool, sizeof(FAST_IO_DISPATCH));
    	// TODO: check fastIoDispatch
    
    	RtlZeroMemory(fastIoDispatch, sizeof(FAST_IO_DISPATCH));
    
    	fastIoDispatch->SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
    	fastIoDispatch->FastIoCheckIfPossible = FastIoCheckIfPossible;
    	fastIoDispatch->FastIoRead = FsRtlCopyRead;
    	fastIoDispatch->FastIoWrite = FsRtlCopyWrite;
    	fastIoDispatch->AcquireFileForNtCreateSection = FatAcquireForCreateSection;
    	fastIoDispatch->ReleaseFileForNtCreateSection = FatReleaseForCreateSection;
    	fastIoDispatch->MdlRead = FsRtlMdlReadDev;
    	fastIoDispatch->MdlReadComplete = FsRtlMdlReadCompleteDev;
    	fastIoDispatch->PrepareMdlWrite = FsRtlPrepareMdlWriteDev;
    	fastIoDispatch->MdlWriteComplete = FsRtlMdlWriteCompleteDev;
    
    
    
    
    	fastIoDispatch->FastIoDeviceControl = NullFastIoDeviceControl;
    	fastIoDispatch->FastIoQueryBasicInfo = NullFastQueryDeviceInfo;
    	fastIoDispatch->FastIoQueryOpen = NullFastIoQueryOpen;
    
    	DriverObject->FastIoDispatch = fastIoDispatch;
    #endif
    
    	/*DriverObject->FastIoDispatch = &FatFastIoDispatch;
    
    	RtlZeroMemory(&FatFastIoDispatch, sizeof(FatFastIoDispatch));
    
    	FatFastIoDispatch.SizeOfFastIoDispatch =    sizeof(FAST_IO_DISPATCH);
    	FatFastIoDispatch.FastIoCheckIfPossible =   FatFastIoCheckIfPossible;  //  CheckForFastIo
    	FatFastIoDispatch.FastIoRead =              FsRtlCopyRead;             //  Read
    	FatFastIoDispatch.FastIoWrite =             FsRtlCopyWrite;            //  Write
    	FatFastIoDispatch.FastIoQueryBasicInfo =    FatFastQueryBasicInfo;     //  QueryBasicInfo
    	FatFastIoDispatch.FastIoQueryStandardInfo = FatFastQueryStdInfo;       //  QueryStandardInfo
    	FatFastIoDispatch.FastIoLock =              FatFastLock;               //  Lock
    	FatFastIoDispatch.FastIoUnlockSingle =      FatFastUnlockSingle;       //  UnlockSingle
    	FatFastIoDispatch.FastIoUnlockAll =         FatFastUnlockAll;          //  UnlockAll
    	FatFastIoDispatch.FastIoUnlockAllByKey =    FatFastUnlockAllByKey;     //  UnlockAllByKey
    	FatFastIoDispatch.FastIoQueryNetworkOpenInfo = FatFastQueryNetworkOpenInfo;
    	FatFastIoDispatch.AcquireForCcFlush =       FatAcquireForCcFlush;
    	FatFastIoDispatch.ReleaseForCcFlush =       FatReleaseForCcFlush;
    	FatFastIoDispatch.MdlRead =                 FsRtlMdlReadDev;
    	FatFastIoDispatch.MdlReadComplete =         FsRtlMdlReadCompleteDev;
    	FatFastIoDispatch.PrepareMdlWrite =         FsRtlPrepareMdlWriteDev;
    	FatFastIoDispatch.MdlWriteComplete =        FsRtlMdlWriteCompleteDev;*/
    
    #ifdef FILESYSD
    
    	RtlZeroMemory(&FilterCallbacks,
    		sizeof(FS_FILTER_CALLBACKS));
    
    	FilterCallbacks.SizeOfFsFilterCallbacks = sizeof(FS_FILTER_CALLBACKS);
    	FilterCallbacks.PreAcquireForSectionSynchronization = CdFilterCallbackAcquireForCreateSection;
    
    	status = FsRtlRegisterFileSystemFilterCallbacks(DriverObject,
    		&FilterCallbacks);
    
    	if (!NT_SUCCESS(status)) {
    
    		KdPrintf(("Failure function FsRtlRegisterFileSystemFilterCallbacks status = %x", status));
    		IoDeleteDevice(g_devcontrol);
    		VDFS_DoneDiskVolume(&DiskGlobal);
    		return status;
    	}
    #endif
    
    
    	RtlInitUnicodeString(&linkname, VDUM_CTL_DOSDEV_NAME);
    
    	status = IoCreateUnprotectedSymbolicLink(&linkname, &name);
    	if (status != STATUS_SUCCESS) {
    		KdPrintf(("[VFUM] DriverEntry: IoCreateUnprotectedSymbolicLink: 0x%x!\n", status));
    		IoDeleteDevice(g_devcontrol);
    #ifdef FILESYSD
    		VDFS_DoneDiskVolume(&DiskGlobal);
    #endif
    		goto done;
    	}
    	else
    		(*g_devcontrol).Flags &= ~DO_DEVICE_INITIALIZING;
    
    	status = PsSetCreateProcessNotifyRoutine(
    		CREATE_PROCESS_NOTIFY_ROUTINE,
    		FALSE
    	);
    	if (status != STATUS_SUCCESS)
    	{
    		KdPrintf(("[VFUM] DriverEntry: PsSetCreateProcessNotifyRoutine: 0x%x!\n", status));
    		IoDeleteSymbolicLink(&linkname);
    		IoDeleteDevice(g_devcontrol);
    #ifdef FILESYSD
    		VDFS_DoneDiskVolume(&DiskGlobal);
    #endif
    	}
    	KeInitializeEvent(&h->eventtimer1, SynchronizationEvent, FALSE);
    	KeInitializeEvent(&h->eventtimer2, SynchronizationEvent, FALSE);
    	KeInitializeEvent(&h->unloaddebug, SynchronizationEvent, FALSE);
    
    	KeInitializeEvent(&h->eventrequestservice, SynchronizationEvent, FALSE);
    	KeClearEvent(&h->eventtimer1);
    	KeClearEvent(&h->eventtimer2);
    	KeClearEvent(&h->unloaddebug);
    	KeClearEvent(&h->eventrequestservice);
    	//status = PsCreateSystemThread(&h->htimer,
    	//										(ACCESS_MASK) 0L,
    	//										NULL,
    	//										NULL,
    	//										NULL,
    	//										VFUM_DeviceTimer,
    	//										NULL);
    	//						      //status=STATUS_ACCESS_DENIED;
    
    	//							  if (!NT_SUCCESS(status))
    	//								{
    	//								  KdPrintf(("[VDRS] Cannot create device thread timer. (%#x)\n", status));
    	//								IoDeleteSymbolicLink(&linkname);
    	//								  IoDeleteDevice(g_devcontrol);
    	//								  VDFS_DoneDiskVolume(&DiskGlobal);
    	//								  //IoDeleteDevice(diskDeviceObject);
    	//								  goto done;
    	//								  
    
    	//								  
    	//								}
    	//							  else
    	//							  {
    
    	//								 
    	//								ZwClose(h->htimer);
    	//							  }
    
    #ifdef FILESYSD
    	status = PsCreateSystemThread(&h->hgeneric,
    		(ACCESS_MASK)0L,
    		NULL,
    		NULL,
    		NULL,
    		GeneralDeviceThreadToken,
    		g_devcontrol);
    	//status=STATUS_ACCESS_DENIED;
    
    	if (!NT_SUCCESS(status))
    	{
    		KdPrintf(("[VDRS] Cannot create device thread of timeout. (%#x)\n", status));
    		IoDeleteSymbolicLink(&linkname);
    		IoDeleteDevice(g_devcontrol);
    		VDFS_DoneDiskVolume(&DiskGlobal);
    		//IoDeleteDevice(diskDeviceObject);
    		goto done;
    
    
    
    	}
    	else
    	{
    
    		ZwClose(h->hgeneric);
    	}
    #endif
    done:;
    	ObReferenceObject(g_devcontrol);
    
    
    
    	PDEVICE_EXTENSION_MOTHER g = gm();
    	if (g != NULL)
    	{
    		//TPARAMVDF _vdf;
    		g->pdo = pdo;
    
    		status = VDFSRegisterMountedDeviceInterface(pdo, NULL);
    	}
    	else
    		status = STATUS_INTERNAL_ERROR;
    	KdPrintf2(("Driver->ADDDevice return status %x\n"));
    	return status;
    }
    
    NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,
                IN PUNICODE_STRING theRegistryPath)
    {
    	
    	KdPrintf(("DriverEntry Begin\n"));
    
    	DriverObject->MajorFunction[IRP_MJ_CREATE] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_CLOSE] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_CLEANUP] = DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] =
    		DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] =
    		DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_READ] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_WRITE] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_PNP] = DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL] = DrvDispatch;
    
    	DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] = DrvDispatch;
    	DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] = DrvDispatch;
    	DriverObject->DriverUnload = VFUMS_Unload;
    	DriverObject->DriverExtension->AddDevice = AddDevice;
    
    	
    	KdPrintf(("DriverEntry End return \n"));
    		return STATUS_SUCCESS; 
    
    
    }

    And the DebugView utility gives me these:

    Driver Verifier: Enabled for vdfs_x64.sys, flags 0x209bb, build 10240, key S6cUS65zUxifa0SHK9yEnC
    [VDFS] DriverEntry Begin
    [VDFS] DriverEntry End return
    [VDFS] iodeletelink
    [VDFS] [VFUM] IoDeleteDevice.
    [VDFS] PsSetCreateProcessNotifyRoutine to NULL
    [VDFS] ExDeleteResourceLite(&g->ResourceCD);
    [VDFS] VDFS_DoneDiskVolume
    [VDFS] VDFS_DoneDiskVolume [END]
    [VDFS] [VFUM] IoDeleteDevice OK.



    • Edited by Sizy458 Monday, September 4, 2017 5:05 PM
    Monday, September 4, 2017 4:54 PM
  • As has been explained to you multiple times you are trying to mash together a number of items that should be in separate drivers.  This is not a kernel bug, it is a major flaw in your design.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, September 4, 2017 4:57 PM

  • So
    What do I need to correct in my code, for the AddDevice to be called?

    I readded the documentation ! And it don't work

    • Edited by Sizy458 Monday, September 4, 2017 5:20 PM
    Monday, September 4, 2017 5:16 PM
  • It don't work with Toaster !!

    I compiled toaster from winddk 7.1 and AddDevice not called !!

    AddDevice not called !

    Monday, September 4, 2017 6:07 PM
  • How are you installing the driver?  If you are using NET START it will not work, that is not for PnP drivers.  If you have an INF with a manufacturers section and install with DeviceManager or DevCon then you will get called.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, September 4, 2017 6:40 PM
  • I go through by a service API.
    I install my driver with the Microsoft utility 'SC.EXE'
    SC INSTALL ....
    SC START ....


    I need device_object pdo because
    i would mount my disk filesystem by mountmgr.
    For these, Do should you
    inevitably passed through DeviceManager ??? (pour ceux-ci dois t'on passer obligatoirement par DeviceManager ???)
    I need to mount my disk filesystem by mountmgr,
    because the 'cl.exe' of Visual Studio 2015 don't work on my disk filesystem because  cl.exe require the disk filesystem will be mounted by mountmgr and not mounted by IOCTL FSCTL_REPARSE_POINT......
    Otherwise cl.exe work good on the normal disk filesystem (Ex c:, d: .....)
    • Edited by Sizy458 Monday, September 4, 2017 8:00 PM
    Monday, September 4, 2017 7:35 PM
  • Create an INF file, and use DevCon to replace SC.EXE basically use DifxAPI.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, September 4, 2017 9:21 PM
  • Sorry , but i look source code 'truecrypt' ,

    and it use utility 'SC.exe' OpenSCMManager for install their driver 'truecrypt*.sys".

    In the source truecrypt 'ntdriver.c' i see then famous 'AddDevice'.

    SO.....


    • Edited by yann458 Tuesday, September 5, 2017 12:33 PM
    Tuesday, September 5, 2017 7:14 AM
  • Sorry , but i look source code 'truecrypt' ,

    and it use utility 'SC.exe' OpenSCMManager for install their driver 'truecrypt*.sys".

    In the source truecrypt 'ntdriver.c' i see then famous 'AddDevice'.

    SO.....


    • Edited by yann458 Tuesday, September 5, 2017 12:32 PM
    Tuesday, September 5, 2017 12:32 PM
  • So TrueCrypt which was a piece of garbage when I looked at it years ago, has done some sort of hack, either walk through that code and figure how it works, or do the correct thing.

    Bottom line you are trying to develop a file system for Windows which is a very hard thing to do, at the same time you are trying to do a ton of non-standard things each of which is going to be hard to do.  Most people work to make their life easier, you are doing the opposite.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, September 5, 2017 12:39 PM